/**
* When this product has been created
*/
- @Basic(optional = false)
- @Column(name = "product_created", nullable = false, updatable = false)
- @Temporal(TemporalType.TIMESTAMP)
+ @Basic (optional = false)
+ @Column (name = "product_created", nullable = false, updatable = false)
+ @Temporal (TemporalType.TIMESTAMP)
private Date productCreated;
+ /**
+ * Gross price of product
+ */
+ @Basic (optional = false)
+ @Column (name = "product_gross_price", nullable = false)
+ private Float productGrossPrice;
+
/**
* Id number of product
*/
private Long productId;
/**
- * Price of product
+ * Net price of product
*/
- @Basic (optional = false)
- @Column (name = "product_price", nullable = false)
- private Float productPrice;
+ @Column (name = "product_net_price")
+ private Float productNetPrice;
+
+ /**
+ * Tax rate (0-1, by 1=100%)
+ */
+ @Column (name = "product_gross_price")
+ private Float productTaxRate;
/**
* Title of product
* Constructor will all required data
* <p>
* @param productTitle Name of product
- * @param productPrice Price
+ * @param productGrossPrice Product's gross price
* @param productCategory Category instance
* @param productAvailability Availability (selectable by customer)
*/
- public GenericProduct (final String productTitle, final Float productPrice, final Category productCategory, final Boolean productAvailability) {
+ public GenericProduct (final String productTitle, final Float productGrossPrice, final Category productCategory, final Boolean productAvailability) {
// Set all here
this.productTitle = productTitle;
- this.productPrice = productPrice;
+ this.productGrossPrice = productGrossPrice;
this.productCategory = productCategory;
this.productAvailability = productAvailability;
}
this.productCreated = productCreated;
}
+ @Override
+ public Float getProductGrossPrice () {
+ return this.productGrossPrice;
+ }
+
+ @Override
+ public void setProductGrossPrice (final Float productGrossPrice) {
+ this.productGrossPrice = productGrossPrice;
+ }
+
@Override
public Long getProductId () {
return this.productId;
}
@Override
- public Float getProductPrice () {
- return this.productPrice;
+ public Float getProductNetPrice () {
+ return this.productNetPrice;
+ }
+
+ @Override
+ public void setProductNetPrice (final Float productNetPrice) {
+ this.productNetPrice = productNetPrice;
+ }
+
+ @Override
+ public Float getProductTaxRate () {
+ return this.productTaxRate;
}
@Override
- public void setProductPrice (final Float productPrice) {
- this.productPrice = productPrice;
+ public void setProductTaxRate (final Float productTaxRate) {
+ this.productTaxRate = productTaxRate;
}
@Override
void setProductId (final Long productId);
/**
- * Getter for raw price.
+ * Getter for product's net price
* <p>
- * @return Single price of product
+ * @return Product's net price
*/
- Float getProductPrice ();
+ Float getProductNetPrice ();
/**
- * Price of product
+ * Setter for product's net price
* <p>
- * @param productPrice the price to set
+ * @param productNetPrice Product's net price
*/
- void setProductPrice (final Float productPrice);
+ void setProductNetPrice (final Float productNetPrice);
+
+ /**
+ * Getter for product's tax rate
+ * <p>
+ * @return Product's tax rate
+ */
+ Float getProductTaxRate ();
+
+ /**
+ * Setter for product's tax rate
+ * <p>
+ * @param productTaxRate Product's tax rate
+ */
+ void setProductTaxRate (final Float productTaxRate);
+
+ /**
+ * Getter for product's gross price
+ * <p>
+ * @return Product's gross price
+ */
+ Float getProductGrossPrice ();
+
+ /**
+ * Setter for product's gross price
+ * <p>
+ * @param productGrossPrice Product's gross price
+ */
+ void setProductGrossPrice (final Float productGrossPrice);
/**
* Getter for title.