Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -451,22 +451,39 @@ private Flux<SubmissionEntity> loadSubmissions(int page, int size, String[] requ
private String processRejectionReason(SubmissionApproveRejectDto request) {

StringBuilder stringBuilder = new StringBuilder();

request
.reasons()
.forEach(reason -> {
if (reason.equalsIgnoreCase("duplicated")) {
stringBuilder.append(
"A client that matches your submission already exists with number: ")
.append(request.message())
.append("< /br>");
}
if (reason.equalsIgnoreCase("goodstanding")) {
stringBuilder.append("Client is not in good standing with BC Registries")
.append("< /br>");
}

});
String duplicatedReason = "duplicated";
String goodStandingReason = "goodstanding";
String htmlBlankDiv = "<div>&nbsp;</div>";
List<String> reasons = request.reasons();

if (reasons.contains(duplicatedReason) && !reasons.contains(goodStandingReason)) {
stringBuilder
.append(" already has one. The number is: ")
.append(request.message())
.append(". Be sure to keep it for your records.");
}

if (!reasons.contains(duplicatedReason) && reasons.contains(goodStandingReason)) {
stringBuilder
.append(" is not in good standing with BC Registries.")
.append(htmlBlankDiv)
.append("<p>Log into your <a href=\"https://www.bcregistry.gov.bc.ca/\">BC Registries</a></p>")
.append(htmlBlankDiv)
.append("<p>Log into your <a href=\"https://www.bcregistry.gov.bc.ca/\">BC Registries</a> ")
.append("account to find out why.</p>");
}

if (reasons.contains(duplicatedReason) && reasons.contains(goodStandingReason)) {
stringBuilder
.append(" already has one. The number is: ")
.append(request.message())
.append(". Be sure to keep it for your records.")
.append(htmlBlankDiv)
.append("<p>Also, this business is not in good standing with BC Registries.</p>")
.append(htmlBlankDiv)
.append("<p>Log into your <a href=\"https://www.bcregistry.gov.bc.ca/\">BC Registries</a> ")
.append("account to find out why.</p>");
}

return stringBuilder.toString();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE nrfc.submission_matching_detail
ALTER COLUMN confirmed_match_message TYPE varchar(1000);
2 changes: 1 addition & 1 deletion backend/src/main/resources/templates/approval.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<#include "emailLogo.html">

<p>
Client Admin,
Dear <b>${userName}</b>,
</p>
<div>&nbsp;</div>

Expand Down
3 changes: 1 addition & 2 deletions backend/src/main/resources/templates/rejection.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@

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

<p>
Expand Down