[CORE] LightweightSale : Ajout de l'attr 'price'; ajout de getters/setters pour les attrs 'price' et 'worth'

This commit is contained in:
Notmoo-PC\Notmoo 2018-01-27 18:56:31 +01:00
parent d59fa8a393
commit 2b58cbc635

View File

@ -19,11 +19,9 @@ public class LightweightSale {
private Account orderedFor;
private SaleType type;
private SaleStatus status;
private Double price;
private Double worth;
public LightweightSale() {
}
public LightweightSale(Sale sale) {
this.id = sale.getId();
this.orderedWith = sale.getOrderedWith();
@ -35,6 +33,8 @@ public class LightweightSale {
for(Product product : sale.getProducts().keySet()){
products.put(product.getId(), sale.getProducts().get(product));
}
price = sale.getTotalPrice();
worth = sale.getTotalWorth();
}
public int getId() {
@ -93,6 +93,22 @@ public class LightweightSale {
this.status = status;
}
public Double getPrice() {
return price;
}
public void setPrice(Double price) {
this.price = price;
}
public Double getWorth() {
return worth;
}
public void setWorth(Double worth) {
this.worth = worth;
}
@Override
public int hashCode() {
return Objects.hash(id, products, orderedBy, orderedFor, orderedWith, type);