diff --git a/backend/src/main/java/ca/bc/gov/app/service/client/ClientSubmissionService.java b/backend/src/main/java/ca/bc/gov/app/service/client/ClientSubmissionService.java index f1ea6f5bd9..af03f9747c 100644 --- a/backend/src/main/java/ca/bc/gov/app/service/client/ClientSubmissionService.java +++ b/backend/src/main/java/ca/bc/gov/app/service/client/ClientSubmissionService.java @@ -451,22 +451,39 @@ private Flux 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 = "
 
"; + List 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("

Log into your BC Registries

") + .append(htmlBlankDiv) + .append("

Log into your BC Registries ") + .append("account to find out why.

"); + } + + 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("

Also, this business is not in good standing with BC Registries.

") + .append(htmlBlankDiv) + .append("

Log into your BC Registries ") + .append("account to find out why.

"); + } return stringBuilder.toString(); } diff --git a/backend/src/main/resources/db/migration/V4_submission_matching_detail_size.sql b/backend/src/main/resources/db/migration/V4_submission_matching_detail_size.sql new file mode 100644 index 0000000000..dbbfb3b319 --- /dev/null +++ b/backend/src/main/resources/db/migration/V4_submission_matching_detail_size.sql @@ -0,0 +1,2 @@ +ALTER TABLE nrfc.submission_matching_detail +ALTER COLUMN confirmed_match_message TYPE varchar(1000); diff --git a/backend/src/main/resources/templates/rejection.html b/backend/src/main/resources/templates/rejection.html index 6f0fda40b5..c37c13c949 100644 --- a/backend/src/main/resources/templates/rejection.html +++ b/backend/src/main/resources/templates/rejection.html @@ -18,10 +18,9 @@
 

- Your application for a client number can't go ahead because ${business.name} - already has one. + Your application for a client number can't go ahead because ${name} + ${reason}

-

The number is ${number}. Be sure to keep it for your records.