mirror of
https://github.com/klmp200/PQT_Gestionnaire_vente_stock.git
synced 2024-11-25 02:24:17 +00:00
[CORE] LightweightSale : Ajout de l'attr 'price'; ajout de getters/setters pour les attrs 'price' et 'worth'
This commit is contained in:
parent
d59fa8a393
commit
2b58cbc635
@ -19,11 +19,9 @@ public class LightweightSale {
|
|||||||
private Account orderedFor;
|
private Account orderedFor;
|
||||||
private SaleType type;
|
private SaleType type;
|
||||||
private SaleStatus status;
|
private SaleStatus status;
|
||||||
|
private Double price;
|
||||||
private Double worth;
|
private Double worth;
|
||||||
|
|
||||||
public LightweightSale() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public LightweightSale(Sale sale) {
|
public LightweightSale(Sale sale) {
|
||||||
this.id = sale.getId();
|
this.id = sale.getId();
|
||||||
this.orderedWith = sale.getOrderedWith();
|
this.orderedWith = sale.getOrderedWith();
|
||||||
@ -35,6 +33,8 @@ public class LightweightSale {
|
|||||||
for(Product product : sale.getProducts().keySet()){
|
for(Product product : sale.getProducts().keySet()){
|
||||||
products.put(product.getId(), sale.getProducts().get(product));
|
products.put(product.getId(), sale.getProducts().get(product));
|
||||||
}
|
}
|
||||||
|
price = sale.getTotalPrice();
|
||||||
|
worth = sale.getTotalWorth();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
@ -93,6 +93,22 @@ public class LightweightSale {
|
|||||||
this.status = status;
|
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
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(id, products, orderedBy, orderedFor, orderedWith, type);
|
return Objects.hash(id, products, orderedBy, orderedFor, orderedWith, type);
|
||||||
|
Loading…
Reference in New Issue
Block a user