Subversion Repositories SmartDukaan

Rev

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