OrganisationDTO.java

package com.tradecloud.dto.api.organisation;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonRootName;
import com.tradecloud.domain.model.organisationalunit.OrganisationalUnit;
import com.tradecloud.dto.address.AddressDTO;
import com.tradecloud.dto.address.Addressed;
import com.tradecloud.dto.api.StaticDataDTO;
import com.tradecloud.dto.api.agent.ContactDTO;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

@JsonRootName(value = "organisationDTO")
public class OrganisationDTO implements Addressed {

    @JsonProperty(required = true)
    @JsonPropertyDescription(value = "The organisation Name.")
    private String name;

    @JsonProperty(required = true)
    @JsonPropertyDescription(value = "The organisation code/short name.")
    private String code;

    @JsonProperty(required = false)
    @JsonPropertyDescription(value = "The tier of the organisational unit in the company structure")
    private String tier;

    @JsonProperty(required = true)
    @JsonPropertyDescription(value = "")
    private String parent;

    @JsonProperty(required = false)
    @JsonPropertyDescription(value = "")
    private String customsCode;

    @JsonProperty(required = false)
    @JsonPropertyDescription(value = "")
    private String vatRegistrationNumber;
    private BigDecimal interestRate;
    private Integer creditTerm;
    private BigDecimal marginFee;
    private BigDecimal serviceFee;
    private BigDecimal primeInterestRate;
    @JsonProperty
    private List<AddressDTO> addresses;
    @JsonProperty
    //Partial loaded, just code and name
    private List<StaticDataDTO> agents = new ArrayList<>();
    private boolean sabsEnabled;
    //Partial loaded, just code and name
    private List<StaticDataDTO> serviceProviderDTOS = new ArrayList<>();

    private List<ContactDTO> contacts;
    //
    private Boolean active = Boolean.TRUE;
    private boolean placeOrders;
    private boolean hasItems;
    private boolean hasInvoice;
    private boolean letterOfCreditApplicant;
    private boolean generateShippingReference;
    private Integer orderShippingRefCounter;
    private String codeForShippingReference;
    private boolean allowsSuppliers;
    private boolean allowsAgents;
    private boolean allowsServiceProviders;
    private int daysFinance = 0;
    private String codeName;
    private boolean importUnit;
    private boolean exportUnit;
    private String salesTaxRegistrationNumber;
    private String companyRegistrationNumber;
    private boolean allowSampleAndSparePart;
    private boolean allowFinance;
    private boolean allowInsurance;
    private boolean allowForex;
    private boolean allowLogistics;
    @JsonProperty
    private OrganisationalUnit.Type type;
    private BigDecimal estimateAnnualValue;

    private Long id;
    private Long parentId;

    public List<ContactDTO> getContacts() {
        return contacts;
    }

    public void setContacts(List<ContactDTO> contacts) {
        this.contacts = contacts;
    }

    public OrganisationalUnit.Type getType() {
        return type;
    }

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

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getTier() {
        return tier;
    }

    public void setTier(String tier) {
        this.tier = tier;
    }

    public String getParent() {
        return parent;
    }

    public void setParent(String parent) {
        this.parent = parent;
    }

    public String getCustomsCode() {
        return customsCode;
    }

    public void setCustomsCode(String customsCode) {
        this.customsCode = customsCode;
    }

    public String getVatRegistrationNumber() {
        return vatRegistrationNumber;
    }

    public void setVatRegistrationNumber(String vatRegistrationNumber) {
        this.vatRegistrationNumber = vatRegistrationNumber;
    }

    public BigDecimal getInterestRate() {
        return interestRate;
    }

    public void setInterestRate(BigDecimal interestRate) {
        this.interestRate = interestRate;
    }

    public Integer getCreditTerm() {
        return creditTerm;
    }

    public void setCreditTerm(Integer creditTerm) {
        this.creditTerm = creditTerm;
    }

    public BigDecimal getMarginFee() {
        return marginFee;
    }

    public void setMarginFee(BigDecimal marginFee) {
        this.marginFee = marginFee;
    }

    @Override
    public List<AddressDTO> getAddresses() {
        if (addresses == null) {
            addresses = new ArrayList<>();
        }
        return addresses;
    }

    public void setAddresses(List<AddressDTO> addresses) {
        this.addresses = addresses;
    }

    public List<StaticDataDTO> getAgents() {
        return agents;
    }

    public void setAgents(List<StaticDataDTO> agents) {
        this.agents = agents;
    }

    public boolean isSabsEnabled() {
        return sabsEnabled;
    }

    public void setSabsEnabled(boolean sabsEnabled) {
        this.sabsEnabled = sabsEnabled;
    }

    public Boolean getActive() {
        return active;
    }

    public void setActive(Boolean active) {
        this.active = active;
    }

    public boolean isPlaceOrders() {
        return placeOrders;
    }

    public void setPlaceOrders(boolean placeOrders) {
        this.placeOrders = placeOrders;
    }

