@Test public void test_to_domain() { final BudgetDetail expectedDomain = budgetDetailMapper.toDomain(contract()); assertEquals(expectedDomain.getId(), domain().getId()); assertEquals(expectedDomain.getBudgetGroup().getId(), domain().getBudgetGroup().getId()); assertEquals(expectedDomain.getBudget().getId(), domain().getBudget().getId()); assertEquals(expectedDomain.getOriginalAmount(), domain().getOriginalAmount()); assertEquals(expectedDomain.getApprovedAmount(), domain().getApprovedAmount()); assertEquals(expectedDomain.getBudgetAvailable(), domain().getBudgetAvailable()); assertEquals(expectedDomain.getAnticipatoryAmount(), domain().getAnticipatoryAmount()); assertEquals(expectedDomain.getUsingDepartment().getId(), domain().getUsingDepartment().getId()); assertEquals(expectedDomain.getExecutingDepartment().getId(), domain().getExecutingDepartment().getId()); assertEquals(expectedDomain.getFunction().getId(), domain().getFunction().getId()); assertEquals(expectedDomain.getScheme().getId(), domain().getScheme().getId()); assertEquals(expectedDomain.getFund().getId(), domain().getFund().getId()); assertEquals(expectedDomain.getSubScheme().getId(), domain().getSubScheme().getId()); assertEquals(expectedDomain.getFunctionary().getId(), domain().getFunctionary().getId()); assertEquals(expectedDomain.getBoundary().getId(), domain().getBoundary().getId()); assertEquals(expectedDomain.getMaterializedPath(), domain().getMaterializedPath()); assertEquals(expectedDomain.getDocumentNumber(), domain().getDocumentNumber()); assertEquals(expectedDomain.getUniqueNo(), domain().getUniqueNo()); assertEquals(expectedDomain.getPlanningPercent(), domain().getPlanningPercent()); assertEquals(expectedDomain.getStatus().getId(), domain().getStatus().getId()); assertEquals(expectedDomain.getCreatedBy().getId(), domain().getCreatedBy().getId()); assertEquals(expectedDomain.getLastModifiedBy().getId(), domain().getLastModifiedBy().getId()); assertEquals(expectedDomain.getTenantId(), domain().getTenantId()); }
public BudgetDetail toDomain(final BudgetDetailContract contract) { final BudgetDetail budgetDetail = new BudgetDetail(); budgetDetail.setId(contract.getId()); budgetDetail.setBudgetGroup(contract.getBudgetGroup()); final Budget budget = Budget.builder().id(contract.getBudget() != null ? contract.getBudget().getId() : null).build(); budget.setTenantId(contract.getBudget() != null ? contract.getBudget().getTenantId() : null); budgetDetail.setBudget(budget); budgetDetail.setOriginalAmount(contract.getOriginalAmount()); budgetDetail.setApprovedAmount(contract.getApprovedAmount()); budgetDetail.setBudgetAvailable(contract.getBudgetAvailable()); budgetDetail.setAnticipatoryAmount(contract.getAnticipatoryAmount()); budgetDetail.setUsingDepartment(contract.getUsingDepartment()); budgetDetail.setExecutingDepartment(contract.getUsingDepartment()); budgetDetail.setFunction(contract.getFunction()); budgetDetail.setScheme(contract.getScheme()); budgetDetail.setFund(contract.getFund()); budgetDetail.setSubScheme(contract.getSubScheme()); budgetDetail.setFunctionary(contract.getFunctionary()); budgetDetail.setBoundary(contract.getBoundary()); budgetDetail.setMaterializedPath(contract.getMaterializedPath()); budgetDetail.setDocumentNumber(contract.getDocumentNumber()); budgetDetail.setUniqueNo(contract.getUniqueNo()); budgetDetail.setPlanningPercent(contract.getPlanningPercent()); budgetDetail.setStatus(FinancialStatusContract.builder() .id(contract.getStatus() != null ? contract.getStatus().getId() : null).build()); budgetDetail.setCreatedBy(contract.getCreatedBy()); budgetDetail.setCreatedDate(contract.getCreatedDate()); budgetDetail.setLastModifiedBy(contract.getLastModifiedBy()); budgetDetail.setLastModifiedDate(contract.getLastModifiedDate()); budgetDetail.setTenantId(contract.getTenantId()); return budgetDetail; }
BudgetDetailMapper { public BudgetDetail toDomain(final BudgetDetailContract contract) { final BudgetDetail budgetDetail = new BudgetDetail(); budgetDetail.setId(contract.getId()); budgetDetail.setBudgetGroup(contract.getBudgetGroup()); final Budget budget = Budget.builder().id(contract.getBudget() != null ? contract.getBudget().getId() : null).build(); budget.setTenantId(contract.getBudget() != null ? contract.getBudget().getTenantId() : null); budgetDetail.setBudget(budget); budgetDetail.setOriginalAmount(contract.getOriginalAmount()); budgetDetail.setApprovedAmount(contract.getApprovedAmount()); budgetDetail.setBudgetAvailable(contract.getBudgetAvailable()); budgetDetail.setAnticipatoryAmount(contract.getAnticipatoryAmount()); budgetDetail.setUsingDepartment(contract.getUsingDepartment()); budgetDetail.setExecutingDepartment(contract.getUsingDepartment()); budgetDetail.setFunction(contract.getFunction()); budgetDetail.setScheme(contract.getScheme()); budgetDetail.setFund(contract.getFund()); budgetDetail.setSubScheme(contract.getSubScheme()); budgetDetail.setFunctionary(contract.getFunctionary()); budgetDetail.setBoundary(contract.getBoundary()); budgetDetail.setMaterializedPath(contract.getMaterializedPath()); budgetDetail.setDocumentNumber(contract.getDocumentNumber()); budgetDetail.setUniqueNo(contract.getUniqueNo()); budgetDetail.setPlanningPercent(contract.getPlanningPercent()); budgetDetail.setStatus(FinancialStatusContract.builder() .id(contract.getStatus() != null ? contract.getStatus().getId() : null).build()); budgetDetail.setCreatedBy(contract.getCreatedBy()); budgetDetail.setCreatedDate(contract.getCreatedDate()); budgetDetail.setLastModifiedBy(contract.getLastModifiedBy()); budgetDetail.setLastModifiedDate(contract.getLastModifiedDate()); budgetDetail.setTenantId(contract.getTenantId()); return budgetDetail; } }
BudgetDetailMapper { public BudgetDetail toDomain(final BudgetDetailContract contract) { final BudgetDetail budgetDetail = new BudgetDetail(); budgetDetail.setId(contract.getId()); budgetDetail.setBudgetGroup(contract.getBudgetGroup()); final Budget budget = Budget.builder().id(contract.getBudget() != null ? contract.getBudget().getId() : null).build(); budget.setTenantId(contract.getBudget() != null ? contract.getBudget().getTenantId() : null); budgetDetail.setBudget(budget); budgetDetail.setOriginalAmount(contract.getOriginalAmount()); budgetDetail.setApprovedAmount(contract.getApprovedAmount()); budgetDetail.setBudgetAvailable(contract.getBudgetAvailable()); budgetDetail.setAnticipatoryAmount(contract.getAnticipatoryAmount()); budgetDetail.setUsingDepartment(contract.getUsingDepartment()); budgetDetail.setExecutingDepartment(contract.getUsingDepartment()); budgetDetail.setFunction(contract.getFunction()); budgetDetail.setScheme(contract.getScheme()); budgetDetail.setFund(contract.getFund()); budgetDetail.setSubScheme(contract.getSubScheme()); budgetDetail.setFunctionary(contract.getFunctionary()); budgetDetail.setBoundary(contract.getBoundary()); budgetDetail.setMaterializedPath(contract.getMaterializedPath()); budgetDetail.setDocumentNumber(contract.getDocumentNumber()); budgetDetail.setUniqueNo(contract.getUniqueNo()); budgetDetail.setPlanningPercent(contract.getPlanningPercent()); budgetDetail.setStatus(FinancialStatusContract.builder() .id(contract.getStatus() != null ? contract.getStatus().getId() : null).build()); budgetDetail.setCreatedBy(contract.getCreatedBy()); budgetDetail.setCreatedDate(contract.getCreatedDate()); budgetDetail.setLastModifiedBy(contract.getLastModifiedBy()); budgetDetail.setLastModifiedDate(contract.getLastModifiedDate()); budgetDetail.setTenantId(contract.getTenantId()); return budgetDetail; }  }
BudgetDetailMapper { public BudgetDetail toDomain(final BudgetDetailContract contract) { final BudgetDetail budgetDetail = new BudgetDetail(); budgetDetail.setId(contract.getId()); budgetDetail.setBudgetGroup(contract.getBudgetGroup()); final Budget budget = Budget.builder().id(contract.getBudget() != null ? contract.getBudget().getId() : null).build(); budget.setTenantId(contract.getBudget() != null ? contract.getBudget().getTenantId() : null); budgetDetail.setBudget(budget); budgetDetail.setOriginalAmount(contract.getOriginalAmount()); budgetDetail.setApprovedAmount(contract.getApprovedAmount()); budgetDetail.setBudgetAvailable(contract.getBudgetAvailable()); budgetDetail.setAnticipatoryAmount(contract.getAnticipatoryAmount()); budgetDetail.setUsingDepartment(contract.getUsingDepartment()); budgetDetail.setExecutingDepartment(contract.getUsingDepartment()); budgetDetail.setFunction(contract.getFunction()); budgetDetail.setScheme(contract.getScheme()); budgetDetail.setFund(contract.getFund()); budgetDetail.setSubScheme(contract.getSubScheme()); budgetDetail.setFunctionary(contract.getFunctionary()); budgetDetail.setBoundary(contract.getBoundary()); budgetDetail.setMaterializedPath(contract.getMaterializedPath()); budgetDetail.setDocumentNumber(contract.getDocumentNumber()); budgetDetail.setUniqueNo(contract.getUniqueNo()); budgetDetail.setPlanningPercent(contract.getPlanningPercent()); budgetDetail.setStatus(FinancialStatusContract.builder() .id(contract.getStatus() != null ? contract.getStatus().getId() : null).build()); budgetDetail.setCreatedBy(contract.getCreatedBy()); budgetDetail.setCreatedDate(contract.getCreatedDate()); budgetDetail.setLastModifiedBy(contract.getLastModifiedBy()); budgetDetail.setLastModifiedDate(contract.getLastModifiedDate()); budgetDetail.setTenantId(contract.getTenantId()); return budgetDetail; }  BudgetDetail toDomain(final BudgetDetailContract contract); BudgetDetailContract toContract(final BudgetDetail budgetDetail); BudgetDetailSearch toSearchDomain(final BudgetDetailSearchContract contract); BudgetDetailSearchContract toSearchContract(final BudgetDetailSearch budgetDetailSearch); }
BudgetDetailMapper { public BudgetDetail toDomain(final BudgetDetailContract contract) { final BudgetDetail budgetDetail = new BudgetDetail(); budgetDetail.setId(contract.getId()); budgetDetail.setBudgetGroup(contract.getBudgetGroup()); final Budget budget = Budget.builder().id(contract.getBudget() != null ? contract.getBudget().getId() : null).build(); budget.setTenantId(contract.getBudget() != null ? contract.getBudget().getTenantId() : null); budgetDetail.setBudget(budget); budgetDetail.setOriginalAmount(contract.getOriginalAmount()); budgetDetail.setApprovedAmount(contract.getApprovedAmount()); budgetDetail.setBudgetAvailable(contract.getBudgetAvailable()); budgetDetail.setAnticipatoryAmount(contract.getAnticipatoryAmount()); budgetDetail.setUsingDepartment(contract.getUsingDepartment()); budgetDetail.setExecutingDepartment(contract.getUsingDepartment()); budgetDetail.setFunction(contract.getFunction()); budgetDetail.setScheme(contract.getScheme()); budgetDetail.setFund(contract.getFund()); budgetDetail.setSubScheme(contract.getSubScheme()); budgetDetail.setFunctionary(contract.getFunctionary()); budgetDetail.setBoundary(contract.getBoundary()); budgetDetail.setMaterializedPath(contract.getMaterializedPath()); budgetDetail.setDocumentNumber(contract.getDocumentNumber()); budgetDetail.setUniqueNo(contract.getUniqueNo()); budgetDetail.setPlanningPercent(contract.getPlanningPercent()); budgetDetail.setStatus(FinancialStatusContract.builder() .id(contract.getStatus() != null ? contract.getStatus().getId() : null).build()); budgetDetail.setCreatedBy(contract.getCreatedBy()); budgetDetail.setCreatedDate(contract.getCreatedDate()); budgetDetail.setLastModifiedBy(contract.getLastModifiedBy()); budgetDetail.setLastModifiedDate(contract.getLastModifiedDate()); budgetDetail.setTenantId(contract.getTenantId()); return budgetDetail; }  BudgetDetail toDomain(final BudgetDetailContract contract); BudgetDetailContract toContract(final BudgetDetail budgetDetail); BudgetDetailSearch toSearchDomain(final BudgetDetailSearchContract contract); BudgetDetailSearchContract toSearchContract(final BudgetDetailSearch budgetDetailSearch);  }