Subversion Repositories SmartDukaan

Rev

Rev 23015 | Rev 23568 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
22866 ashik.ali 1
package com.spice.profitmandi.web.controller;
2
 
22889 amit.gupta 3
import java.io.ByteArrayOutputStream;
4
import java.io.File;
5
import java.io.FileOutputStream;
6
import java.io.IOException;
7
import java.io.OutputStream;
8
import java.text.MessageFormat;
9
import java.time.LocalDate;
22907 amit.gupta 10
import java.time.LocalDateTime;
22889 amit.gupta 11
import java.time.format.DateTimeFormatter;
22932 amit.gupta 12
import java.util.ArrayList;
22889 amit.gupta 13
import java.util.Arrays;
14
import java.util.HashSet;
15
import java.util.List;
16
import java.util.Map;
17
import java.util.Set;
18
 
19
import javax.mail.internet.InternetAddress;
20
import javax.mail.internet.MimeMessage;
22866 ashik.ali 21
import javax.servlet.http.HttpServletRequest;
22
 
22889 amit.gupta 23
import org.apache.commons.io.FileUtils;
22993 amit.gupta 24
import org.json.JSONObject;
22866 ashik.ali 25
import org.slf4j.Logger;
26
import org.slf4j.LoggerFactory;
27
import org.springframework.beans.factory.annotation.Autowired;
23015 amit.gupta 28
import org.springframework.beans.factory.annotation.Value;
22866 ashik.ali 29
import org.springframework.http.ResponseEntity;
22889 amit.gupta 30
import org.springframework.mail.javamail.JavaMailSender;
31
import org.springframework.mail.javamail.MimeMessageHelper;
22866 ashik.ali 32
import org.springframework.stereotype.Controller;
33
import org.springframework.transaction.annotation.Transactional;
22889 amit.gupta 34
import org.springframework.web.bind.annotation.RequestBody;
22866 ashik.ali 35
import org.springframework.web.bind.annotation.RequestMapping;
36
import org.springframework.web.bind.annotation.RequestMethod;
37
 
22889 amit.gupta 38
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
39
import com.spice.profitmandi.common.model.CustomAddress;
40
import com.spice.profitmandi.common.model.CustomCustomer;
41
import com.spice.profitmandi.common.model.CustomInsurancePolicy;
42
import com.spice.profitmandi.common.model.CustomOrderItem;
43
import com.spice.profitmandi.common.model.CustomRetailer;
44
import com.spice.profitmandi.common.model.GadgetCopsDocumentInsuranceModel;
22932 amit.gupta 45
import com.spice.profitmandi.common.model.GadgetCopsInsuranceCalcResponse;
22889 amit.gupta 46
import com.spice.profitmandi.common.model.PdfModel;
22866 ashik.ali 47
import com.spice.profitmandi.common.model.ProfitMandiConstants;
22889 amit.gupta 48
import com.spice.profitmandi.common.util.InsuranceUtils;
49
import com.spice.profitmandi.common.util.PdfUtils;
50
import com.spice.profitmandi.common.util.StringUtils;
51
import com.spice.profitmandi.common.util.Utils;
22866 ashik.ali 52
import com.spice.profitmandi.common.web.util.ResponseSender;
22889 amit.gupta 53
import com.spice.profitmandi.dao.entity.dtr.Document;
54
import com.spice.profitmandi.dao.entity.dtr.GadgetCopsInsuranceCalc;
55
import com.spice.profitmandi.dao.entity.dtr.InsurancePolicy;
56
import com.spice.profitmandi.dao.entity.dtr.InsuranceProvider;
57
import com.spice.profitmandi.dao.entity.dtr.PolicyNumberGenerationSequence;
58
import com.spice.profitmandi.dao.entity.dtr.ThirdPartyInvoiceSequence;
59
import com.spice.profitmandi.dao.enumuration.dtr.ThirdParty;
60
import com.spice.profitmandi.dao.model.UserCart;
61
import com.spice.profitmandi.dao.repository.dtr.DocumentRepository;
22866 ashik.ali 62
import com.spice.profitmandi.dao.repository.dtr.GadgetCopsInsuranceCalcRepository;
22889 amit.gupta 63
import com.spice.profitmandi.dao.repository.dtr.InsurancePolicyRepository;
64
import com.spice.profitmandi.dao.repository.dtr.InsuranceProviderRepository;
65
import com.spice.profitmandi.dao.repository.dtr.PolicyNumberGenerationSequenceRepository;
66
import com.spice.profitmandi.dao.repository.dtr.ThirdPartyInvoiceSequenceRepository;
67
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
68
import com.spice.profitmandi.dao.repository.fofo.InvoiceNumberGenerationSequenceRepository;
22898 amit.gupta 69
import com.spice.profitmandi.dao.repository.transaction.UserWalletRepository;
22889 amit.gupta 70
import com.spice.profitmandi.service.pricing.PricingService;
71
import com.spice.profitmandi.service.wallet.WalletService;
22866 ashik.ali 72
 