    public boolean isHasItems() {
        return hasItems;
    }

    public void setHasItems(boolean hasItems) {
        this.hasItems = hasItems;
    }

    public boolean isHasInvoice() {
        return hasInvoice;
    }

    public void setHasInvoice(boolean hasInvoice) {
        this.hasInvoice = hasInvoice;
    }

    public boolean isLetterOfCreditApplicant() {
        return letterOfCreditApplicant;
    }

    public void setLetterOfCreditApplicant(boolean letterOfCreditApplicant) {
        this.letterOfCreditApplicant = letterOfCreditApplicant;
    }

    public boolean isGenerateShippingReference() {
        return generateShippingReference;
    }

    public void setGenerateShippingReference(boolean generateShippingReference) {
        this.generateShippingReference = generateShippingReference;
    }

    public Integer getOrderShippingRefCounter() {
        return orderShippingRefCounter;
    }

    public void setOrderShippingRefCounter(Integer orderShippingRefCounter) {
        this.orderShippingRefCounter = orderShippingRefCounter;
    }

    public String getCodeForShippingReference() {
        return codeForShippingReference;
    }

    public void setCodeForShippingReference(String codeForShippingReference) {
        this.codeForShippingReference = codeForShippingReference;
    }

    public boolean isAllowsSuppliers() {
        return allowsSuppliers;
    }

    public void setAllowsSuppliers(boolean allowsSuppliers) {
        this.allowsSuppliers = allowsSuppliers;
    }

    public boolean isAllowsAgents() {
        return allowsAgents;
    }

    public void setAllowsAgents(boolean allowsAgents) {
        this.allowsAgents = allowsAgents;
    }

    public boolean isAllowsServiceProviders() {
        return allowsServiceProviders;
    }

    public void setAllowsServiceProviders(boolean allowsServiceProviders) {
        this.allowsServiceProviders = allowsServiceProviders;
    }

    public int getDaysFinance() {
        return daysFinance;
    }

    public void setDaysFinance(int daysFinance) {
        this.daysFinance = daysFinance;
    }

    public String getCodeName() {
        return codeName;
    }

    public void setCodeName(String codeName) {
        this.codeName = codeName;
    }

    public boolean isImportUnit() {
        return importUnit;
    }

    public void setImportUnit(boolean importUnit) {
        this.importUnit = importUnit;
    }

    public boolean isExportUnit() {
        return exportUnit;
    }

    public void setExportUnit(boolean exportUnit) {
        this.exportUnit = exportUnit;
    }

    public String getSalesTaxRegistrationNumber() {
        return salesTaxRegistrationNumber;
    }

    public void setSalesTaxRegistrationNumber(String salesTaxRegistrationNumber) {
        this.salesTaxRegistrationNumber = salesTaxRegistrationNumber;
    }

    public String getCompanyRegistrationNumber() {
        return companyRegistrationNumber;
    }

    public void setCompanyRegistrationNumber(String companyRegistrationNumber) {
        this.companyRegistrationNumber = companyRegistrationNumber;
    }

    public boolean isAllowSampleAndSparePart() {
        return allowSampleAndSparePart;
    }

    public void setAllowSampleAndSparePart(boolean allowSampleAndSparePart) {
        this.allowSampleAndSparePart = allowSampleAndSparePart;
    }

    public List<StaticDataDTO> getServiceProviderDTOS() {
        return serviceProviderDTOS;
    }

    public void setServiceProviderDTOS(List<StaticDataDTO> serviceProviderDTOS) {
        this.serviceProviderDTOS = serviceProviderDTOS;
    }

    public boolean isAllowFinance() {
        return allowFinance;
    }

    public void setAllowFinance(boolean allowFinance) {
        this.allowFinance = allowFinance;
    }

    public boolean isAllowInsurance() {
        return allowInsurance;
    }

    public void setAllowInsurance(boolean allowInsurance) {
        this.allowInsurance = allowInsurance;
    }

    public boolean isAllowForex() {
        return allowForex;
    }

    public void setAllowForex(boolean allowForex) {
        this.allowForex = allowForex;
    }

    public boolean isAllowLogistics() {
        return allowLogistics;
    }

    public void setAllowLogistics(boolean allowLogistics) {
        this.allowLogistics = allowLogistics;
    }

    public BigDecimal getServiceFee() {
        return serviceFee;
    }

    public void setServiceFee(BigDecimal serviceFee) {
        this.serviceFee = serviceFee;
    }

    public BigDecimal getPrimeInterestRate() {
        return primeInterestRate;
    }

    public void setPrimeInterestRate(BigDecimal primeInterestRate) {
        this.primeInterestRate = primeInterestRate;
    }

    public BigDecimal getEstimateAnnualValue() {
        return estimateAnnualValue;
    }

    public void setEstimateAnnualValue(BigDecimal estimateAnnualValue) {
        this.estimateAnnualValue = estimateAnnualValue;
    }

    public Long getId() {
        return id;
    }

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

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }
}