| Line 556... |
Line 556... |
| 556 |
return "response";
|
556 |
return "response";
|
| 557 |
}
|
557 |
}
|
| 558 |
|
558 |
|
| 559 |
@RequestMapping(value = "/getPlanQuote", method = RequestMethod.GET)
|
559 |
@RequestMapping(value = "/getPlanQuote", method = RequestMethod.GET)
|
| 560 |
public String getPlanQuote(HttpServletRequest request, Model model,
|
560 |
public String getPlanQuote(HttpServletRequest request, Model model,
|
| 561 |
@RequestParam String planCode, @RequestParam int sumInsured, @RequestParam String manufacturedDate, @RequestParam int itemId) throws ProfitMandiBusinessException {
|
561 |
@RequestParam String planCode, @RequestParam int sumInsured, @RequestParam String manufacturedDate, @RequestParam int itemId, @RequestParam String planName) throws ProfitMandiBusinessException {
|
| 562 |
|
562 |
|
| 563 |
try {
|
563 |
try {
|
| 564 |
|
564 |
|
| 565 |
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
|
565 |
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
|
| 566 |
LocalDate manufactured = LocalDate.parse(manufacturedDate, formatter);
|
566 |
LocalDate manufactured = LocalDate.parse(manufacturedDate, formatter);
|
| Line 579... |
Line 579... |
| 579 |
LocalDate oneYearLater = today.plusYears(1);
|
579 |
LocalDate oneYearLater = today.plusYears(1);
|
| 580 |
|
580 |
|
| 581 |
String itemBrand = itemRepository.selectById(itemId).getBrand();
|
581 |
String itemBrand = itemRepository.selectById(itemId).getBrand();
|
| 582 |
|
582 |
|
| 583 |
AfinityQuoteModel quoteModel = new AfinityQuoteModel();
|
583 |
AfinityQuoteModel quoteModel = new AfinityQuoteModel();
|
| 584 |
quoteModel.setPolicyStartDate(today.toString()); // format: yyyy-MM-dd
|
- |
|
| 585 |
quoteModel.setPolicyEndDate(oneYearLater.toString());
|
584 |
quoteModel.setProductCode(iciciLombardService.PRODUCT_CODE_STAGGING);
|
| 586 |
quoteModel.setPlanCode(String.valueOf(planVariant.getOurPlanId()));
|
585 |
quoteModel.setPlanCode(String.valueOf(planVariant.getOurPlanId()));
|
| - |
|
586 |
quoteModel.setPlanName(planName);
|
| 587 |
// quoteModel.setPlanCode(String.valueOf(10357));
|
587 |
/*quoteModel.setPlanCode(String.valueOf(11730));
|
| - |
|
588 |
quoteModel.setPlanName("SHUBHI");*/
|
| 588 |
quoteModel.setSumInsured((int) sumInsured);
|
589 |
quoteModel.setSumInsured((int) sumInsured);
|
| - |
|
590 |
quoteModel.setPolicyStartDate(today.toString()); // format: yyyy-MM-dd
|
| 589 |
quoteModel.setBasisOfValuation("Market_Value");
|
591 |
quoteModel.setPolicyEndDate(oneYearLater.toString());
|
| - |
|
592 |
quoteModel.setTaxEffectiveDate(today.toString());
|
| - |
|
593 |
quoteModel.setPolicyType("New");
|
| - |
|
594 |
quoteModel.setIlgicStateName(iciciLombardService.PARTY_STATE_NAME);
|
| 590 |
quoteModel.setPartyStateName(iciciLombardService.PARTY_STATE_NAME);
|
595 |
quoteModel.setPartyStateName(iciciLombardService.PARTY_STATE_NAME);
|
| 591 |
quoteModel.setRiskSIComponent("MOBILE");
|
596 |
quoteModel.setUserLevel("UW3");
|
| - |
|
597 |
quoteModel.setNoOfClaimsAllowed(999);
|
| - |
|
598 |
quoteModel.setMakeAndModelOfGadget("High");
|
| - |
|
599 |
quoteModel.setPremiumBeforeEndorsementCancellation(0);
|
| - |
|
600 |
quoteModel.setGeographicalLimit("WithinIndia");
|
| 592 |
quoteModel.setMakeManufacturer(itemBrand.toUpperCase());
|
601 |
quoteModel.setTransactionDate(today.toString());
|
| 593 |
quoteModel.setYearOfManufacture(manufactured.getYear());
|
602 |
quoteModel.setEndorsementEffectiveDate(today.toString());
|
| 594 |
quoteModel.setCoverName("All Risk");
|
603 |
quoteModel.setRegisteredCustomer(true);
|
| 595 |
quoteModel.setCorrelationId(correlationId);
|
604 |
quoteModel.setCorrelationId(correlationId);
|
| 596 |
|
605 |
|
| - |
|
606 |
// Set cover details
|
| - |
|
607 |
AfinityQuoteModel.CoverDetail coverDetail = new AfinityQuoteModel.CoverDetail();
|
| - |
|
608 |
coverDetail.setName("Accidental Damage");
|
| - |
|
609 |
coverDetail.setPremium(0);
|
| - |
|
610 |
|
| - |
|
611 |
// Set risk details
|
| - |
|
612 |
AfinityQuoteModel.RiskDetail riskDetail = new AfinityQuoteModel.RiskDetail();
|
| - |
|
613 |
riskDetail.setRiskSIComponent("MOBILE");
|
| - |
|
614 |
riskDetail.setCoverDetails(Arrays.asList(coverDetail));
|
| - |
|
615 |
|
| - |
|
616 |
quoteModel.setRisksDetails(Arrays.asList(riskDetail));
|
| - |
|
617 |
|
| 597 |
AfinityQuoteResponseModel afinityQuoteResponseModel = iciciLombardService.hitAfinityQuote(quoteModel);
|
618 |
AfinityQuoteResponseModel afinityQuoteResponseModel = iciciLombardService.hitAfinityQuote(quoteModel);
|
| 598 |
float planDp = insuranceService.getPlanDp(afinityQuoteResponseModel.getTotalPremium(), planVariant.getCoverage());
|
619 |
float planDp = insuranceService.getPlanDp(afinityQuoteResponseModel.getTotalPremium(), planVariant.getCoverage());
|
| 599 |
|
620 |
|
| 600 |
Map<String, Object> responseMap = new HashMap<>();
|
621 |
Map<String, Object> responseMap = new HashMap<>();
|
| 601 |
responseMap.put("afinityQuoteModel", afinityQuoteResponseModel);
|
622 |
responseMap.put("afinityQuoteModel", afinityQuoteResponseModel);
|