@Test public void test_create_bill() throws ParseException { RequestInfo requestInfo = new RequestInfo(); UserInfo userInfo = new UserInfo(); userInfo.setId(1); requestInfo.setUserInfo(userInfo); TradeLicense license = new TradeLicense(); license.setTenantId("mh.roha"); license.setTradeType(BusinessNature.PERMANENT); LicenseApplication application = new LicenseApplication(); application.setApplicationNumber("1234"); application.setLicenseFee(100D); LicenseFeeDetail feeDetail = new LicenseFeeDetail(); feeDetail.setAmount(100D); application.setFeeDetails(Collections.singletonList(feeDetail)); license.setApplication(application); license.setValidityYears(1L); Map<String, Object> licenseFeeMap = new HashMap<String, Object>(); licenseFeeMap.put("minimumAmountPayable", BigDecimal.valueOf(license.getApplication().getLicenseFee())); licenseFeeMap.put("taxHeadMasterCode", propertiesManager.getTaxHeadMasterCode()); licenseFeeMap.put("taxAmount", new BigDecimal(propertiesManager.getApplicationFeeAmount())); DemandResponse demandResponse = licenseBillService.createBill(license, requestInfo, licenseFeeMap); assertEquals("1", demandResponse.getDemands().get(0).getId()); }
public DemandResponse createBill(final TradeLicense tradeLicense, final RequestInfo requestInfo, Map<String, Object> demandMap) throws ParseException { List<Demand> demands = prepareBill(tradeLicense, null, requestInfo, demandMap); DemandResponse demandRes = createBill(demands, requestInfo); if (demandRes != null && demandRes.getDemands() != null && !demandRes.getDemands().isEmpty()) tradeLicense.setBillId(demandRes.getDemands().get(0).getId()); return demandRes; }
LicenseBillService { public DemandResponse createBill(final TradeLicense tradeLicense, final RequestInfo requestInfo, Map<String, Object> demandMap) throws ParseException { List<Demand> demands = prepareBill(tradeLicense, null, requestInfo, demandMap); DemandResponse demandRes = createBill(demands, requestInfo); if (demandRes != null && demandRes.getDemands() != null && !demandRes.getDemands().isEmpty()) tradeLicense.setBillId(demandRes.getDemands().get(0).getId()); return demandRes; } }
LicenseBillService { public DemandResponse createBill(final TradeLicense tradeLicense, final RequestInfo requestInfo, Map<String, Object> demandMap) throws ParseException { List<Demand> demands = prepareBill(tradeLicense, null, requestInfo, demandMap); DemandResponse demandRes = createBill(demands, requestInfo); if (demandRes != null && demandRes.getDemands() != null && !demandRes.getDemands().isEmpty()) tradeLicense.setBillId(demandRes.getDemands().get(0).getId()); return demandRes; }  }
LicenseBillService { public DemandResponse createBill(final TradeLicense tradeLicense, final RequestInfo requestInfo, Map<String, Object> demandMap) throws ParseException { List<Demand> demands = prepareBill(tradeLicense, null, requestInfo, demandMap); DemandResponse demandRes = createBill(demands, requestInfo); if (demandRes != null && demandRes.getDemands() != null && !demandRes.getDemands().isEmpty()) tradeLicense.setBillId(demandRes.getDemands().get(0).getId()); return demandRes; }  DemandResponse createBill(final TradeLicense tradeLicense, final RequestInfo requestInfo, Map<String, Object> demandMap); DemandResponse updateBill(final TradeLicense tradeLicense, final Long billId, final RequestInfo requestInfo, Map<String, Object> demandMap); }
LicenseBillService { public DemandResponse createBill(final TradeLicense tradeLicense, final RequestInfo requestInfo, Map<String, Object> demandMap) throws ParseException { List<Demand> demands = prepareBill(tradeLicense, null, requestInfo, demandMap); DemandResponse demandRes = createBill(demands, requestInfo); if (demandRes != null && demandRes.getDemands() != null && !demandRes.getDemands().isEmpty()) tradeLicense.setBillId(demandRes.getDemands().get(0).getId()); return demandRes; }  DemandResponse createBill(final TradeLicense tradeLicense, final RequestInfo requestInfo, Map<String, Object> demandMap); DemandResponse updateBill(final TradeLicense tradeLicense, final Long billId, final RequestInfo requestInfo, Map<String, Object> demandMap);  }