package de.avatic.lcc.model.db.rates;

import de.avatic.lcc.dto.generic.TransportType;
import jakarta.validation.constraints.Digits;
import jdk.jfr.Unsigned;

import java.math.BigDecimal;


public class ContainerRate {

    private Integer id;

    private TransportType type;

    @Digits(integer = 15, fraction = 2)
    private BigDecimal rateTeu;


    @Digits(integer = 15, fraction = 2)
    private BigDecimal rateFeu;


    @Digits(integer = 15, fraction = 2)
    private BigDecimal rateHc;

    @Unsigned
    private Integer leadTime;

    private Integer fromNodeId;

    private Integer toNodeId;

    private Integer validityPeriodId;

    private Integer fromCountryId;

    private Integer toCountryId;


    public Integer getFromCountryId() {
        return fromCountryId;
    }

    public void setFromCountryId(int fromCountryId) {
        if (fromCountryId != 0)
            this.fromCountryId = fromCountryId;
        else this.fromCountryId = null;
    }

    public Integer getToCountryId() {
        return toCountryId;
    }

    public void setToCountryId(int toCountryId) {
        if (toCountryId != 0)
            this.toCountryId = toCountryId;
        else this.toCountryId = null;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public TransportType getType() {
        return type;
    }

    public void setType(TransportType type) {
        this.type = type;
    }

    public BigDecimal getRateTeu() {
        return rateTeu;
    }

    public void setRateTeu(BigDecimal rateTeu) {
        this.rateTeu = rateTeu;
    }

    public BigDecimal getRateFeu() {
        return rateFeu;
    }

    public void setRateFeu(BigDecimal rateFeu) {
        this.rateFeu = rateFeu;
    }

    public BigDecimal getRateHc() {
        return rateHc;
    }

    public void setRateHc(BigDecimal rateHc) {
        this.rateHc = rateHc;
    }

    public Integer getLeadTime() {
        return leadTime;
    }

    public void setLeadTime(Integer leadTime) {
        this.leadTime = leadTime;
    }

    public Integer getFromNodeId() {
        return fromNodeId;
    }

    public void setFromNodeId(Integer fromNodeId) {
        this.fromNodeId = fromNodeId;
    }

    public Integer getToNodeId() {
        return toNodeId;
    }

    public void setToNodeId(Integer toNodeId) {
        this.toNodeId = toNodeId;
    }

    public Integer getValidityPeriodId() {
        return validityPeriodId;
    }

    public void setValidityPeriodId(Integer validityPeriodId) {
        this.validityPeriodId = validityPeriodId;
    }
}
