package de.effigenix.infrastructure.masterdata.persistence.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Embeddable;

import java.math.BigDecimal;

@Embeddable
public class ContractLineItemEmbeddable {

    @Column(name = "article_id", nullable = false, length = 36)
    private String articleId;

    @Column(name = "agreed_price_amount", nullable = false, precision = 19, scale = 2)
    private BigDecimal agreedPriceAmount;

    @Column(name = "agreed_price_currency", nullable = false, length = 3)
    private String agreedPriceCurrency;

    @Column(name = "agreed_quantity", precision = 19, scale = 4)
    private BigDecimal agreedQuantity;

    @Column(name = "unit", length = 30)
    private String unit;

    protected ContractLineItemEmbeddable() {}

    public ContractLineItemEmbeddable(String articleId, BigDecimal agreedPriceAmount,
                                      String agreedPriceCurrency, BigDecimal agreedQuantity, String unit) {
        this.articleId = articleId;
        this.agreedPriceAmount = agreedPriceAmount;
        this.agreedPriceCurrency = agreedPriceCurrency;
        this.agreedQuantity = agreedQuantity;
        this.unit = unit;
    }

    public String getArticleId() { return articleId; }
    public BigDecimal getAgreedPriceAmount() { return agreedPriceAmount; }
    public String getAgreedPriceCurrency() { return agreedPriceCurrency; }
    public BigDecimal getAgreedQuantity() { return agreedQuantity; }
    public String getUnit() { return unit; }
}
