0% found this document useful (0 votes)
2 views30 pages

Save and Manage Quotes API

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views30 pages

Save and Manage Quotes API

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

package [Link].

controller;

import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];

import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link].*;

import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];

import [Link];
import [Link].slf4j.Slf4j;
import [Link];

@Slf4j
@RestController
@RequestMapping("/v1")
public class QuoteController {

@Autowired
private QuoteService quoteService;

@Autowired
private ProductDDService productService;

@Autowired
private EmailUtil emailUtils;

@Autowired
private CategoryBulletRepo categoryBulletRepo;

@Autowired
private Environment env;

@Autowired
AuthUtil authUtil;

@Autowired
SecurityKeysService sksService;

@Operation(summary = "save quote", description = "save quote")


@PostMapping("/saveQuote")
// public ResponseEntity<Long> saveQuote(@RequestBody Quote quote, @RequestParam
boolean D2D,
public ResponseEntity<Long> saveQuote(@RequestBody String jsonRequest,
@RequestParam boolean email/* , @RequestHeader("myelthtoken")
String authorization */)
throws JsonMappingException, JsonProcessingException {
/*
* if ([Link](authorization).getStatusCode() !=
[Link]) {
* throw new RuntimeException("Not Authorized"); }
*/
// Quote quote = new
//
ObjectMapper().readValue([Link]([Link]
(jsonRequest)),
// [Link]);
// String data = [Link](sksService,
jsonRequest).getData();

Quote quote = new ObjectMapper().readValue(jsonRequest, [Link]);


for (QuotePerson person : [Link]()) {
Map<String, Object> lcrData = [Link]();
if (lcrData == null) {
lcrData = new HashMap<>();
}

[Link]("prevInsCreditYears",
[Link]("prevInsCreditYears", 0));
[Link]("prevInsCreditDays",
[Link]("prevInsCreditDays", 0));
[Link]("lcrExposureYears",
[Link]("lcrExposureYears", 0));
[Link]("lcrCreditYears",
[Link]("lcrCreditYears", 0));
[Link]("lcrExemption", [Link]("lcrExemption",
false));
[Link]("lcrExemptionReason",
[Link]("lcrExemptionReason", ""));
[Link]("hasLivingAbroad",
[Link]("hasLivingAbroad", false));
[Link]("PrincipalResidence_Dt",
[Link]("PrincipalResidence_Dt", ""));
[Link]("defenseForcesMember",
[Link]("defenseForcesMember", false));
[Link]("lcrPaidDays", [Link]("lcrPaidDays",
0));
[Link]("lcrPaidYears", [Link]("lcrPaidYears",
0));
[Link]("totalCreditYears",
[Link]("totalCreditYears", 0));

[Link]("breakCoverPeriods",
[Link]("breakCoverPeriods", new ArrayList<>()));
[Link]("breaks", [Link]("breaks", new
ArrayList<>()));
[Link]("insuranceHistory",
[Link]("insuranceHistory", new ArrayList<>()));
[Link]("prevCoverPeriods",
[Link]("prevCoverPeriods", new ArrayList<>()));

[Link]("Updated lcrData for person {}: {}", [Link](),


lcrData);
[Link](lcrData);
}

SimpleDateFormat startDateFormat = new SimpleDateFormat("dd/MM/yyyy");

SimpleDateFormat dayFormat = new SimpleDateFormat("d");


SimpleDateFormat monthYearFormat = new SimpleDateFormat("MMMM yyyy");

SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");


// [Link]([Link]("GMT"));
Date policyStartDate = null;
String startDate = null;
String validDate = null;

try {
policyStartDate =
[Link]([Link]([Link]()));
} catch (ParseException e) {
[Link](" Exception " + [Link]());
}
[Link](new Date());
[Link](policyStartDate);
Quote saveQuote = [Link](quote);

startDate = [Link](policyStartDate);

validDate = formatDateWithSuffix([Link]());

String URL = [Link](ApplicationConstant.ENV_URL) + "/web-


portals/planSummary/"
+ [Link]();
String planName = [Link]();
ProductDD product = [Link](planName);
String excess = [Link]();
boolean d2d = [Link]().contains("D2D") ? true :
false;

String body = buildEmailTemplate(saveQuote, email, validDate,


startDate, d2d);
String source = "Online Sales Portal";
double yearlyAmount = [Link]();
double monthlyAmount = [Link]();

NetSuiteLeadGenerator leadGenerator = new NetSuiteLeadGenerator(env);


int statusCode = [Link]([Link](),
[Link](), source, URL,
[Link](),
[Link]([Link]().size()), planName, excess, d2d,
yearlyAmount, monthlyAmount, [Link](),
[Link]([Link]()),
quote);

if (statusCode == 1) {
return new ResponseEntity<>([Link](),
[Link]);
} else {
return new ResponseEntity<>([Link](),
HttpStatus.INTERNAL_SERVER_ERROR);
}
}

private String formatDateWithSuffix(Date date) {


SimpleDateFormat dayFormat = new SimpleDateFormat("d");
SimpleDateFormat monthYearFormat = new SimpleDateFormat("MMMM yyyy");

String day = [Link](date);


String daySuffix = getDaySuffix([Link](day));
return day + daySuffix + " " + [Link](date);
}

private String getDaySuffix(int day) {


if (day >= 11 && day <= 13) {
return "th";
}
switch (day % 10) {
case 1:
return "st";
case 2:
return "nd";
case 3:
return "rd";
default:
return "th";
}
}

@Operation(summary = "save quote", description = "save quote")


@GetMapping("/printView/{id}")
public ResponseEntity<Object> printView(@PathVariable long id,
@RequestHeader("myelthtoken") String authorization) {
ResponseEntity<Object> responseEntity =
[Link](authorization);
if ([Link]() != [Link]) {
return responseEntity;
}
String response = buildEmailTemplate([Link](id),
false, null, null, false);
return new ResponseEntity<>(response, [Link]);
}

@Operation(summary = "get all quotes", description = "get all quotes")


@GetMapping("/getAllQuotes")
public ResponseEntity<Object> getAllQuotes(@RequestHeader("myelthtoken")
String authorization) {
if ([Link](authorization).getStatusCode() != [Link])
{
return new ResponseEntity<Object>("Authorization token expired",
HttpStatus.BAD_REQUEST);
}
return new ResponseEntity<>([Link](), [Link]);
}

@Operation(summary = "get find by id quote", description = "get find by id


quote")
@GetMapping("/getQuote/{id}")
public ResponseEntity<Object> getQuoteById(@PathVariable long id,
@RequestHeader("myelthtoken") String authorization) throws
JsonProcessingException {
if ([Link](authorization).getStatusCode() != [Link])
{
return new ResponseEntity<Object>("Authorization token expired",
HttpStatus.BAD_REQUEST);
}

return new
ResponseEntity<>([Link]([Link](sksService,
new
ObjectMapper().writeValueAsString([Link](id)), "")),
[Link]);
// return new ResponseEntity<>([Link](id),
[Link]);
}

@Operation(summary = "get find by id quote", description = "get find by id


quote")
@GetMapping("/getSavedQuote/{id}")
public ResponseEntity<Object> getUserQuoteById(@PathVariable String id,
@RequestHeader("myelthtoken") String authorization) {
if ([Link](authorization).getStatusCode() != [Link])
{
return new ResponseEntity<Object>("Authorization token expired",
HttpStatus.BAD_REQUEST);
}
return new ResponseEntity<>([Link](id),
[Link]);
}

@Operation(summary = "Testing save quote", description = "save quote")


@PostMapping("/sendEmail")
public void saveQuote1(@RequestParam long id) {
[Link]("id" + id);
Quote savedQuote = [Link](id);
buildEmailTemplate(savedQuote, true, null, null, false);

@Operation(summary = "update the quote by id", description = "update the


quote by id")
@PostMapping("/updateQuote/{id}")
public ResponseEntity<Object> getQuoteById(@PathVariable long id,
@RequestBody String jsonRequest,
@RequestHeader(value = "myelthtoken", required = false) String
authorization, @RequestParam boolean ns_sync)
throws JsonMappingException, JsonProcessingException {
// Quote quote = new
//
ObjectMapper().readValue([Link]([Link]
(jsonRequest)),
// [Link]);

String data = [Link](sksService,


jsonRequest).getData();

Quote quote = new ObjectMapper().readValue(data, [Link]);


if (null != authorization) {
if ([Link](authorization).getStatusCode() !=
[Link]) {
return new ResponseEntity<Object>("Authorization token
expired", HttpStatus.BAD_REQUEST);
}
}
Quote savedQuote = [Link](id);

if (savedQuote != null) {
if ([Link]() == id) {
return new ResponseEntity<>([Link](id,
quote, ns_sync), [Link]);
}
}

return new ResponseEntity<>("NO DATA FOUND WITH QUOTE ID: " + id,
HttpStatus.NOT_FOUND);
}

private String buildEmailTemplate(Quote quote, boolean sendEmail, String


validDate, String startDate, boolean D2D) {
String headData = headData([Link](),
[Link]([Link]()),
[Link]().toString(), [Link](),
"Day to Day",
[Link]([Link]()),
[Link](), quote, validDate, startDate,
D2D);
if (sendEmail) {
[Link]([Link](), "Your Level Health
quote", headData);
}
return headData;
}

public String headData(String planName, String quoteRef, String startDate,


String excess, String extra,
ProductDD product, List<QuotePerson> list, Quote quote, String
validDate, String startDate2, boolean D2D) {

[Link]("productId: -------------->" +
[Link]());
planName = [Link](); // taking category as plan name for
customer convenience
String hospitalText = "";

if ([Link]("A")) {
hospitalText = "Semi-private hospital cover in public hospitals";
} else if ([Link]("D")) {
hospitalText = "Private hospital cover in private hospital & high
tech hospitals";
} else {
hospitalText = "Semi-private hospital cover in private
hospitals";
}

int index_of_at = [Link]().indexOf('@');


String firstName = [Link]().substring(0, index_of_at);
// [Link] dob =
[Link]().atZone([Link]()).toLocalDate();
// [Link] currentDate = [Link]();

String greetingName = "Hi,";

int age = [Link]().get(0).getAge();


String primaryFirstName = "Policyholder"; // Default value if firstName
is not provided
for (QuotePerson person : [Link]()) {
if ("Primary".equalsIgnoreCase([Link]()) ||
"S".equalsIgnoreCase([Link]())) {
primaryFirstName = ([Link]() != null && !
[Link]().isEmpty())
? [Link]()
: "Policyholder";
greetingName = ([Link]() != null && !
[Link]().isEmpty())
? "Hi " + [Link]() + "," // Add
the firstName and a comma
: "Hi,";
break;
}
}
String day2day = "";
String excessValueComponentParent = "";
String excessValue = [Link]();

String excessValueComponent = " <tr>\r\n" + "


<td\r\n"
+ " colspan=\"2\"\r\n" + "
style=\"\r\n"
+ " padding-top: 10px;\r\n"
+ " padding-bottom: 10px;\r\n"
+ " border-top: 1px solid
#d1d1d1;\r\n"
+ " \"\r\n" + "
>\r\n"
+ " <h4\r\n" + "
style=\"\r\n"
+ " color: #191919;\r\n"
+ " font-size: 18px;\r\n"
+ " font-weight: bold;\r\n"
+ " margin: 0;\r\n"
+ " margin-bottom: 10px;\r\
n" + " \"\r\n"
+ " >\r\n" + "
Excess: " + excessValue + "\r\n"
+ " </h4>\r\n" + "
<p\r\n"
+ " style=\"color: #535353;
font-size: 14px; margin: 0\"\r\n"
+ " >\r\n"
+ " (Amount I will pay per
private hospital stay)\r\n"
+ " </p>\r\n" + "
</td>\r\n"
+ " </tr>\r\n";

if ([Link]("\\d+")) {
excessValue = "&euro;" + excessValue;
excessValueComponentParent = excessValueComponent;
} else {
excessValueComponentParent = "";
}
[Link]();
DecimalFormat decimalFormat = new DecimalFormat("#,##0.00");

String yearlyAmountFormatted =
[Link]([Link]());
String monthlyAmountFormatted =
[Link]([Link]());

if (D2D) {
day2day = " <tr>\r\n" + " <td\r\n"
+ " colspan=\"2\"\r\n" + "
style=\"\r\n"
+ " padding-top: 10px;\
r\n"
+ " border-top: 1px
solid #d1d1d1;\r\n"
+ " \"\r\n" + "
>\r\n"
+ " <h4\r\n" + "
style=\"\r\n"
+ " color: #191919;\r\
n"
+ " font-size: 18px;\
r\n"
+ " font-weight:
bold;\r\n"
+ " margin: 0;\r\n"
+ " margin-bottom:
10px;\r\n"
+ " \"\r\n" + "
>\r\n"
+ " Includes day-to-day\
r\n" + " </h4>\r\n"
+ " </td>\r\n" + "
</tr>";
}
// if ([Link]("\\d+")) {
excessValueComponent = " <tr>\r\n" + "
<td\r\n"
+ " colspan=\"2\"\r\n" + "
style=\"\r\n"
+ " padding-top: 10px;\r\n"
+ " padding-bottom: 10px;\r\n"
+ " border-top: 1px solid
#d1d1d1;\r\n"
+ " \"\r\n" + "
>\r\n"
+ " <h4\r\n" + "
style=\"\r\n"
+ " color: #191919;\r\n"
+ " font-size: 18px;\r\n"
+ " font-weight: bold;\r\n"
+ " margin: 0;\r\n"
+ " margin-bottom: 10px;\r\
n" + " \"\r\n"
+ " >\r\n" + "
Excess: " + excessValue + "\r\n"
+ " </h4>\r\n" + "
<p\r\n"
+ " style=\"color: #535353;
font-size: 14px; margin: 0\"\r\n"
+ " >\r\n"
+ " (Amount I will pay per
private hospital stay)\r\n"
+ " </p>\r\n" + "
</td>\r\n"
+ " </tr>\r\n";
// }
CategoryBullet categoryBullet =
[Link]([Link]()).get();

String features = getFeatures(categoryBullet);

String head = "<!DOCTYPE html>\r\n" + "<html>\r\n" + " <head>\r\n" + "


<title>Email Template</title>\r\n"
+ " </head>\r\n" + " <body\r\n" + " style=\"\r\n" + "
margin: 0;\r\n"
+ " padding: 0;\r\n"
+ " font-family: Arial, Helvetica Neue, Helvetica,
Roboto, Droid Sans,\r\n"
+ " sans-serif;\r\n" + " background-color:
#ffece5;\r\n" + " \"\r\n" + " >\r\n"
+ " <!-- part 1 -->\r\n" + " <table\r\n" + "
role=\"presentation\"\r\n"
+ " width=\"100%\"\r\n" + " cellspacing=\"0\"\r\
n" + " cellpadding=\"0\"\r\n"
+ " border=\"0\"\r\n" + " style=\"background-
color: #ffece5\"\r\n" + " >\r\n"
+ " <tr>\r\n" + " <td align=\"center\"
style=\"padding: 0\">\r\n" + " <table\r\n"
+ " role=\"presentation\"\r\n" + "
width=\"570\"\r\n"
+ " cellspacing=\"0\"\r\n" + "
cellpadding=\"0\"\r\n"
+ " border=\"0\"\r\n"
+ " style=\"width: 100%; max-width: 570px;
background-color: #ffece5\"\r\n"
+ " >\r\n" + " <!-- Header -->\r\n" + "
<tr>\r\n"
+ " <td\r\n" + "
align=\"left\"\r\n"
+ " style=\"padding: 40px 50px 20px;
background-color: #ffece5\"\r\n"
+ " >\r\n" + " <img\r\n"
+ "
src=\"[Link]
%2Fe15634eac86f4f059f42b9cdb1f7eb1d\"\r\n"
+ " alt=\"Level Health\"\r\n" + "
/>\r\n" + " </td>\r\n"
+ " </tr>\r\n" + " <tr>\r\n" + "
<td\r\n"
+ " align=\"left\"\r\n"
+ " style=\"padding: 0 50px 20px;
background-color: #ffece5\"\r\n"
+ " >\r\n" + " <h1\r\n" + "
style=\"\r\n"
+ " color: #333333;\r\n" + "
font-size: 48px;\r\n"
+ " font-weight: bold;\r\n" + "
margin: 0 0 20px;\r\n"
+ " \"\r\n" + " >\r\n" + "
Your quote ref<br />\r\n"
+ " no. <span style=\"color: #ff1754\">" +
quoteRef + "</span> "
// + "is valid only\r\n"
// + " for today!\r\n"
+ " </h1>\r\n" + " </td>\r\n" +
" </tr>\r\n"
+ " <!-- Main Content -->\r\n" + "
<tr>\r\n"
+ " <td style=\"padding: 0 20px\">\r\n" + "
<table\r\n"
+ " role=\"presentation\"\r\n" + "
width=\"100%\"\r\n"
+ " cellspacing=\"0\"\r\n" + "
cellpadding=\"0\"\r\n"
+ " border=\"0\"\r\n" + "
>\r\n" + " <tr>\r\n"
+ " <td\r\n"
+ " style=\"background-color: #ffffff;
padding: 30px 30px 10px\"\r\n"
+ " >\r\n" + " " +
"<p\r\n"
+ " style=\"\r\n" + "
color: #333333;\r\n"
+ " font-size: 16px;\r\n" + "
line-height: 24px;\r\n"
+ " \"\r\n" + "
>\r\n" + greetingName + "<br /><br />\r\n"
+ " Thanks for checking out Level
Health. <br /><br />\r\n"
+ " Here's the quote you requested.
<br /><br />\r\n"
// + "It's only valid for\r\n"
// + " today, as prices or coverage may
change after today.<br /><br />\r\n"
+ " With us, you get health cover
that's on the level - more\r\n"
+ " accessible, relevant, and
beneficial. Less of the jargon\r\n"
+ " and more of what matters. To
join, click below to\r\n"
+ " continue or simply call us on 01
261 2000 (Mon-Fri, 9am\r\n"
+ " - 5.30pm).\r\n" + "
</p>\r\n"
+ " <h2\r\n" + "
style=\"\r\n"
+ " color: #590030;\r\n" + "
text-align: center;\r\n"
+ " font-size: 24px;\r\n" + "
font-weight: bold;\r\n"
+ " margin-top: 20px;\r\n" + "
\"\r\n"
+ " >\r\n" + "
My Quote\r\n"
+ " </h2>\r\n" + "
<p\r\n"
+ " style=\"\r\n" + "
color: black;\r\n"
+ " text-align: center;\r\n" + "
font-size: 16px;\r\n"
+ " font-weight: bold;\r\n"
+ " margin-bottom: 5px;\r\n" + "
\"\r\n"
+ " >\r\n" + "
Reference: " + quoteRef + "\r\n"
+ " </p>\r\n" + "
<p\r\n"
+ " style=\"\r\n" + "
color: #ff1754;\r\n"
+ " text-align: center;\r\n" + "
margin-top: 0;\r\n"
+ " font-size: 16px;\r\n" + "
font-weight: bold;\r\n"
+ " \"\r\n" + "
>\r\n"
+ " Valid on: " + validDate + "\r\n"
+ " </p>\r\n" + "\r\n"
+ " <p\r\n" + "
style=\"\r\n"
+ " color: #590030;\r\n" + "
text-align: center;\r\n"
+ " font-size: 24px;\r\n" + "
font-weight: bold;\r\n"
+ " margin-bottom: 5px;\r\n" + "
\"\r\n"
+ " >\r\n" + "
&euro;" + monthlyAmountFormatted
+ "/month\r\n" + " </p>\r\n" + "\r\n"
+ " <p\r\n"
+ " style=\"\r\n" + "
color: #000000;\r\n"
+ " text-align: center;\r\n" + "
font-size: 16px;\r\n"
+ " margin-bottom: 5px;\r\n" + "
margin-top: 0;\r\n"
+ " \"\r\n" + "
>\r\n" + " &euro;"
+ yearlyAmountFormatted + " / year\r\n" + "
</p>\r\n" + "\r\n"
+ " <p\r\n" + "
style=\"\r\n"
+ " color: #191919;\r\n" + "
font-weight: bold;\r\n"
+ " text-align: center;\r\n" + "
font-size: 16px;\r\n"
+ " \"\r\n" + "
>\r\n"
+ " Start Date: " + startDate2 + "\
r\n" + " </p>\r\n"
+ " <div style=\"text-align: center;
margin-top: 20px\">\r\n"
+ " <a\r\n" + "
"
+ " href=" +
[Link](ApplicationConstant.ENV_URL)
+ "/web-portals/continueQuote/" + quoteRef + "/" +
[Link]() + "?email="
+ [Link]() + "\r\n" + "
style=\"\r\n"
+ " display: inline-block;\r\n"
+ " background-color: #ff1754;\
r\n"
+ " color: #ffffff;\r\n"
+ " padding: 12px 30px;\r\n"
+ " text-decoration: none;\r\n"
+ " border-radius: 25px;\r\n"
+ " font-size: 16px;\r\n"
+ " font-weight: bold;\r\n" + "
width: 326px;\r\n"
+ " \"\r\n" + "
>Continue</a\r\n"
+ " >\r\n" + "
</div>\r\n" + "\r\n"

+ "<p \r\n" + " style=\"\r\n" + "


color: #ff1754;\r\n"
+ " text-align: center;\r\n" + "
margin: 30px;\r\n"
+ " font-size: 16px;\r\n" + "
font-weight: bold;\r\n"
+ " \"\r\n" + "
>\r\n"
+ " <a href=\"[Link] 1 2612000\"+ \"
style=\" color: #ff1754\"\r\n\">Call Us on 01 2612000</a> \r\n</p>"
+ "<p >\r\n"
// + " style=\"\r\n
color: #333333;\r\n\r\n"
// + " font-size: 16px;\r\n" + ">\r\
n"
// + "*All prices are for a single adult and include tax
relief at the standard rate and a 10% group discount.<br /><br />\r\n"
+ "The price includes tax relief at the standard rate and
any applicable discounts or loadings. "
+ "The price shown is based on the information you provided
to us. "
+ "The price may change if information you provide changes.
Terms and conditions apply. "
+ " </p>"

+ " <div\r\n" + "


style=\"\r\n"
+ " margin: 30px 0;\r\n"
+ " background-color: #e6e6e6;\r\
n"
+ " height: 1px;\r\n" + "
\"\r\n"
+ " ></div>\r\n" + "\r\n" + "
<!-- Policy Details -->\r\n"
// + " <h3\r\n" + "
style=\"\r\n"
// + " color: #666666;\r\n" + "
font-size: 20px;\r\n"
// + " margin-bottom: 10px;\r\n" + "
\"\r\n"
// + " >\r\n" + "
Policy Details\r\n"
// + " </h3>\r\n" + "
"
+ "</td>\r\n" + " </tr>\r\n" + "
</table>\r\n"
+ " </td>\r\n" + " </tr>\r\n" + "
</table>\r\n" + " </td>\r\n"
+ " </tr>\r\n" + " </table>"

+ " <!-- part 2 -->\r\n" + " <table\r\n" + "


role=\"presentation\"\r\n"
+ " width=\"100%\"\r\n" + " cellspacing=\"0\"\r\
n" + " cellpadding=\"0\"\r\n"
+ " border=\"0\"\r\n" + " style=\"background-
color: #ffece5\"\r\n" + " >\r\n"
+ " <tr>\r\n" + " <td align=\"center\">\r\n" +
" <table\r\n"
+ " role=\"presentation\"\r\n" + "
width=\"570\"\r\n"
+ " cellspacing=\"0\"\r\n" + "
cellpadding=\"0\"\r\n"
+ " border=\"0\"\r\n"
+ " style=\"width: 100%; max-width: 570px;
background-color: #ffece5\"\r\n"
+ " >\r\n" + " <!-- Main Content -->\r\
n" + " <tr>\r\n"
+ " <td style=\"padding: 0 20px\">\r\n" + "
<table\r\n"
+ " role=\"presentation\"\r\n" + "
width=\"100%\"\r\n"
+ " cellspacing=\"0\"\r\n" + "
cellpadding=\"0\"\r\n"
+ " border=\"0\"\r\n" + "
>\r\n" + " <tr>\r\n"
+ " <td\r\n" + "
style=\"\r\n"
+ " background-color: #ffffff;\r\n"
+ " border-radius: 0;\r\n" + "
padding: 0 30px 10px;\r\n"
+ " \"\r\n" + " >\
r\n" + " <table\r\n"
+ " role=\"presentation\"\r\n" + "
width=\"100%\"\r\n"
+ " cellspacing=\"0\"\r\n" + "
cellpadding=\"0\"\r\n"
+ " border=\"0\"\r\n" + "
style=\"\r\n"
+ " background-color: #ffffff;\r\
n"
+ " padding: 20px;\r\n"
+ " border: 1px solid #d1d1d1;\r\
n"
+ " border-radius: 8px;\r\n" + "
\"\r\n"
+ " >\r\n" + "
<tr>\r\n"
+ " <td\r\n" + "
align=\"left\"\r\n"
+ " style=\"\r\n" + "
color: #ff1754;\r\n"
+ " font-size: 48px;\r\n"
+ " font-weight: bold;\r\n" +
" \"\r\n"
+ " >\r\n" + "
" + "Plan " + planName + "\r\n"
+ " </td>\r\n" + "
<td\r\n"
+ " align=\"right\"\r\n" + "
style=\"\r\n"
+ " text-align: right;\r\n"
+ " color: #ff1754;\r\n"
+ " font-size: 14px;\r\n" + "
\"\r\n"
+ " >\r\n" + "
<a\r\n"
// + " href=" +
[Link](ApplicationConstant.ENV_URL)
// + "/web-portals/continuePlan/" +
[Link]() + "\r\n"

+ " href=" +
[Link](ApplicationConstant.ENV_URL)
+ "/web-portals/plan-details/" +
[Link]() + "\r\n"
+ " style=\"text-decoration:
underline; color: #ff1754\"\r\n"
+ " >Details</a\r\n" + "
>\r\n"
+ " </td>\r\n" + "
</tr>\r\n"
+ " <tr>\r\n" + "
<td\r\n"
+ " colspan=\"2\"\r\n" + "
style=\"\r\n"
+ " border-top: 1px solid
#b2b2b2;\r\n"
+ " padding-top: 10px;\r\n" +
" \"\r\n"
+ " >\r\n" + "
<p\r\n"
+ " style=\"\r\n" + "
color: #191919;\r\n"
+ " font-size: 16px;\r\n"
+ " margin: 0;\r\n"
+ " line-height: 24px;\r\n"
+ " \"\r\n"
+ " >\r\n"
+ " The perfect plan to cover
all of your hospital and\r\n"
+ " day-to-day needs for your
family.\r\n"
+ " </p>\r\n" + "
</td>\r\n"
+ " </tr>\r\n" + "
<tr>\r\n"
+ " <td colspan=\"2\">\r\n" + "
<ul\r\n"
+ " style=\"\r\n" + "
color: #191919;\r\n"
+ " font-size: 16px;\r\n"
+ " list-style: none;\r\n"
+ " padding: 0;\r\n"
+ " margin-top: 10px;\r\n" +
" \"\r\n"
+ " >\r\n"
+ " <li style=\"margin-bottom:
10px\">\r\n"
// + " <img\r\n"
// + "
src=\"[Link]
%2F801cbc4ea7fd40bc831a9bfff6064b1b\"\r\n"
// + " alt=\"Icon\"\r\n"
// + " style=\"\r\n"
// + " vertical-align:
middle;\r\n"
// + " margin-right: 10px;\
r\n"
// + " display: inline;\r\
n"
// + " \"\r\n" + "
/>\r\n"
+ " <p\r\n" + "
style=\"\r\n"
+ " display: inline;\r\
n"
+ " vertical-align:
middle;\r\n"
+ " \"\r\n" + "
>\r\n"
+ " " + features + "\r\n"
+ " </p>\r\n"
+ " </li>\r\n" + "
</ul>\r\n"
+ " </td>\r\n" + "
</tr>\r\n"
+ " <tr>\r\n" + "
<td\r\n"
+ " colspan=\"2\"\r\n" + "
style=\"\r\n"
+ " padding-top: 10px;\r\n"
+ " padding-bottom: 10px;\r\n"
+ " border-top: 1px solid
#d1d1d1;\r\n"
+ " \"\r\n" + "
>\r\n"
+ " <table>\r\n" + "
<tr>\r\n"
+ " <td width=\"250\">\r\n"
+ " <h4\r\n"
+ " style=\"\r\n"
+ " color: #191919;\r\
n"
+ " font-size: 18px;\
r\n"
+ " font-weight:
bold;\r\n"
+ " margin: 0;\r\n"
+ " margin-bottom:
10px;\r\n"
+ " \"\r\n" + "
>\r\n"
+ " Hospital\r\n" + "
</h4>\r\n"
+ " </td>\r\n" + "
<td>\r\n"
+ " <p\r\n" + "
style=\"\r\n"
+ " color: #191919;\r\
n"
+ " font-size: 14px;\
r\n"
+ " margin: 0;\r\n" +
" \"\r\n"
+ " >\r\n" + hospitalText
+ " </p>\r\n" + "
</td>\r\n"
+ " </tr>\r\n" + "
</table>\r\n"
+ " </td>\r\n" + "
</tr>\r\n"
// + " <tr>\r\n" + "
<td\r\n"
// + " colspan=\"2\"\r\n" + "
style=\"\r\n"
// + " padding-top: 10px;\r\n"
// + " padding-bottom: 10px;\r\n"
// + " border-top: 1px solid
#d1d1d1;\r\n"
// + " \"\r\n" + "
>\r\n"
// + " <h4\r\n" + "
style=\"\r\n"
// + " color: #191919;\r\n"
// + " font-size: 18px;\r\n"
// + " font-weight: bold;\r\n"
// + " margin: 0;\r\n"
// + " margin-bottom: 10px;\r\
n" + " \"\r\n"
// + " >\r\n" + "
Excess: " + excessValue + "\r\n"
// + " </h4>\r\n" + "
<p\r\n"
// + " style=\"color: #535353;
font-size: 14px; margin: 0\"\r\n"
// + " >\r\n"
// + " (Amount I will pay per
private hospital stay)\r\n"
// + " </p>\r\n" + "
</td>\r\n"
// + " </tr>\r\n"
+ excessValueComponentParent
// + "" +excessValueComponent+ ""
+ day2day;

String constantTail = " </ul>\r\n" + " </td>\


r\n" + " </tr>\r\n"
+ " </table>\r\n"
// + " </td>\r\n" + "
</tr>\r\n"
// + " </table>\r\n" + " </td>\r\
n" + " </tr>\r\n"
// + " </table>\r\n" + " </td>\r\n" + "
</tr>\r\n" + " </table>"
+ "<!-- part 3 -->\r\n" + " <table\r\n" + "
role=\"presentation\"\r\n"
+ " width=\"100%\"\r\n" + " cellspacing=\"0\"\r\
n" + " cellpadding=\"0\"\r\n"
+ " border=\"0\"\r\n" + " style=\"background-
color: #ffece5\"\r\n" + " >\r\n"
+ " <tr>\r\n" + " <td align=\"center\"
style=\"padding: 0\">\r\n" + " <table\r\n"
+ " role=\"presentation\"\r\n" + "
width=\"570\"\r\n"
+ " cellspacing=\"0\"\r\n" + "
cellpadding=\"0\"\r\n"
+ " border=\"0\"\r\n"
+ " style=\"width: 100%; max-width: 570px;
background-color: #ffece5\"\r\n"
+ " >\r\n" + " <tr>\r\n" + "
<td style=\"padding: 0 20px\">\r\n"
+ " <table\r\n" + "
role=\"presentation\"\r\n"
+ " width=\"100%\"\r\n" + "
cellspacing=\"0\"\r\n"
+ " cellpadding=\"0\"\r\n" + "
border=\"0\"\r\n"
+ " >\r\n" + " <tr>\r\n" +
" <td\r\n"
+ " style=\"background-color: #ffffff;
padding: 20px 30px 30px\"\r\n"
+ " >\r\n" + " <div
style=\"text-align: center\">\r\n"
+ " <a\r\n" + "
href=" + [Link]("[Link]")
+ "/web-portals/continueQuote/" + quoteRef + "/" +
[Link]() + "?email="
+ [Link]() + "\r\n" + "
style=\"\r\n"
+ " display: inline-block;\r\n"
+ " background-color: #ff1754;\
r\n"
+ " color: #ffffff;\r\n"
+ " padding: 12px 30px;\r\n"
+ " text-decoration: none;\r\n"
+ " border-radius: 25px;\r\n"
+ " font-size: 16px;\r\n"
+ " font-weight: bold;\r\n" + "
width: 326px;\r\n"
+ " \"\r\n" + "
>Continue</a\r\n"
+ " >\r\n" + "
</div>\r\n"

+ "<p \r\n" + " style=\"\r\n" + "


color: #ff1754;\r\n"
+ " text-align: center;\r\n" + "
margin: 30px;\r\n"
+ " font-size: 16px;\r\n" + "
font-weight: bold;\r\n"
+ " \"\r\n" + "
>\r\n"
+ " <a href=\"[Link] 1 2612000\"+ \"
style=\" color: #ff1754\"\r\n\">Call Us on 01 2612000</a> \r\n"
// + " <table\r\n" + "
style=\"\r\n"
// + " padding: 20px;\r\n"
// + " background-color: #ffffff;\r\
n"
// + " margin: 30px 0 10px;\r\n"
// + " border: 1px solid #d1d1d1;\r\
n"
// + " border-radius: 8px;\r\n" + "
width: 100%;\r\n"
// + " \"\r\n" + "
>\r\n"
// + " <!-- Key Benefits -->\r\n" + "
<tr>\r\n"
// + " <td>\r\n" + "
<h3\r\n"
// + " style=\"\r\n" + "
color: #ff1754;\r\n"
// + " font-size: 20px;\r\n"
// + " font-weight: bold;\r\n"
// + " margin-bottom: 15px;\r\
n"
// + " margin-top: 0;\r\n"
// + " padding-bottom: 15px;\r\
n" + "\r\n"
// + " border-bottom: 1px solid
#d1d1d1;\r\n"
// + " \"\r\n" + "
>\r\n"
// + " Key benefits\r\n" + "
</h3>\r\n"
// + " <ul\r\n" + "
style=\"\r\n"
// + " color: #191919;\r\n"
// + " font-size: 16px;\r\n"
// + " list-style: none;\r\n"
// + " padding: 0;\r\n" + "
margin: 0;\r\n"
// + " \"\r\n" + "
>\r\n"
// + " <li style=\"margin-bottom:
10px\">\r\n"
// + " Immediate advice from
doctors via WhatsApp 24/7.\r\n"
// + " </li>\r\n"
// + " <li style=\"margin-bottom:
10px\">\r\n"
// + " Great Aviva perks like
50% off home insurance.\r\n"
// + " </li>\r\n"
// + " <li style=\"margin-bottom:
10px\">Kids under 3 are free.</li>\r\n"
// + " <li style=\"margin-bottom:
10px\">\r\n"
// + " Free travel insurance.\
r\n"
// + "\r\n"
// + " </li>\r\n"
// + " <li style=\"margin-bottom:
10px\">\r\n"
// + " Revolut claims payment
option.\r\n"
// + "\r\n"
// + " </li>\r\n" + "
</ul>\r\n"
// + " </td>\r\n" + "
</tr>\r\n"
// + " </table>\r\n"
+ " <table\r\n" + "
role=\"presentation\"\r\n"
+ " width=\"100%\"\r\n" + "
cellspacing=\"0\"\r\n"
+ " cellpadding=\"0\"\r\n" + "
border=\"0\"\r\n"
+ " style=\"\r\n" + "
background-color: #ff1754;\r\n"
+ " box-shadow: 0 0 15px #e6e6e6;\r\
n"
+ " padding: 40px;\r\n" + "
border-radius: 8px;\r\n"
+ " margin-top: 20px;\r\n" + "
\"\r\n"
+ " >\r\n" + "
<tr>\r\n"
+ " <td colspan=\"2\">\r\n"
+ " <div style=\"border: 1px
solid #FFD9CA ; border-radius: 10px; padding: 40px\">\r\n"
+ " <h3\r\n" + "
style=\"\r\n"
+ " color: white;\r\n"
+ " font-size: 30px;\r\n"
+ " margin-bottom: 20px;\r\
n"
+ " margin-top: 0;\r\n" +
"font-weight : 900; \r\n"
+ " \"\r\n" + "
>\r\n"
+ " Key benefits\r\n" + "
</h3>\r\n"
+ " <ul\r\n" + "
style=\"\r\n"
+ " color: white;\r\n"
+ " font-size: 16px;\r\n"
+ " list-style: none;\r\n"
+ " padding: 0;\r\n"
+ " margin-top: 10px;\r\n" +
" \"\r\n"
+ " >\r\n"
+ " <li style=\"padding: 8px
0px; display: flex; align-items: center;\">\r\n"
+ " <span
style=\"background-color: #FFD9CA; border-radius: 20px; width: 18px; height: 18px;
padding: 1px; \r\n"
+ " margin-right: 10px;\r\n"
+ " display: inline-block;\
r\n"
+ " vertical-align: middle;\
r\n"
+ " \">\r\n" + "
<img\r\n"
+ "
src=\"[Link]
%2F81910e9d466548ad8ba5ec0b3038694b\"\r\n"
+ " alt=\"Icon\"\r\n"
+ " style=\"\r\n" + "
\r\n"
+ " width: 18px;\r\n"
+ " \"\r\n" + "
/>\r\n"
+ " </span>\r\n" + "
<p\r\n"
+ " style=\"\r\n"
+ " display: inline;\r\
n"
+ " vertical-align:
middle;\r\n"
+ " font-weight: bold;\
r\n"
+ " margin: 0px;\r\n" +
" \"\r\n"
+ " >\r\n"
+ " Immediate advice from
doctors via WhatsApp 24/7.\r\n"
+ " </p>\r\n" + "
</li>\r\n"
+ " <li style=\"padding: 8px
0px; display: flex; align-items: center;\">\r\n"
+ " <span
style=\"background-color: #FFD9CA; border-radius: 20px; width: 18px; height: 18px;
padding: 1px; \r\n"
+ " margin-right: 10px;\r\n"
+ " display: inline-block;\
r\n"
+ " vertical-align: middle;\
r\n"
+ " \">\r\n" + "
<img\r\n"
+ "
src=\"[Link]
%2F81910e9d466548ad8ba5ec0b3038694b\"\r\n"
+ " alt=\"Icon\"\r\n"
+ " style=\"\r\n" + "
\r\n"
+ " width: 18px;\r\n"
+ " \"\r\n" + "
/>\r\n"
+ " </span>\r\n" + "
<p\r\n"
+ " style=\"\r\n"
+ " display: inline;\r\
n"
+ " vertical-align:
middle;\r\n"
+ " font-weight: bold;\
r\n"
+ " margin: 0px;\r\n" +
" \"\r\n"
+ " >\r\n"
+ " Great Aviva perks like
50% off home insurance.\r\n"
+ " </p>\r\n" + "
</li>\r\n"
+ " <li style=\"padding: 8px
0px; display: flex; align-items: center;\">\r\n"
+ " <span
style=\"background-color: #FFD9CA; border-radius: 20px; width: 18px; height: 18px;
padding: 1px; \r\n"
+ " margin-right: 10px;\r\n"
+ " display: inline-block;\
r\n"
+ " vertical-align: middle;\
r\n"
+ " \">\r\n" + "
<img\r\n"
+ "
src=\"[Link]
%2F81910e9d466548ad8ba5ec0b3038694b\"\r\n"
+ " alt=\"Icon\"\r\n"
+ " style=\"\r\n" + "
\r\n"
+ " width: 18px;\r\n"
+ " \"\r\n" + "
/>\r\n"
+ " </span>\r\n" + "
<p\r\n"
+ " style=\"\r\n"
+ " display: inline;\r\
n"
+ " vertical-align:
middle;\r\n"
+ " font-weight: bold;\
r\n"
+ " margin: 0px;\r\n" +
" \"\r\n"
+ " >\r\n"
+ " Kids under 3 are
free.\r\n"
+ " </p>\r\n" + "
</li>\r\n"
+ " <li style=\"padding: 8px
0px; display: flex; align-items: center;\">\r\n"
+ " <span
style=\"background-color: #FFD9CA; border-radius: 20px; width: 18px; height: 18px;
padding: 1px; \r\n"
+ " margin-right: 10px;\r\n"
+ " display: inline-block;\
r\n"
+ " vertical-align: middle;\
r\n"
+ " \">\r\n" + "
<img\r\n"
+ "
src=\"[Link]
%2F81910e9d466548ad8ba5ec0b3038694b\"\r\n"
+ " alt=\"Icon\"\r\n"
+ " style=\"\r\n" + "
\r\n"
+ " width: 18px;\r\n"
+ " \"\r\n" + "
/>\r\n"
+ " </span>\r\n" + "
<p\r\n"
+ " style=\"\r\n"
+ " display: inline;\r\
n"
+ " vertical-align:
middle;\r\n"
+ " font-weight: bold;\
r\n"
+ " margin: 0px;\r\n" +
" \"\r\n"
+ " >\r\n"
+ " Free travel
insurance.\r\n" + "\r\n"
+ " </p>\r\n" + "
</li>\r\n"
+ " <li style=\"padding: 0px
0px; display: flex; align-items: center;\">\r\n"
+ " <span
style=\"background-color: #FFD9CA; border-radius: 20px; width: 18px; height: 18px;
padding: 1px; \r\n"
+ " margin-right: 10px;\r\n"
+ " display: inline-block;\
r\n"
+ " vertical-align: middle;\
r\n"
+ " \">\r\n" + "
<img\r\n"
+ "
src=\"[Link]
%2F81910e9d466548ad8ba5ec0b3038694b\"\r\n"
+ " alt=\"Icon\"\r\n"
+ " style=\"\r\n" + "
\r\n"
+ " width: 18px;\r\n"
+ " \"\r\n" + "
/>\r\n"
+ " </span>\r\n" + "
<p\r\n"
+ " style=\"\r\n"
+ " display: inline;\r\
n"
+ " vertical-align:
middle;\r\n"
+ " font-weight: bold;\
r\n"
+ " margin: 0px;\r\n" +
" \"\r\n"
+ " >\r\n"
+ " Revolut claims payment
option.\r\n" + "\r\n"
+ " </p>\r\n" + "
</li>\r\n" + "\r\n"
+ "\r\n" + "\r\n" + " </ul>\r\n"
+ " </td>\r\n"
+ " </tr>\r\n" + "
</table>"

+ " <table style=\"margin-top:


20px\">\r\n" + " <tr>\r\n"
+ " <td>\r\n" + "
<p\r\n"
+ " style=\"\r\n" + "
color: #333333;\r\n"
+ " font-size: 16px;\r\n"
+ " line-height: 24px;\r\n"
+ " margin-bottom: 5px;\r\n"
+ " \"\r\n"
+ " >\r\n" + "
We hope to welcome you soon\r\n"
+ " </p>\r\n" + "
<p\r\n"
+ " style=\"\r\n" + "
color: #333333;\r\n"
+ " font-size: 16px;\r\n"
+ " line-height: 24px;\r\n"
+ " margin-top: 0;\r\n"
+ " margin-bottom: 20px;\r\
n"
+ " font-weight: bold;\r\n"
+ " \"\r\n"
+ " >\r\n" + "
All the team at Level Health\r\n"
+ " </p>\r\n" + "
<p\r\n"
+ " style=\"\r\n" + "
color: #999999;\r\n"
+ " font-size: 14px;\r\n"
+ " line-height: 20px;\r\n"
+ " margin: 0;\r\n" + "
\"\r\n"
+ " >\r\n"
+ " The information in this
email and any attachments\r\n"
+ " is confidential and
intended only for the\r\n"
+ " designated recipient(s).
Any review, forwarding,\r\n"
+ " distribution, or other use
of this information by\r\n"
+ " anyone other than the
intended recipient is\r\n"
+ " strictly prohibited. If
you have received this\r\n"
+ " email in error, please
notify us immediately and\r\n"
+ " delete all copies from
your system(s). Any views\r\n"
+ " expressed in this message
are those of the\r\n"
+ " individual sender, unless
specifically stated as\r\n"
+ " being on behalf of Level
Health.<br /><br />\r\n"
+ " This quote
is only valid on the day it is issued.<br /><br />\r\n"
+ " The price
includes tax relief at the standard rate and any applicable discounts or\r\n"
+ " loadings. The
price shown is based on the information you provided to us. The price\r\n"
+ " may change if
information you provide changes. Terms and conditions apply.<br /><br />\r\n"
+ " Level Health Limited
trading as Level Health is\r\n"
+ " regulated by the Central
Bank of Ireland. Health\r\n"
+ " insurance products
provided by Level Health\r\n"
+ " Limited are underwritten
by Aviva Insurance\r\n"
+ " Ireland DAC. Aviva
Insurance Ireland DAC, trading\r\n"
+ " as Aviva, is regulated by
the Central Bank of\r\n"
+ " Ireland.<br /><br />\r\n"
+ " Level Health Limited is
registered in Ireland No.\r\n"
+ " 740317. Registered Office:
PO Box 13758,\r\n"
+ " Ravensdale Road. Dublin 3.
Directors: J. Dowdall,\r\n"
+ " S. Loughman, O. Tattan, D.
O'Rourke, S. McCarthy,\r\n"
+ " B. Cudmore, L.J.
O'Shea.<br /><br />\r\n"
+ " <a\r\n" + "
href="
+ [Link](ApplicationConstant.ENV_URL) + "/privacy-
policy" + "\r\n"
+ " style=\"\r\n"
+ " color: #999999;\r\n"
+ " text-decoration:
underline;\r\n"
+ " \"\r\n"
+ " >Privacy policy</a\r\n"
+ " >\r\n "
// + "<a\r\n" + " href="
// + [Link]("[Link]") + "/data-protection" + "\r\n"
// + " style=\"\r\n"
// + " color: #999999;\r\n"
// + " text-decoration:
underline;\r\n"
// + " \"\r\n" + "
>data protection</a\r\n"
// + " >" + "
"
+ "<a\r\n" + " href=" +
[Link]("[Link]")
+ "/terms-of-business" + "\r\n" + "
style=\"\r\n"
+ " color: #999999;\r\n"
+ " text-decoration:
underline;\r\n"
+ " display: block;\r\n" +
" \"\r\n"
+ " >Terms of Business</a\r\
n" + " >\r\n"
+ " </p>\r\n" + "
</td>\r\n"
+ " </tr>\r\n" + "
</table>\r\n"
+ " </td>\r\n" + "
</tr>\r\n"
+ " <!-- Footer -->\r\n" + "
<tr>\r\n"
+ " <td align=\"center\"
style=\"padding: 10px\">\r\n"
+ " <div\r\n" + "
style=\"\r\n"
+ " margin-top: 20px;\r\n" + "
padding-top: 20px;\r\n"
+ " border-top: 1px solid
#b2b2b2;\r\n" + " \"\r\n"
+ " >\r\n" + "
<a\r\n"
+ " href=" +
"[Link] + "\r\n"
+ " >"
+ "<img
src=\"[Link] "
+ " style=\"height: 32px; min-
width: 32px; width: 32px; margin-right: 8px\"\r\n"

+ "></a>\r\n"
+ " <a
href="+"[Link] style=\"text-decoration:
none\"\r\n"
+ " ><img\r\n"
+ "
src=\"[Link]
+ " alt=\"Youtube\"\r\n"
+ " style=\"height: 32px; min-
width: 32px; width: 32px; margin-right: 8px\"\r\n"
+ " /></a>\r\n"
+ " <a
href="+"[Link] style=\"text-decoration:
none\"\r\n"
+ " ><img\r\n"
+ "
src=\"[Link]
+ " alt=\"Instagram\"\r\n"
+ " style=\"height: 32px; min-
width: 32px; width: 32px; margin-right: 8px\"\r\n"
+ " /></a>\r\n"
+ " <a
href="+"[Link] style=\"text-decoration:
none\"\r\n"
+ " ><img\r\n"
+ "
src=\"[Link]
+ " alt=\"LinkedIn\"\r\n"
+ " style=\"height: 32px; min-
width: 32px; width: 32px; margin-right: 8px\"\r\n"
+ " /></a>\r\n" + "
</div>\r\n"
+ " <img\r\n"
+ "
src=\"[Link]
%2Fe15634eac86f4f059f42b9cdb1f7eb1d\"\r\n"
+ " alt=\"Level Health logo\"\r\n"
+ " style=\"width: 100px; margin-
top: 20px; display: block\"\r\n"
+ " />\r\n" + "
<img\r\n"
+ "
src=\"[Link]
%2F105f4d48b8cd47aea161a6e337e267b5\"\r\n"
+ " alt=\"Aviva logo\"\r\n"
+ " style=\"width: 60px; margin-top:
20px; display: block\"\r\n"
+ " />\r\n" + "
<p\r\n"
+ " style=\"\r\n" + "
color: #999999;\r\n"
+ " font-size: 12px;\r\n" + "
text-align: center;\r\n"
+ " margin-top: 30px;\r\n" + "
\"\r\n"
+ " >\r\n"
+ " Copyright &#169; 2024
Levelhealth Insurance.\r\n"
+ " </p>\r\n" + "
</td>\r\n" + " </tr>\r\n"
+ " </table>\r\n" + " </td>\r\
n" + " </tr>\r\n"
+ " </table>\r\n" + " </td>\r\n" + "
</tr>\r\n" + " </table>\r\n"
+ " </body>\r\n" + "</html>\r\n";

return head + getWhoIsCoverted(list, primaryFirstName, age) +


constantTail;
}

private String getWhoIsCoverted(List<QuotePerson> list, String


primaryFirstName, int age) {
StringBuilder build = new StringBuilder();
AtomicInteger adultCounter = new AtomicInteger(2);
AtomicInteger childCounter = new AtomicInteger(1);

[Link](" <tr>\r\n" + " <td\r\n" + "


colspan=\"2\"\r\n"
+ " style=\"\r\n" + "
padding-top: 10px;\r\n"
+ " border-top: 1px solid
#d1d1d1;\r\n"
+ " \"\r\n" + "
>\r\n"
+ " <h4\r\n" + "
style=\"\r\n"
+ " color: #191919;\r\n"
+ " font-size: 18px;\r\n"
+ " font-weight: bold;\r\n"
+ " margin: 0;\r\n" + "
\"\r\n"
+ " >\r\n" + "
Who's covered\r\n"
+ " </h4>\r\n" + "
<ul\r\n"
+ " style=\"\r\n" + "
color: #191919;\r\n"
+ " font-size: 16px;\r\n"
+ " list-style: none;\r\n"
+ " padding: 0;\r\n"
+ " margin-top: 10px;\r\n" +
" \"\r\n"
+ " >" + "<li style=\"margin-
bottom: 10px\">\r\n"
+ " <img\r\n"
+ "
src=\"[Link]
%2F291ffc19d2a242a888f2340704d6af25\"\r\n"
+ " alt=\"Person\"\r\n"
+ " style=\"\r\n"
+ " vertical-align:
middle;\r\n"
+ " margin-right: 10px;\
r\n"
+ " display: inline;\r\
n"
+ " \"\r\n" + "
/>\r\n"
+ " <p\r\n" + "
style=\"\r\n"
+ " margin: 0;\r\n"
+ " display: inline;\r\
n"
+ " vertical-align:
middle;\r\n"
+ " \"\r\n" + "
>\r\n"
+ " " + primaryFirstName +
" (" + age + ")\r\n"
// + " Policyholder
("+age+")\r\n"
+ " </p>\r\n" + "
</li>");

for (int i = 1; i < [Link](); i++) {


QuotePerson person = [Link](i);
String dobString = [Link]();
Date dob = null;
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
dob = [Link](dobString);
} catch (ParseException e) {
[Link](" Exception " + [Link]()); // Handle
exception
}

[Link] dobLocalDate =
[Link]().atZone([Link]()).toLocalDate();
[Link] currentDate = [Link]();
int ageOfDependant = [Link](dobLocalDate,
currentDate).getYears();

String displayName = [Link]();


if (displayName == null || [Link]().isEmpty()) {
if (ageOfDependant >= 18) {
displayName = "Adult " +
[Link]();
} else {
displayName = "Child " +
[Link]();
}
}

[Link](" <li style=\"margin-bottom: 10px\">\r\n" + "


<img\r\n"
+ "
src=\"[Link]
%2F291ffc19d2a242a888f2340704d6af25\"\r\n"
+ " alt=\"Person\"\r\n" + " style=\"\r\n" +
" vertical-align: middle;\r\n"
+ " margin-right: 10px;\r\n" + "
display: inline;\r\n" + " \"\r\n" + " />\r\n"
+ " <p\r\n" + " style=\"\r\n" + "
margin: 0;\r\n" + " display: inline;\r\n"
+ " vertical-align: middle;\r\n" + " \"\
r\n" + " >\r\n" + " " + displayName
+ " (" + ageOfDependant + ")\r\n" + " </p>\r\n" +
" </li>");
}

// [Link](person -> {
// String dobString = [Link]();
// Date dob =null;
// try {
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// dob = [Link](dobString);
// } catch (ParseException e) {
// [Link](" Exception " + [Link]());; // Handle
exception
// }
// [Link] dobLocalDate =
[Link]().atZone([Link]()).toLocalDate();
// [Link] currentDate = [Link]();
// int ageOfDependant = [Link](dobLocalDate,
currentDate).getYears();
// String displayName = [Link]();
// if (displayName == null || [Link]().isEmpty()) {
// if (ageOfDependant >= 18) {
// displayName = "Adult " + [Link]();
// } else {
// displayName = "Child " + [Link]();
// }
// }
// [Link](" <li style=\"margin-bottom: 10px\">\r\n" +
// " <img\r\n" +
// "
src=\"[Link]
%2F291ffc19d2a242a888f2340704d6af25\"\r\n" +
// " alt=\"Person\"\r\n" +
// " style=\"\r\n" +
// " vertical-align: middle;\r\n" +
// " margin-right: 10px;\r\n" +
// " display: inline;\r\n" +
// " \"\r\n" +
// " />\r\n" +
// " <p\r\n" +
// " style=\"\r\n" +
// " margin: 0;\r\n" +
// " display: inline;\r\n" +
// " vertical-align: middle;\r\n" +
// " \"\r\n" +
// " >\r\n" +
// " " + displayName + " (" + ageOfDependant + ")\r\
n" +
// " </p>\r\n" +
// " </li>");
// });

[Link](" </table>\r\n" + " </td>\r\n" + "


</tr>");
return [Link]();
}

private String getFeatures(CategoryBullet categoryBullet) {


StringBuilder build = new StringBuilder();

if (![Link](categoryBullet.getBullet1())) {
setFeatures(categoryBullet.getBullet1(), build);
}
if (![Link](categoryBullet.getBullet2())) {
setFeatures(categoryBullet.getBullet2(), build);
}
if (![Link](categoryBullet.getBullet3())) {
setFeatures(categoryBullet.getBullet3(), build);
}
if (![Link](categoryBullet.getBullet4())) {
setFeatures(categoryBullet.getBullet4(), build);
}
if (![Link](categoryBullet.getBullet5())) {
setFeatures(categoryBullet.getBullet5(), build);
}

return [Link]();
}

private void setFeatures(String bullet, StringBuilder build) {


String features = "<div style=\"display: flex; align-items: center;
margin-bottom: 10px;\">\r\n" + " <img\r\n"
+ " src=\"[Link]
%2Fbf5aeb09845647e5a8182770c0ca0fdc%2F801cbc4ea7fd40bc831a9bfff6064b1b\"\r\n"
+ " alt=\"Icon\"\r\n" + " style=\"\r\n" + "
vertical-align: middle;\r\n"
+ " margin-right: 10px;\r\n" + " display: inline-
block;\r\n"
+ " width: 24px; height: 24px;\"\r\n" + " />\r\n"
+ " <span style=\"margin: 0; font-size: 16px; line-height:
1.5;\">" + bullet + "</span>\r\n"
+ "</div>\r\n";
[Link](features);
}

You might also like