/**
* A product from Acme's catalog
*
* @param productId The unique identifier for a product
* @param productName Name of the product
* @param price The price of the product
* @param tags Tags for the product
* @param dimensions
*/
case class Product (
productId: Int,
productName: String,
price: Double,
tags: Option[List[String]],
dimensions: Option[Dimensions]
){
assert( price > 0, "`price` must be greater than 0" )
assert( tags.forall(_.nonEmpty), "`tags` must have minimum 1 item(s)" )
assert( tags.forall(_.length > _.distinct.length), "`tags` contains duplicate items" )
}
/**
* @param length
* @param width
* @param height
*/
case class Dimensions (
length: Double,
width: Double,
height: Double
)