class BudgetReAppropriationMapper {

    public BudgetReAppropriation toDomain(final BudgetReAppropriationContract contract) {

        final BudgetReAppropriation budgetReAppropriation = new BudgetReAppropriation();
        final BudgetDetailMapper bdMapper = new BudgetDetailMapper();

        budgetReAppropriation.setId(contract.getId());
        budgetReAppropriation.setBudgetDetail(bdMapper.toDomain(contract.getBudgetDetail()));
        budgetReAppropriation.setAdditionAmount(contract.getAdditionAmount());
        budgetReAppropriation.setDeductionAmount(contract.getDeductionAmount());
        budgetReAppropriation.setOriginalAdditionAmount(contract.getOriginalAdditionAmount());
        budgetReAppropriation.setOriginalDeductionAmount(contract.getOriginalDeductionAmount());
        budgetReAppropriation.setAnticipatoryAmount(contract.getAnticipatoryAmount());
        budgetReAppropriation.setStatus(FinancialStatusContract.builder()
                .id(contract.getStatus() != null ? contract.getStatus().getId() : null).build());
        budgetReAppropriation.setAsOnDate(contract.getAsOnDate());
        budgetReAppropriation.setCreatedBy(contract.getCreatedBy());
        budgetReAppropriation.setCreatedDate(contract.getCreatedDate());
        budgetReAppropriation.setLastModifiedBy(contract.getLastModifiedBy());
        budgetReAppropriation.setLastModifiedDate(contract.getLastModifiedDate());
        budgetReAppropriation.setTenantId(contract.getTenantId());

        return budgetReAppropriation;
    }

}