22889 amit.gupta 73
import in.shop2020.model.v1.order.WalletReferenceType;
74
 
22866 ashik.ali 75
@Controller
22889 amit.gupta 76
@Transactional(rollbackFor = Throwable.class)
22866 ashik.ali 77
public class InsuranceController {
22889 amit.gupta 78
	private static final Logger LOGGER = LoggerFactory.getLogger(InsuranceController.class);
79
	private static final String gadgetCopsFilePath = "/GadgetCops";
22866 ashik.ali 80
 
81
	@Autowired
22889 amit.gupta 82
	private GadgetCopsInsuranceCalcRepository gadgetCopsInsuranceCalcRepository;
23015 amit.gupta 83
 
84
	//This is now unused as we are not supporting multiple companies.
85
	@Value("${fofo.warehouseIds}")
86
	private int[] warehouseIds; 
22889 amit.gupta 87
 
88
	@RequestMapping(value = ProfitMandiConstants.URL_INSURANCE_GADGET_COPS_MAPPING, method = RequestMethod.GET)
89
	public ResponseEntity<?> getById(HttpServletRequest request) {
90
		LOGGER.info("requested url : " + request.getRequestURL().toString());
22932 amit.gupta 91
		List<GadgetCopsInsuranceCalc> calcList = gadgetCopsInsuranceCalcRepository.selectAll();
92
 
93
		return responseSender.ok(this.toCalcResponseList(calcList));
22889 amit.gupta 94
	}
95
 
96
	@Autowired
22866 ashik.ali 97
	ResponseSender<?> responseSender;
22889 amit.gupta 98
 
99
	@Autowired
100
	ThirdPartyInvoiceSequenceRepository thirdPartyInvoiceSequenceRepository;
101
 
102
	@Autowired
103
	DocumentRepository documentRepository;
104
 
105
	@Autowired
106
	InvoiceNumberGenerationSequenceRepository invoiceNumberGenerationSequenceRepository;
22866 ashik.ali 107
 
22889 amit.gupta 108
	@Autowired
109
	InsurancePolicyRepository insurancePolicyRepository;
110
 
111
	@Autowired
112
	PricingService pricingService;
22866 ashik.ali 113
 
114
	@Autowired
22889 amit.gupta 115
	JavaMailSender mailSender;
116
 
117
	@Autowired
118
	InsuranceProviderRepository insuranceProviderRepository;
119
 
120
	@Autowired
121
	UserAccountRepository userAccountRepository;
22866 ashik.ali 122
 
22889 amit.gupta 123
	@Autowired
124
	WalletService walletService;
125
 
126
	@Autowired
22898 amit.gupta 127
	UserWalletRepository userWalletRepositoy;
128
 
129
	@Autowired
22889 amit.gupta 130
	PolicyNumberGenerationSequenceRepository policyNumberGenerationSequenceRepository;
131
 
132
	@RequestMapping(value = ProfitMandiConstants.URL_DAMAGE_INSURANCE, method = RequestMethod.POST)
23015 amit.gupta 133
	public ResponseEntity<?> createDamageProtection(HttpServletRequest request,
22889 amit.gupta 134
			@RequestBody GadgetCopsDocumentInsuranceModel insuranceModel) throws Throwable {
22894 amit.gupta 135
		insuranceModel.setCustomerDateOfBirth(StringUtils.fromHypendatedDate(insuranceModel.getCustomerDateOfBirthString()));
22896 amit.gupta 136
		insuranceModel.setInvoiceCreationDate(LocalDate.now());
22893 amit.gupta 137
		insuranceModel.validate();
138
		int userId = (int) request.getAttribute("userId");
139
		UserCart uc = userAccountRepository.getUserCart(userId);
140
		PolicyNumberGenerationSequence policyNumberGenerationSequence = null;
141
		try {
142
			policyNumberGenerationSequence = policyNumberGenerationSequenceRepository.select();
143
			policyNumberGenerationSequence.setSequence(policyNumberGenerationSequence.getSequence() + 1);
144
			policyNumberGenerationSequenceRepository.persist(policyNumberGenerationSequence);
145
		} catch (ProfitMandiBusinessException profitMandiBusinessException) {
146
			policyNumberGenerationSequence = new PolicyNumberGenerationSequence();
147
			policyNumberGenerationSequence.setSequence(1);
148
			policyNumberGenerationSequenceRepository.persist(policyNumberGenerationSequence);
149
		}
150
		String policyNumber = StringUtils.generatePolicyNumber(ProfitMandiConstants.POLICY_NUMBER_PREFIX,
151
				policyNumberGenerationSequence.getSequence());
22889 amit.gupta 152
 
22893 amit.gupta 153
		InsuranceProvider insuranceProvider = insuranceProviderRepository
154
				.selectByName(ProfitMandiConstants.GADGET_COPS);
155
		Set<Float> devicePriceSet = new HashSet<>();
156
		devicePriceSet.add(insuranceModel.getPrice());
157
		Map<Float, GadgetCopsInsuranceCalc> insurancePricesMap = pricingService.getInsurancePrices(devicePriceSet,
158
				ProfitMandiConstants.GADGET_COPS);
159
		InsurancePolicy insurancePolicy = new InsurancePolicy();
160
		insurancePolicy.setInvoiceNumber(insuranceModel.getInvoiceNumber());
161
		insurancePolicy.setRetailerId(uc.getUserId());
162
		insurancePolicy.setPurchaseAmount(insurancePricesMap.get(insuranceModel.getPrice()).getDealerPrice());
163
		insurancePolicy.setSaleAmount(insurancePricesMap.get(insuranceModel.getPrice()).getSellingPrice());
164
		insurancePolicy.setSellingPrice(insuranceModel.getPrice());
165
		insurancePolicy.setSerialNumber(insuranceModel.getSerialNumber());
166
		insurancePolicy.setModelName(insuranceModel.getModelName());
167
		insurancePolicy.setBrand(insuranceModel.getBrand());
168
		insurancePolicy.setPolicyNumber(policyNumber);
169
		insurancePolicy.setProviderId(insuranceProvider.getId());
170
		insurancePolicy.setCustomerFirstName(insuranceModel.getCustomerFirstName());
171
		insurancePolicy.setCustomerLastName(insuranceModel.getCustomerFirstName());
172
		insurancePolicy.setCustomerMobileNumber(insuranceModel.getCustomerMobileNumber());
173
		insurancePolicy.setCustomerEmailId(insuranceModel.getCustomerEmailId());
174
		insurancePolicy.setCustomerDateOfBirth(insuranceModel.getCustomerDateOfBirth());
175
		insurancePolicy.setCustomerAddress1(insuranceModel.getCustomerAddress1());
176
		insurancePolicy.setCustomerAddress2(insuranceModel.getCustomerAddress2());
177
		insurancePolicy.setCustomerCity(insuranceModel.getCustomerCity());
178
		insurancePolicy.setCustomerPinCode(insuranceModel.getCustomerPinCode());
179
		insurancePolicy.setCustomerState(insuranceModel.getCustomerState());
180
		insurancePolicyRepository.persist(insurancePolicy);
22915 amit.gupta 181
		insuranceModel.setPolicyNumber(insurancePolicy.getPolicyNumber());
22913 amit.gupta 182
		String walletDescription = "Purchased Damage Protection policy " + insurancePolicy.getPolicyNumber() 
183
			+ " for " + insurancePolicy.getCustomerFirstName();
22893 amit.gupta 184
 
22999 amit.gupta 185
		walletService.consumeAmountFromWallet(uc.getUserId(), insurancePolicy.getId(), 
186
				WalletReferenceType.DAMAGE_PROTECTION, walletDescription, insurancePolicy.getSaleAmount());
22898 amit.gupta 187
 
22893 amit.gupta 188
		try{
189
			InsuranceUtils.submitToGadgetCops(insuranceModel);
190
			insurancePolicy.setPosted(true);
191
		}catch (ProfitMandiBusinessException profitMandiBusinessException) {
192
			LOGGER.info("Unable to submit insurance policy details to {}", insuranceProvider.getName(), profitMandiBusinessException);
22994 amit.gupta 193
			throw new ProfitMandiBusinessException("", "", "GDTCPSServerDown_1000");
22893 amit.gupta 194
		}
195
		insurancePolicyRepository.persist(insurancePolicy);			
22889 amit.gupta 196
 
22893 amit.gupta 197
		PdfModel pdfModel = this.getInvoicePdfModel(insurancePolicy);
198
		ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
199
		PdfUtils.generateAndWrite(pdfModel, byteArrayOutputStream);
22889 amit.gupta 200
 
22893 amit.gupta 201
		Document deviceDocument = documentRepository.selectById(insuranceModel.getDeviceImageDocumentId());
202
		File deviceImg = new File(deviceDocument.getPath() + deviceDocument.getName());
203
		Document invoiceDocument = documentRepository.selectById(insuranceModel.getDeviceImageDocumentId());
204
		File deviceInvoiceImg = new File(invoiceDocument.getPath() + invoiceDocument.getName());
22889 amit.gupta 205
 
23015 amit.gupta 206
		List<File> attachments = this.savePolicyDocs(insurancePolicy.getPolicyNumber(), byteArrayOutputStream, deviceImg, deviceInvoiceImg);
22893 amit.gupta 207
		String messageText = MessageFormat.format(
208
				"Dear {0}, Thank you for purchasing Damage Protection Plan. Your Policy number is {1}",
209
				insurancePolicy.getCustomerFirstName(), insurancePolicy.getPolicyNumber());
210
		Utils.sendSms(messageText, insurancePolicy.getCustomerMobileNumber());
23015 amit.gupta 211
		messageText += "\n Please find your Invoice and Documents submitted by you.";
22913 amit.gupta 212
		String subject = "Your Gadget Cop damage Protection purchase is successful";
22893 amit.gupta 213
		this.sendMailWithAttachments(insuranceModel.getCustomerEmailId() , subject, messageText, attachments);
22913 amit.gupta 214
 
22917 amit.gupta 215
		float taxableInsuranceMargin = (insurancePolicy.getSaleAmount() - insurancePolicy.getPurchaseAmount()) / (1 + ProfitMandiConstants.INSURANCE_TAX_RATE / 100);
22913 amit.gupta 216
		walletService.addAmountToWallet(uc.getUserId(), insurancePolicy.getId(), WalletReferenceType.CASHBACK, "Cashback against insurance policy", 
217
				taxableInsuranceMargin);
22889 amit.gupta 218
		LOGGER.info("requested url : " + request.getRequestURL().toString());
22993 amit.gupta 219
		JSONObject jsonObject = new JSONObject();
23000 amit.gupta 220
		jsonObject.put("policyNumber", insurancePolicy.getPolicyNumber());
221
		jsonObject.put("premiumCharged", insurancePolicy.getSaleAmount());
22997 amit.gupta 222
		return responseSender.ok(jsonObject.toString());
22866 ashik.ali 223
	}
224
 
22889 amit.gupta 225
	private void sendMailWithAttachments(String email, String subject, String body, List<File> attachments) throws Exception {
226
 
227
    	MimeMessage message = mailSender.createMimeMessage();
22910 amit.gupta 228
    	MimeMessageHelper helper = new MimeMessageHelper(message,true);
22913 amit.gupta 229
    	helper.setSubject(subject);
22889 amit.gupta 230
    	helper.setText(body);
23016 amit.gupta 231
    	String[] cc = {"backup@shop2020.in", "gadgetcops.01@gmail.com"};
22889 amit.gupta 232
    	//String[] cc = {"amit.gupta@shop2020.in"};
22916 amit.gupta 233
    	helper.setCc(cc);
22918 amit.gupta 234
    	helper.setTo(email);
22889 amit.gupta 235
    	InternetAddress senderAddress = new InternetAddress("noreply@profitmandi.com", "ProfitMandi Admin");
236
    	helper.setTo("help@profitmandi.com");
237
    	helper.setFrom(senderAddress);
238
    	for (File file : attachments) {
239
    		helper.addAttachment(file.getName(), file);
240
    	}
241
    	mailSender.send(message);
242
 
243
	}
244
 
245
	private List<File> savePolicyDocs(String policyNumber, ByteArrayOutputStream pdfInvoiceStream, File deviceImg,
246
			File deviceInvoiceImg) throws Exception {
247
		// save file to gadgetCops/policyname
248
		String policyFolderPath = gadgetCopsFilePath + File.separator + policyNumber;
249
		File destDeviceInvoiceImg = new File(policyFolderPath + File.separator + "deviceInvoice.jpg");
250
		File destDeviceImg = new File(policyFolderPath + File.separator + "device.jpg");
251
		FileUtils.copyFile(deviceImg, destDeviceImg);
252
		FileUtils.copyFile(deviceInvoiceImg, destDeviceInvoiceImg);
253
 
254
		OutputStream outStream = null;
255
		try {
256
			outStream = new FileOutputStream(policyFolderPath + File.separator + "invoice.pdf");
257
			pdfInvoiceStream.writeTo(outStream);
22911 amit.gupta 258
			pdfInvoiceStream.flush();
22889 amit.gupta 259
		} catch (IOException e) {
260
			e.printStackTrace();
261
		} finally {
262
			outStream.close();
263
			pdfInvoiceStream.close();
264
		}
265
 
266
		File pdfInvoice = new File(policyFolderPath + File.separator + "invoice.pdf");
267
		return Arrays.asList(pdfInvoice, destDeviceImg, destDeviceInvoiceImg);
268
	}
269
 
22907 amit.gupta 270
	public String getFormattedDate(LocalDateTime localDate) {
22889 amit.gupta 271
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-YYYY HH:mm");
272
		return localDate.format(formatter);
273
	}
274
 
275
	private PdfModel getInvoicePdfModel(InsurancePolicy insurancePolicy) throws ProfitMandiBusinessException {
276
 
277
		PdfModel pdfModel = new PdfModel();
278
		pdfModel.setAuther("profitmandi");
279
		pdfModel.setTitle("Retailer Invoice");
22907 amit.gupta 280
		pdfModel.setInvoiceDate(getFormattedDate(insurancePolicy.getCreateTimestamp()));
22889 amit.gupta 281
 
282
		// insurance calculation
283
		Set<CustomInsurancePolicy> customInsurancePolicies = new HashSet<>();
284
		final float totalInsuranceTaxRate = 18;
285
 
286
		float taxableInsurancePrice = insurancePolicy.getSaleAmount() / (1 + totalInsuranceTaxRate / 100);
287
		CustomInsurancePolicy customInsurancePolicy = new CustomInsurancePolicy();
288
		customInsurancePolicy.setDescription("Damage Protection Plan for device IMEI #"
289
				+ insurancePolicy.getSerialNumber() + "\n Certificate No. " + insurancePolicy.getPolicyNumber());
290
		customInsurancePolicy.setHsnCode("998716");
291
		customInsurancePolicy.setRate(taxableInsurancePrice);
292
		customInsurancePolicy.setIgstRate(18);
293
		customInsurancePolicy.setIgstAmount(taxableInsurancePrice * 18 / 100);
294
		customInsurancePolicy.setCgstRate(9);
295
		customInsurancePolicy.setCgstAmount(taxableInsurancePrice * 9 / 100);
296
		customInsurancePolicy.setSgstRate(9);
297
		customInsurancePolicy.setSgstAmount(taxableInsurancePrice * 9 / 100);
298
		customInsurancePolicy.setNetAmount(insurancePolicy.getSaleAmount());
299
		customInsurancePolicies.add(customInsurancePolicy);
300
 
301
		pdfModel.setInsurancePolicies(customInsurancePolicies);
302
		CustomCustomer customCustomer = new CustomCustomer();
303
		customCustomer.setFirstName(insurancePolicy.getCustomerFirstName());
304
		customCustomer.setLastName(insurancePolicy.getCustomerLastName());
305
		customCustomer.setEmailId(insurancePolicy.getCustomerEmailId());
306
		customCustomer.setMobileNumber(insurancePolicy.getCustomerMobileNumber());
307
 
308
		CustomAddress customAddress = new CustomAddress();
309
		customAddress.setName(insurancePolicy.getCustomerFirstName() + " " + insurancePolicy.getCustomerLastName());
310
		customAddress.setLine1(insurancePolicy.getCustomerAddress1());
311
		customAddress.setLine2(insurancePolicy.getCustomerAddress2());
312
		customAddress.setLandmark("");
313
		customAddress.setCity(insurancePolicy.getCustomerCity());
314
		customAddress.setPinCode(insurancePolicy.getCustomerPinCode());
315
		customAddress.setState(insurancePolicy.getCustomerState());
316
		customAddress.setPhoneNumber(insurancePolicy.getCustomerMobileNumber());
317
		customCustomer.setAddress(customAddress);
318
		pdfModel.setCustomer(customCustomer);
319
 
320
		// TODO get invoice number for damageProtection provider
321
		pdfModel.setInvoiceNumber(thirdPartyInvoiceSequenceRepository.getNextSequence(ThirdParty.GADGET_COP));
322
		pdfModel.setTotalAmount(gadgetCopsInsuranceCalcRepository.selectByPrice(insurancePolicy.getSellingPrice()));
323
 
324
		// Here bill is generated on behalf of GadgetCop
325
		ThirdPartyInvoiceSequence damageProtectionProvider = thirdPartyInvoiceSequenceRepository
326
				.selectByThirdParty(ThirdParty.GADGET_COP);
327
		// Gadget Cop
328
		// Gadget cop mobile
329
		CustomRetailer customRetailer = new CustomRetailer();
330
		customRetailer.setBusinessName(damageProtectionProvider.getName());
331
		customRetailer.setMobileNumber(damageProtectionProvider.getMobileNumber());
332
		customRetailer.setGstNumber(damageProtectionProvider.getGstNumber());
22912 amit.gupta 333
		//customRetailer.setAddress(address);
334
 
22889 amit.gupta 335
		CustomAddress providerAddress = new CustomAddress();
336
		providerAddress.setCity(damageProtectionProvider.getCity());
337
		providerAddress.setLine1(damageProtectionProvider.getLine1());
338
		providerAddress.setLine2(damageProtectionProvider.getLine2());
339
		providerAddress.setPinCode(damageProtectionProvider.getPin());
340
		providerAddress.setPhoneNumber(damageProtectionProvider.getMobileNumber());
341
		providerAddress.setState(damageProtectionProvider.getState());
22912 amit.gupta 342
 
343
		customRetailer.setAddress(providerAddress);
22889 amit.gupta 344
		pdfModel.setRetailer(customRetailer);
345
 
346
		Set<CustomOrderItem> customerFofoOrderItems = new HashSet<>();
347
		pdfModel.setOrderItems(customerFofoOrderItems);
23001 amit.gupta 348
		pdfModel.setTncs(Arrays.asList("Please check out Policy Schedule for detailed terms and conditions."));
22889 amit.gupta 349
		return pdfModel;
350
	}
22932 amit.gupta 351
 
352
	private List<GadgetCopsInsuranceCalcResponse> toCalcResponseList (List<GadgetCopsInsuranceCalc> calcList) {
353
		List<GadgetCopsInsuranceCalcResponse> calcResponseList = new ArrayList<>();
354
		for (GadgetCopsInsuranceCalc calc : calcList) {
355
			GadgetCopsInsuranceCalcResponse calcResponse = new GadgetCopsInsuranceCalcResponse();
356
			calcResponse.setDealerPrice(calc.getDealerPrice());
357
			calcResponse.setPriceRangeMax(calc.getPriceRangeMax());
358
			calcResponse.setPriceRangeMin(calc.getPriceRangeMin());
22999 amit.gupta 359
			calcResponse.setSellingPrice(calc.getSellingPrice());
22932 amit.gupta 360
			float taxableInsuranceMargin = (calc.getSellingPrice() - calc.getDealerPrice()) / (1 + ProfitMandiConstants.INSURANCE_TAX_RATE / 100);
22937 amit.gupta 361
			calcResponse.setCashBack((int)taxableInsuranceMargin);
22932 amit.gupta 362
			calcResponseList.add(calcResponse);
363
		}
364
		return calcResponseList;
365
	}
22889 amit.gupta 366
 
22866 ashik.ali 367
}