Product constructor

Product(
  1. int quantity,
  2. String name,
  3. String description,
  4. double price,
  5. double tax,
)

Implementation

Product(this.quantity, this.name, this.description, double price, double tax){
    if(quantity<1){
        throw EEnzonaPayment("Quantity must be greater than zero");
    }
    if(price<=0){
        throw EEnzonaPayment("Price must be greater than zero");
    }

    this.price = "${price}0";
    this.tax = "${tax}0";
}