Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(BE:FSADT1-794): updating content #494

Merged
merged 12 commits into from
Jun 14, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,26 @@
import java.util.Map;
import org.apache.commons.lang3.StringUtils;

public record ClientBusinessInformationDto(String incorporationNumber, String businessName,
String businessType, String clientType, String goodStanding, String legalType) {
public record ClientBusinessInformationDto(
String incorporationNumber,
String businessName,
String businessType,
String clientType,
String goodStanding,
String legalType) {
/**
* Returns a map containing the description of the client's business information.
*
* @return a map with keys representing the description fields and corresponding values
*/
public Map<String, Object> description() {
return Map.of(
"incorporation", StringUtils.isBlank(incorporationNumber) ? "" : incorporationNumber,
"name", StringUtils.isBlank(businessName) ? "" : businessName,
"businessType", StringUtils.isBlank(businessType) ? "" : businessType,
"clientType", StringUtils.isBlank(clientType) ? "" : clientType,
"legalType", StringUtils.isBlank(legalType) ? "" : legalType,
"goodStanding", StringUtils.isBlank(goodStanding) ? "" : goodStanding
"goodStanding", StringUtils.isBlank(goodStanding) ? "" : goodStanding,
"legalType", StringUtils.isBlank(legalType) ? "" : legalType
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
public record ClientSubmissionDto(
ClientBusinessInformationDto businessInformation,
ClientLocationDto location) {
/**
* Returns a map containing the description of the client's business information.
*
* @return a map with keys representing the description fields and corresponding values
*/
public Map<String, Object> description(String userName) {
Map<String, Object> descriptions = location.description();
descriptions.put("business", businessInformation.description());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,18 +166,23 @@ public Mono<Integer> submit(
.location()
.contacts()
)
/*.flatMap(contact -> saveAndAssociateContact(locations, contact,
submission.getSubmissionId()))*/
/*.flatMap(contact -> saveAndAssociateContact(
locations,
contact,
submission.getSubmissionId()))*/
)
//Then grab all back as a list, to make all reactive flows complete
.collectList()
//Return what we need only
.thenReturn(submission.getSubmissionId())
)
.flatMap(submissionId -> sendEmail(submissionId, clientSubmissionDto, userEmail, userName));
.flatMap(submissionId -> sendEmail(submissionId,
clientSubmissionDto,
userEmail,
userName));
}

private Mono<SubmissionLocationContactEntity> saveAndAssociateContact(
/*private Mono<SubmissionLocationContactEntity> saveAndAssociateContact(
List<SubmissionLocationEntity> locations,
ClientContactDto contact,
Integer submissionId
Expand All @@ -192,7 +197,7 @@ private Mono<SubmissionLocationContactEntity> saveAndAssociateContact(
.build()
)
.flatMap(submissionLocationContactRepository::save);
}
}*/

private Mono<List<SubmissionLocationEntity>> saveAddresses(
ClientSubmissionDto clientSubmissionDto,
Expand Down
14 changes: 11 additions & 3 deletions backend/src/main/resources/templates/matched.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,29 @@
<p>
Dear <b>${userName}</b>,
</p>
<br />
<div>&nbsp;</div>

<p>
Your application for a client number can't go ahead because <b>${name}</b>
already has one.
</p>
<p>The number is ${number}. Be sure to keep it for your records.</p>
<br />
<div>&nbsp;</div>

<p>
If you need to contact us, email <a
href="mailto:[email protected]">[email protected].</a>
</p>
<br />
<div>&nbsp;</div>

<p>Thank you,</p>
<p>The CLIENT Team</p>
<div>&nbsp;</div>

<p>
<b>Please don’t respond to this email.</b>
It’s from an account that’s not monitored for incoming emails.
</p>
</div>

</body>
Expand Down
14 changes: 11 additions & 3 deletions backend/src/main/resources/templates/registration.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,29 @@
<p>
Dear <b>${userName}</b>,
</p>
<br />
<div>&nbsp;</div>

<p>
We’ve received your application for a client number for <b>${business.name}</b>.
</p>
<p>We’ll email your client number once we confirm the information
you provided.</p>
<br />
<div>&nbsp;</div>

<p>
If you need to contact us before then, email <a
href="mailto:[email protected]">[email protected].</a>
</p>
<br />
<div>&nbsp;</div>

<p>Thank you,</p>
<p>The CLIENT Team</p>
<div>&nbsp;</div>

<p>
<b>Please don’t respond to this email.</b>
It’s from an account that’s not monitored for incoming emails.
</p>
</div>

</body>
Expand Down