Subversion Repositories SmartDukaan

Rev

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