class BudgetReAppropriationMapper {

    public BudgetReAppropriationSearch toSearchDomain(final BudgetReAppropriationSearchContract contract) {

        final BudgetReAppropriationSearch budgetReAppropriationSearch = new BudgetReAppropriationSearch();

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

        return budgetReAppropriationSearch;
    }

}