From ad31d621605535277bf34fcafc2bcfc25db4930d Mon Sep 17 00:00:00 2001
From: Maria Martinez
Date: Thu, 27 Jun 2024 15:17:19 -0700
Subject: [PATCH 1/2] feat(be:FSADT1-1324): Changes in email templates
---
.../client/ClientSubmissionService.java | 48 ++++++--
.../main/resources/templates/approval.html | 6 +
.../resources/templates/registration.html | 4 +-
.../main/resources/templates/rejection.html | 4 +-
.../resources/db/migration/R__Test_Data.sql | 69 ++++++-----
frontend/components.d.ts | 2 +-
frontend/package-lock.json | 111 +-----------------
.../ClientSubmissionLoadingService.java | 22 +++-
8 files changed, 105 insertions(+), 161 deletions(-)
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 9156843cf9..7dab8a2d38 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
@@ -11,6 +11,7 @@
import ca.bc.gov.app.dto.client.ClientContactDto;
import ca.bc.gov.app.dto.client.ClientListSubmissionDto;
import ca.bc.gov.app.dto.client.ClientSubmissionDto;
+import ca.bc.gov.app.dto.client.DistrictDto;
import ca.bc.gov.app.dto.submissions.SubmissionAddressDto;
import ca.bc.gov.app.dto.submissions.SubmissionApproveRejectDto;
import ca.bc.gov.app.dto.submissions.SubmissionBusinessDto;
@@ -42,6 +43,7 @@
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
@@ -145,8 +147,15 @@ private Mono getDistrictFullDescByCode(String districtCode) {
+ districtCodeEntity.getDescription())
.defaultIfEmpty("");
}
-
-
+
+ private Mono getDistrictByCode(String districtCode) {
+ return Mono.justOrEmpty(districtCode).flatMap(districtCodeRepository::findByCode)
+ .map(districtCodeEntity -> new DistrictDto(
+ districtCodeEntity.getCode(),
+ districtCodeEntity.getDescription(),
+ districtCodeEntity.getEmailAddress()));
+ }
+
/**
* Submits a new client submission and returns a Mono of the submission ID.
*
@@ -445,15 +454,34 @@ private Mono sendEmail(
String email,
String userName
) {
- return chesService.sendEmail(
- "registration",
- email,
- "Client number application received",
- clientSubmissionDto.description(userName),
- null)
- .thenReturn(submissionId);
+ return getDistrictByCode(clientSubmissionDto.businessInformation().district())
+ .flatMap(district -> {
+ Map params = registrationParameters(
+ clientSubmissionDto.description(userName),
+ district.description(),
+ district.emails()
+ );
+ return chesService.sendEmail(
+ "registration",
+ email,
+ "Client number application received",
+ params,
+ null)
+ .thenReturn(submissionId);
+ });
+ }
+
+ private Map registrationParameters(
+ Map clientSubmission,
+ String districtName,
+ String districtEmail
+ ) {
+ Map descMap = new HashMap<>();
+ descMap.putAll(clientSubmission);
+ descMap.put("districtName", StringUtils.defaultString(districtName));
+ descMap.put("districtEmail", StringUtils.defaultString(districtEmail));
+ return descMap;
}
-
private Mono
+
+
+ If you need to contact us before then please contact the ${business.districtName}
+ ${business.districtEmail}.
+
+
Thank you,
The Forests Client Management System
diff --git a/backend/src/main/resources/templates/registration.html b/backend/src/main/resources/templates/registration.html
index 97afc6d3e4..1beb9a68bd 100644
--- a/backend/src/main/resources/templates/registration.html
+++ b/backend/src/main/resources/templates/registration.html
@@ -30,8 +30,8 @@
- If you need to contact us before then, email FORHVAP.CLIADMIN@gov.bc.ca.
+ If you need to contact us before then please contact the ${districtName}
+ ${districtEmail}.
diff --git a/backend/src/main/resources/templates/rejection.html b/backend/src/main/resources/templates/rejection.html
index 1d0e8ca100..37c9a0ea8f 100644
--- a/backend/src/main/resources/templates/rejection.html
+++ b/backend/src/main/resources/templates/rejection.html
@@ -24,8 +24,8 @@
- If you need to contact us, email FORHVAP.CLIADMIN@gov.bc.ca.
+ If you need to contact us before then please contact the ${business.districtName}
+ ${business.districtEmail}.
diff --git a/backend/src/test/resources/db/migration/R__Test_Data.sql b/backend/src/test/resources/db/migration/R__Test_Data.sql
index 0331dd3b9a..f7bc6126a4 100644
--- a/backend/src/test/resources/db/migration/R__Test_Data.sql
+++ b/backend/src/test/resources/db/migration/R__Test_Data.sql
@@ -1,39 +1,48 @@
-insert into nrfc.submission_status_code (submission_status_code, description, effective_date, create_user) values ('P', 'In Progress', current_timestamp, 'mariamar') ON CONFLICT (submission_status_code) DO NOTHING;
-insert into nrfc.submission_status_code (submission_status_code, description, effective_date, create_user) values ('A', 'Approved', current_timestamp, 'mariamar') ON CONFLICT (submission_status_code) DO NOTHING;
-insert into nrfc.submission_status_code (submission_status_code, description, effective_date, create_user) values ('R', 'Rejected', current_timestamp, 'mariamar') ON CONFLICT (submission_status_code) DO NOTHING;
-insert into nrfc.submission_status_code (submission_status_code, description, effective_date, create_user) values ('D', 'Deleted', current_timestamp, 'mariamar') ON CONFLICT (submission_status_code) DO NOTHING;
-insert into nrfc.submission_status_code (submission_status_code, description, effective_date, create_user) values ('S', 'Submitted', current_timestamp, 'mariamar') ON CONFLICT (submission_status_code) DO NOTHING;
+insert into nrfc.submission_status_code (submission_status_code, description, effective_date, create_user) values ('P', 'In Progress', current_timestamp, 'mariamar') on conflict (submission_status_code) do nothing;
+insert into nrfc.submission_status_code (submission_status_code, description, effective_date, create_user) values ('A', 'Approved', current_timestamp, 'mariamar') on conflict (submission_status_code) do nothing;
+insert into nrfc.submission_status_code (submission_status_code, description, effective_date, create_user) values ('R', 'Rejected', current_timestamp, 'mariamar') on conflict (submission_status_code) do nothing;
+insert into nrfc.submission_status_code (submission_status_code, description, effective_date, create_user) values ('D', 'Deleted', current_timestamp, 'mariamar') on conflict (submission_status_code) do nothing;
+insert into nrfc.submission_status_code (submission_status_code, description, effective_date, create_user) values ('S', 'Submitted', current_timestamp, 'mariamar') on conflict (submission_status_code) do nothing;
-insert into nrfc.client_type_code (client_type_code, description, effective_date, create_user) values ('A', 'Association', current_timestamp, 'mariamar') ON CONFLICT (client_type_code) DO NOTHING;
-insert into nrfc.client_type_code (client_type_code, description, effective_date, create_user) values ('B', 'First Nation Band', current_timestamp, 'mariamar') ON CONFLICT (client_type_code) DO NOTHING;
-insert into nrfc.client_type_code (client_type_code, description, effective_date, create_user) values ('C', 'Corporation', current_timestamp, 'mariamar') ON CONFLICT (client_type_code) DO NOTHING;
-insert into nrfc.client_type_code (client_type_code, description, effective_date, create_user) values ('F', 'Ministry of Forests and Range', current_timestamp, 'mariamar') ON CONFLICT (client_type_code) DO NOTHING;
-insert into nrfc.client_type_code (client_type_code, description, effective_date, create_user) values ('G', 'Government', current_timestamp, 'mariamar') ON CONFLICT (client_type_code) DO NOTHING;
-insert into nrfc.client_type_code (client_type_code, description, effective_date, create_user) values ('I', 'Individual', current_timestamp, 'mariamar') ON CONFLICT (client_type_code) DO NOTHING;
-insert into nrfc.client_type_code (client_type_code, description, effective_date, create_user) values ('L', 'Limited Partnership', current_timestamp, 'mariamar') ON CONFLICT (client_type_code) DO NOTHING;
-insert into nrfc.client_type_code (client_type_code, description, effective_date, create_user) values ('P', 'General Partnership', current_timestamp, 'mariamar') ON CONFLICT (client_type_code) DO NOTHING;
-insert into nrfc.client_type_code (client_type_code, description, effective_date, create_user) values ('R', 'First Nation Group', current_timestamp, 'mariamar') ON CONFLICT (client_type_code) DO NOTHING;
-insert into nrfc.client_type_code (client_type_code, description, effective_date, create_user) values ('S', 'Society', current_timestamp, 'mariamar') ON CONFLICT (client_type_code) DO NOTHING;
-insert into nrfc.client_type_code (client_type_code, description, effective_date, create_user) values ('T', 'First Nation Tribal Council', current_timestamp, 'mariamar') ON CONFLICT (client_type_code) DO NOTHING;
-insert into nrfc.client_type_code (client_type_code, description, effective_date, create_user) values ('U', 'Unregistered Company', current_timestamp, 'mariamar') ON CONFLICT (client_type_code) DO NOTHING;
+insert into nrfc.client_type_code (client_type_code, description, effective_date, create_user) values ('A', 'Association', current_timestamp, 'mariamar') on conflict (client_type_code) do nothing;
+insert into nrfc.client_type_code (client_type_code, description, effective_date, create_user) values ('B', 'First Nation Band', current_timestamp, 'mariamar') on conflict (client_type_code) do nothing;
+insert into nrfc.client_type_code (client_type_code, description, effective_date, create_user) values ('C', 'Corporation', current_timestamp, 'mariamar') on conflict (client_type_code) do nothing;
+insert into nrfc.client_type_code (client_type_code, description, effective_date, create_user) values ('F', 'Ministry of Forests and Range', current_timestamp, 'mariamar') on conflict (client_type_code) do nothing;
+insert into nrfc.client_type_code (client_type_code, description, effective_date, create_user) values ('G', 'Government', current_timestamp, 'mariamar') on conflict (client_type_code) do nothing;
+insert into nrfc.client_type_code (client_type_code, description, effective_date, create_user) values ('I', 'Individual', current_timestamp, 'mariamar') on conflict (client_type_code) do nothing;
+insert into nrfc.client_type_code (client_type_code, description, effective_date, create_user) values ('L', 'Limited Partnership', current_timestamp, 'mariamar') on conflict (client_type_code) do nothing;
+insert into nrfc.client_type_code (client_type_code, description, effective_date, create_user) values ('P', 'General Partnership', current_timestamp, 'mariamar') on conflict (client_type_code) do nothing;
+insert into nrfc.client_type_code (client_type_code, description, effective_date, create_user) values ('R', 'First Nation Group', current_timestamp, 'mariamar') on conflict (client_type_code) do nothing;
+insert into nrfc.client_type_code (client_type_code, description, effective_date, create_user) values ('S', 'Society', current_timestamp, 'mariamar') on conflict (client_type_code) do nothing;
+insert into nrfc.client_type_code (client_type_code, description, effective_date, create_user) values ('T', 'First Nation Tribal Council', current_timestamp, 'mariamar') on conflict (client_type_code) do nothing;
+insert into nrfc.client_type_code (client_type_code, description, effective_date, create_user) values ('U', 'Unregistered Company', current_timestamp, 'mariamar') on conflict (client_type_code) do nothing;
update nrfc.client_type_code set effective_date = '1970-01-01 00:00:00.000';
-- Test case data Review new client submission
-INSERT INTO nrfc.submission VALUES (365, 'R', 'RNC', current_timestamp, current_timestamp, 'BCEIDBUSINESS\\UAT', ' BCEIDBUSINESS\\UAT') ON CONFLICT DO NOTHING;
-INSERT INTO nrfc.submission_contact VALUES (365, 365, 'DI', 'Load', 'NRS', '(777) 777-7777', 'uattestingmail@uat.testing.lo', 'BCEIDBUSINESS\\UAT') ON CONFLICT DO NOTHING;
-INSERT INTO nrfc.submission_detail VALUES (365, 365, NULL, 'R', 'BC0000006', 'HYPERION CORP', 'C', 'Y', NULL, 'DCR') ON CONFLICT DO NOTHING;
-INSERT INTO nrfc.submission_location VALUES (365, 365, '712 Canyon View Dr', 'US', 'KS', 'Lansing', '66043-6271', 'Mailing address') ON CONFLICT DO NOTHING;
-INSERT INTO nrfc.submission_location_contact_xref VALUES (365, 365) ON CONFLICT DO NOTHING;
-INSERT INTO nrfc.submission_matching_detail VALUES (365, 365, '{"contact": "00000000,00000000,00000001,00000001,00000001", "registrationNumber": "00000002,00000002"}', 'N', ' already has one. The number is: tyututu. Be sure to keep it for your records.', '2024-04-16 16:00:06.678395', 'idir\\ottomated', true) ON CONFLICT DO NOTHING;
+insert into nrfc.submission values (365, 'R', 'RNC', current_timestamp, current_timestamp, 'BCEIDBUSINESS\\UAT', ' BCEIDBUSINESS\\UAT') on conflict do nothing;
+insert into nrfc.submission_contact
+ (submission_contact_id, submission_id, contact_type_code, first_name, last_name, business_phone_number, email_address, idp_user_id) values
+ (365, 365, 'DI', 'Load', 'NRS', '(777) 777-7777', 'uattestingmail@uat.testing.lo', 'BCEIDBUSINESS\\UAT') on conflict do nothing;
+insert into nrfc.submission_detail values (365, 365, NULL, 'R', 'BC0000006', 'HYPERION CORP', 'C', 'Y', NULL, 'DCR') on conflict do nothing;
+insert into nrfc.submission_location
+ (submission_location_id, submission_id, street_address, country_code, province_code, city_name, postal_code, location_name) values
+ (365, 365, '712 Canyon View Dr', 'US', 'KS', 'Lansing', '66043-6271', 'Mailing address') on conflict do nothing;
+insert into nrfc.submission_location_contact_xref values (365, 365) on conflict do nothing;
+insert into nrfc.submission_matching_detail values (365, 365, '{"contact": "00000000,00000000,00000001,00000001,00000001", "registrationNumber": "00000002,00000002"}', 'N', ' already has one. The number is: tyututu. Be sure to keep it for your records.', '2024-04-16 16:00:06.678395', 'idir\\ottomated', true) on conflict do nothing;
-- Test case data Staff submitted data - Individual
-INSERT INTO nrfc.submission VALUES (364, 'A', 'SSD', current_timestamp, current_timestamp, 'BCEIDBUSINESS\\UAT', ' BCEIDBUSINESS\\UAT') ON CONFLICT DO NOTHING;
-INSERT INTO nrfc.submission_contact VALUES (364, 364, 'DI', 'Jhon', 'Wick', '(999) 888-7766', 'jhonwick@uat.testing.lo', 'BCEIDBUSINESS\\UAT') ON CONFLICT DO NOTHING;
-INSERT INTO nrfc.submission_detail (submission_detail_id, submission_id, client_number, business_type_code, incorporation_number, organization_name, client_type_code, good_standing_ind, birthdate, district_code, work_safe_bc_number, doing_business_as, client_acronym, first_name, middle_name, last_name, notes, identification_type_code, client_identification, identification_country_code, identification_province_code)
-VALUES (364, 364, NULL, 'U', NULL, 'ROLAND SOLDIER', 'I', 'Y', '1972-12-04', 'DCR', NULL, NULL, NULL,'ROLAND', NULL,'SOLDIER','GOOD AT SUPPORT','CDDL','9999911','CA','BC') ON CONFLICT DO NOTHING;
-INSERT INTO nrfc.submission_location VALUES (364, 364, '999 Canyon View Dr', 'US', 'CO', 'Denver', '66043-6271', 'Mailing address') ON CONFLICT DO NOTHING;
-INSERT INTO nrfc.submission_location_contact_xref VALUES (364, 364) ON CONFLICT DO NOTHING;
-INSERT INTO nrfc.submission_matching_detail VALUES (364, 364, '{}', 'N', NULL, '2024-04-16 16:00:06.678395', 'idir\\ottomated', true) ON CONFLICT DO NOTHING;
+insert into nrfc.submission values (364, 'A', 'SSD', current_timestamp, current_timestamp, 'BCEIDBUSINESS\\UAT', ' BCEIDBUSINESS\\UAT') on conflict do nothing;
+insert into nrfc.submission_contact
+ (submission_contact_id, submission_id, contact_type_code, first_name, last_name, business_phone_number, email_address, idp_user_id) values
+ (364, 364, 'DI', 'Jhon', 'Wick', '(999) 888-7766', 'jhonwick@uat.testing.lo', 'BCEIDBUSINESS\\UAT') on conflict do nothing;
+insert into nrfc.submission_detail
+ (submission_detail_id, submission_id, client_number, business_type_code, incorporation_number, organization_name, client_type_code, good_standing_ind, birthdate, district_code, work_safe_bc_number, doing_business_as, client_acronym, first_name, middle_name, last_name, notes, identification_type_code, client_identification, identification_country_code, identification_province_code) values
+ (364, 364, NULL, 'U', NULL, 'ROLAND SOLDIER', 'I', 'Y', '1972-12-04', 'DCR', NULL, NULL, NULL,'ROLAND', NULL,'SOLDIER','GOOD AT SUPPORT','CDDL','9999911','CA','BC') on conflict do nothing;
+insert into nrfc.submission_location
+ (submission_location_id, submission_id, street_address, country_code, province_code, city_name, postal_code, location_name) values
+ (364, 364, '999 Canyon View Dr', 'US', 'CO', 'Denver', '66043-6271', 'Mailing address') on conflict do nothing;
+insert into nrfc.submission_location_contact_xref values (364, 364) on conflict do nothing;
+insert into nrfc.submission_matching_detail values (364, 364, '{}', 'N', NULL, '2024-04-16 16:00:06.678395', 'idir\\ottomated', true) on conflict do nothing;
diff --git a/frontend/components.d.ts b/frontend/components.d.ts
index 750c656ffa..da64e5383d 100644
--- a/frontend/components.d.ts
+++ b/frontend/components.d.ts
@@ -1,10 +1,10 @@
/* eslint-disable */
-/* prettier-ignore */
// @ts-nocheck
// Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399
export {}
+/* prettier-ignore */
declare module 'vue' {
export interface GlobalComponents {
AddressGroupComponent: typeof import('./src/components/grouping/AddressGroupComponent.vue')['default']
diff --git a/frontend/package-lock.json b/frontend/package-lock.json
index c497f2920a..853697d5d1 100644
--- a/frontend/package-lock.json
+++ b/frontend/package-lock.json
@@ -30,7 +30,7 @@
"@istanbuljs/nyc-config-typescript": "^1.0.2",
"@rushstack/eslint-patch": "^1.1.0",
"@types/jsdom": "^21.1.0",
- "@types/node": "^20.14.1",
+ "@types/node": "^20.12.11",
"@typescript-eslint/eslint-plugin": "^7.12.0",
"@typescript-eslint/parser": "^7.12.0",
"@vitejs/plugin-vue": "^5.0.0",
@@ -5292,24 +5292,6 @@
"node": ">=10"
}
},
- "node_modules/@typescript-eslint/scope-manager": {
- "version": "7.11.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.11.0.tgz",
- "integrity": "sha512-27tGdVEiutD4POirLZX4YzT180vevUURJl4wJGmm6TrQoiYwuxTIY98PBp6L2oN+JQxzE0URvYlzJaBHIekXAw==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@typescript-eslint/types": "7.11.0",
- "@typescript-eslint/visitor-keys": "7.11.0"
- },
- "engines": {
- "node": "^18.18.0 || >=20.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/typescript-eslint"
- }
- },
"node_modules/@typescript-eslint/type-utils": {
"version": "7.12.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.12.0.tgz",
@@ -5412,79 +5394,6 @@
"node": ">=10"
}
},
- "node_modules/@typescript-eslint/types": {
- "version": "7.11.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.11.0.tgz",
- "integrity": "sha512-MPEsDRZTyCiXkD4vd3zywDCifi7tatc4K37KqTprCvaXptP7Xlpdw0NR2hRJTetG5TxbWDB79Ys4kLmHliEo/w==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": "^18.18.0 || >=20.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/typescript-eslint"
- }
- },
- "node_modules/@typescript-eslint/typescript-estree": {
- "version": "7.11.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.11.0.tgz",
- "integrity": "sha512-cxkhZ2C/iyi3/6U9EPc5y+a6csqHItndvN/CzbNXTNrsC3/ASoYQZEt9uMaEp+xFNjasqQyszp5TumAVKKvJeQ==",
- "dev": true,
- "license": "BSD-2-Clause",
- "dependencies": {
- "@typescript-eslint/types": "7.11.0",
- "@typescript-eslint/visitor-keys": "7.11.0",
- "debug": "^4.3.4",
- "globby": "^11.1.0",
- "is-glob": "^4.0.3",
- "minimatch": "^9.0.4",
- "semver": "^7.6.0",
- "ts-api-utils": "^1.3.0"
- },
- "engines": {
- "node": "^18.18.0 || >=20.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/typescript-eslint"
- },
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
- }
- },
- "node_modules/@typescript-eslint/typescript-estree/node_modules/lru-cache": {
- "version": "6.0.0",
- "dev": true,
- "license": "ISC",
- "dependencies": {
- "yallist": "^4.0.0"
- },
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": {
- "version": "7.6.0",
- "dev": true,
- "license": "ISC",
- "dependencies": {
- "lru-cache": "^6.0.0"
- },
- "bin": {
- "semver": "bin/semver.js"
- },
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/@typescript-eslint/typescript-estree/node_modules/yallist": {
- "version": "4.0.0",
- "dev": true,
- "license": "ISC"
- },
"node_modules/@typescript-eslint/utils": {
"version": "7.12.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.12.0.tgz",
@@ -5600,24 +5509,6 @@
"node": ">=10"
}
},
- "node_modules/@typescript-eslint/visitor-keys": {
- "version": "7.11.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.11.0.tgz",
- "integrity": "sha512-7syYk4MzjxTEk0g/w3iqtgxnFQspDJfn6QKD36xMuuhTzjcxY7F8EmBLnALjVyaOF1/bVocu3bS/2/F7rXrveQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@typescript-eslint/types": "7.11.0",
- "eslint-visitor-keys": "^3.4.3"
- },
- "engines": {
- "node": "^18.18.0 || >=20.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/typescript-eslint"
- }
- },
"node_modules/@ungap/structured-clone": {
"version": "1.2.0",
"dev": true,
diff --git a/processor/src/main/java/ca/bc/gov/app/service/client/ClientSubmissionLoadingService.java b/processor/src/main/java/ca/bc/gov/app/service/client/ClientSubmissionLoadingService.java
index f5256b60c6..a50a4e4533 100644
--- a/processor/src/main/java/ca/bc/gov/app/service/client/ClientSubmissionLoadingService.java
+++ b/processor/src/main/java/ca/bc/gov/app/service/client/ClientSubmissionLoadingService.java
@@ -98,6 +98,7 @@ public Mono buildMailMessage(MessagingWrapper message)
+ submissionContact.getLastName(),
details.getOrganizationName(),
districtInfo.getRight(),
+ districtInfo.getLeft(),
Objects.toString(details.getClientNumber(), ""),
String.valueOf(message.parameters()
.get(ApplicationConstant.MATCHING_REASON)),
@@ -162,14 +163,15 @@ private Map getParameter(
String username,
String businessName,
String districtName,
+ String districtEmail,
String clientNumber,
String reason,
Integer submissionId
) {
return switch ((SubmissionStatusEnum) message.parameters()
.get(ApplicationConstant.SUBMISSION_STATUS)) {
- case A -> approvalParameters(username, businessName, clientNumber);
- case R -> rejectionParameters(username, businessName, clientNumber, reason);
+ case A -> approvalParameters(username, businessName, clientNumber, districtName, districtEmail);
+ case R -> rejectionParameters(username, businessName, clientNumber, reason, districtName, districtEmail);
default -> revisionParameters(username, businessName, submissionId, districtName);
};
}
@@ -193,13 +195,17 @@ private Map revisionParameters(
private Map approvalParameters(
String username,
String businessName,
- String clientNumber
+ String clientNumber,
+ String districtName,
+ String districtEmail
) {
return Map.of(
"userName", username,
"business", Map.of(
"name", businessName,
- "clientNumber", clientNumber
+ "clientNumber", clientNumber,
+ "districtName", districtName,
+ "districtEmail", districtEmail
)
);
}
@@ -208,14 +214,18 @@ private Map rejectionParameters(
String username,
String businessName,
String clientNumber,
- String reason
+ String reason,
+ String districtName,
+ String districtEmail
) {
return Map.of(
"userName", username,
"reason", reason,
"business", Map.of(
"name", businessName,
- "clientNumber", clientNumber
+ "clientNumber", clientNumber,
+ "districtName", districtName,
+ "districtEmail", districtEmail
)
);
}
From a536e440a0f77e682ba2149cdb59a368010c29c7 Mon Sep 17 00:00:00 2001
From: Maria Martinez
Date: Fri, 28 Jun 2024 09:24:11 -0700
Subject: [PATCH 2/2] feat(be:FSADT1-1324): Changes in email templates
---
backend/src/main/resources/templates/approval.html | 2 +-
backend/src/main/resources/templates/registration.html | 2 +-
backend/src/main/resources/templates/rejection.html | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/backend/src/main/resources/templates/approval.html b/backend/src/main/resources/templates/approval.html
index b397d157f1..3fae8348a4 100644
--- a/backend/src/main/resources/templates/approval.html
+++ b/backend/src/main/resources/templates/approval.html
@@ -27,7 +27,7 @@
- If you need to contact us before then please contact the ${business.districtName}
+ If you need to contact us before then please contact the ${business.districtName} at
${business.districtEmail}.
diff --git a/backend/src/main/resources/templates/registration.html b/backend/src/main/resources/templates/registration.html
index 1beb9a68bd..d9820ebd62 100644
--- a/backend/src/main/resources/templates/registration.html
+++ b/backend/src/main/resources/templates/registration.html
@@ -30,7 +30,7 @@
- If you need to contact us before then please contact the ${districtName}
+ If you need to contact us before then please contact the ${districtName} at
${districtEmail}.
diff --git a/backend/src/main/resources/templates/rejection.html b/backend/src/main/resources/templates/rejection.html
index 37c9a0ea8f..caae29c5fc 100644
--- a/backend/src/main/resources/templates/rejection.html
+++ b/backend/src/main/resources/templates/rejection.html
@@ -24,7 +24,7 @@
- If you need to contact us before then please contact the ${business.districtName}
+ If you need to contact us before then please contact the ${business.districtName} at
${business.districtEmail}.