From 2b58cbc635f9f1eb22d1f89d90ccb3f4632eb6bd Mon Sep 17 00:00:00 2001 From: "Notmoo-PC\\Notmoo" Date: Sat, 27 Jan 2018 18:56:31 +0100 Subject: [PATCH] [CORE] LightweightSale : Ajout de l'attr 'price'; ajout de getters/setters pour les attrs 'price' et 'worth' --- .../core/entities/sale/LightweightSale.java | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/Workspace/core/src/main/java/com/pqt/core/entities/sale/LightweightSale.java b/Workspace/core/src/main/java/com/pqt/core/entities/sale/LightweightSale.java index 4c0cd0db..81537355 100644 --- a/Workspace/core/src/main/java/com/pqt/core/entities/sale/LightweightSale.java +++ b/Workspace/core/src/main/java/com/pqt/core/entities/sale/LightweightSale.java @@ -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);