package io.github.zutherb.appstash.shop.service.order.model;

import io.github.zutherb.appstash.shop.service.product.model.ProductInfo;
import io.github.zutherb.appstash.shop.service.product.model.ProductInfo;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * @author zutherb
 */
public class OrderItemInfo implements Serializable {

    private ProductInfo product;
    private String uuid;

    private OrderItemInfo() {
    }

    public OrderItemInfo(ProductInfo product, String uuid) {
        this.product = product;
        this.uuid = uuid;
    }

    public ProductInfo getProduct() {
        return product;
    }

    public BigDecimal getTotalSum() {
        BigDecimal totalSum = BigDecimal.ZERO;
        totalSum = totalSum.add(product.getPrice());
        return totalSum;
    }

    public String getUuid() {
        return uuid;
    }
}

@@ -627,32 +627,230 @@
 product;%0A    %7D%0A%0A
+    public BigDecimal getDiscountSum() %7B%0A        BigDecimal discountSum = BigDecimal.ZERO;%0A        totalSum = discountSum.add(product.getPrice()*(0.25/100));%0A        return totalSum;%0A    %7D    %0A    %0A
     public BigDe
@@ -968,16 +968,48 @@
 tPrice()
+-(product.getPrice()*(0.25/100))
 );%0A     

Update OrderItemInfo.java