Skip to content

Commit

Permalink
FSADT1-1116 and FSADT1-1124
Browse files Browse the repository at this point in the history
  • Loading branch information
mamartinezmejia committed Jan 11, 2024
1 parent 193de1d commit 9b48778
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 19 deletions.
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);
5 changes: 2 additions & 3 deletions backend/src/main/resources/templates/rejection.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
<div>&nbsp;</div>

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

<p>
Expand Down

0 comments on commit 9b48778

Please sign in to comment.