Subversion Repositories SmartDukaan

Rev

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