diff --git a/frontend/src/pages/SearchPage.vue b/frontend/src/pages/SearchPage.vue
index 4eae7af23b..24123ee364 100644
--- a/frontend/src/pages/SearchPage.vue
+++ b/frontend/src/pages/SearchPage.vue
@@ -13,7 +13,14 @@ import { useFetchTo } from "@/composables/useFetch";
import { useEventBus } from "@vueuse/core";
import type { ClientSearchResult, CodeNameValue } from "@/dto/CommonTypesDto";
-import { adminEmail, getObfuscatedEmailLink, toTitleCase, highlightMatch } from "@/services/ForestClientService";
+import {
+ adminEmail,
+ getObfuscatedEmailLink,
+ toTitleCase,
+ highlightMatch,
+ getTagColorByClientStatus,
+} from "@/services/ForestClientService";
+
import summit from "@carbon/pictograms/es/summit";
import userSearch from "@carbon/pictograms/es/user--search";
import useSvg from "@/composables/useSvg";
@@ -96,23 +103,6 @@ watch([searchError], () => {
}
});
-const tagColor = (status: string) => {
- switch (status) {
- case "Active":
- return "green";
- case "Deactivated":
- return "purple";
- case "Receivership":
- return "magenta";
- case "Suspended":
- return "red";
- case "Deceased":
- return "gray";
- default:
- return "";
- }
-};
-
const paginate = (event: any) => {
const hasPageChanged = event.detail.page !== pageNumber.value;
pageNumber.value = event.detail.page;
@@ -150,7 +140,7 @@ const searchResultToText = (searchResult: ClientSearchResult): string => {
const openClientDetails = (clientCode: string) => {
if (clientCode) {
const url = featureFlags.STAFF_CLIENT_DETAIL
- ? `/clients/${clientCode}`
+ ? `/clients/details/${clientCode}`
: `https://${greenDomain}/int/client/client02MaintenanceAction.do?bean.clientNumber=${clientCode}`;
window.open(url, "_blank", "noopener");
}
@@ -237,7 +227,7 @@ onMounted(() => {
>
-
+
{{ value.clientStatus }}
@@ -276,7 +266,9 @@ onMounted(() => {
{{ toTitleCase(row.city) }}
- {{ row.clientStatus }}
+
+ {{ row.clientStatus }}
+
diff --git a/frontend/src/pages/SubmissionReviewPage.vue b/frontend/src/pages/SubmissionReviewPage.vue
index d13fe20f38..1bb49d9b93 100644
--- a/frontend/src/pages/SubmissionReviewPage.vue
+++ b/frontend/src/pages/SubmissionReviewPage.vue
@@ -22,7 +22,13 @@ import type {
} from "@/dto/CommonTypesDto";
import { formatDistanceToNow, format } from "date-fns";
import { greenDomain } from "@/CoreConstants";
-import { adminEmail, getObfuscatedEmailLink } from "@/services/ForestClientService";
+import {
+ adminEmail,
+ getObfuscatedEmailLink,
+ convertFieldNameToSentence,
+ toTitleCase,
+ goodStanding,
+} from "@/services/ForestClientService";
// Imported User session
import ForestClientUserSession from "@/helpers/ForestClientUserSession";
@@ -34,7 +40,6 @@ import Review16 from "@carbon/icons-vue/es/data--view--alt/32";
import Check16 from "@carbon/icons-vue/es/checkmark/16";
// @ts-ignore
import Error16 from "@carbon/icons-vue/es/error--outline/16";
-import { convertFieldNameToSentence, toTitleCase } from "@/services/ForestClientService";
import { getValidations } from "@/helpers/validators/SubmissionReviewValidations";
const toastBus = useEventBus
("toast-notification");
@@ -214,12 +219,6 @@ const formattedDate = (date: Date): string => {
if (!date) return "";
return format(new Date(date), "MMM dd, yyyy");
};
-// Format the good standing parameter
-const goodStanding = (goodStanding: string): string => {
- if (goodStanding)
- return goodStanding === "Y" ? "Good standing" : "Not in good standing";
- return "Unknown";
-};
const tagColor = (status: string) => {
switch (status) {
@@ -531,12 +530,10 @@ const isProcessing = computed(() => {
-
-
{{ data.business.clientNumber }}
diff --git a/frontend/src/pages/client-details/SummaryView.vue b/frontend/src/pages/client-details/SummaryView.vue
new file mode 100644
index 0000000000..20d81c6aa4
--- /dev/null
+++ b/frontend/src/pages/client-details/SummaryView.vue
@@ -0,0 +1,111 @@
+
+
+
+
+
+ {{ props.data.clientNumber }}
+
+
+ {{ props.data.clientAcronym }}
+
+
+
+
+
+ {{ props.data.clientTypeDesc }}
+
+
+ {{ clientRegistrationNumber }}
+
+
+
+ {{
+ goodStanding(props.data.goodStandingInd)
+ }}
+
+
+
+
+
+ {{ props.data.clientIdentification }}
+
+
+ {{ props.data.birthdate }}
+
+
+
+
+ {{ props.data.clientStatusDesc }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/frontend/src/routes.ts b/frontend/src/routes.ts
index 7f62cdd2f5..34bd9f8044 100644
--- a/frontend/src/routes.ts
+++ b/frontend/src/routes.ts
@@ -205,7 +205,7 @@ export const routes = [
},
},
{
- path: "/clients/:id",
+ path: "/clients/details/:id",
name: "client-details",
component: ClientDetailsPage,
meta: {
diff --git a/frontend/src/services/ForestClientService.ts b/frontend/src/services/ForestClientService.ts
index cd7d2462cb..f1e55bff0d 100644
--- a/frontend/src/services/ForestClientService.ts
+++ b/frontend/src/services/ForestClientService.ts
@@ -118,3 +118,25 @@ export const highlightMatch = (itemName: string, searchTerm: string): string =>
)
.join('');
};
+
+export const getTagColorByClientStatus = (status: string): string => {
+ switch (status) {
+ case "Active":
+ return "green";
+ case "Deactivated":
+ return "purple";
+ case "Receivership":
+ return "magenta";
+ case "Suspended":
+ return "red";
+ case "Deceased":
+ return "gray";
+ default:
+ return "";
+ }
+};
+
+export const goodStanding = (goodStanding: string): string => {
+ if (goodStanding) return goodStanding === "Y" ? "Good standing" : "Not in good standing";
+ return "Unknown";
+};
diff --git a/frontend/stub/__files/response-clients-details-G.json b/frontend/stub/__files/response-clients-details-G.json
new file mode 100644
index 0000000000..eb0add2974
--- /dev/null
+++ b/frontend/stub/__files/response-clients-details-G.json
@@ -0,0 +1,49 @@
+{
+ "registryCompanyTypeCode": "GP",
+ "corpRegnNmbr": "{{randomValue length=8 type='NUMERIC'}}",
+ "clientNumber":"{{randomValue length=4 type='NUMERIC'}}",
+ "clientName": "KOVACEK, THOMPSON AND BOYER",
+ "clientAcronym": "KTB",
+ "clientTypeCode": "P",
+ "clientTypeDesc": "General Partnership",
+ "goodStandingInd": "Y",
+ "clientStatusCode": "A",
+ "clientStatusDesc": "Active",
+ "clientComment": "Email from Cheryl Bibby to request any letters for sec deposits be mailed to 3000, 28th St, Vernon",
+ "wcbFirmNumber": "{{randomValue length=7 type='NUMERIC'}}",
+ "contacts": [
+ {
+ "index": 0,
+ "contactType": "Accounts Receivable",
+ "firstName": "Test",
+ "lastName": "Uat",
+ "phoneNumber": "({{randomValue length=3 type='NUMERIC'}}) {{randomValue length=3 type='NUMERIC'}}-{{randomValue length=4 type='NUMERIC'}}",
+ "emailAddress": "uattest@gov.bc.ca",
+ "locations": [
+ "Mailing address",
+ "Accountant's address"
+ ],
+ "userId": "{{randomValue type='UUID'}}"
+ }
+ ],
+ "addresses": [
+ {
+ "index": 0,
+ "streetAddress":"{{randomValue length=3 type='NUMERIC'}} Richmond Ave",
+ "country":"Canada",
+ "province":"Saskatchewan",
+ "city":"Hampton",
+ "postalCode": "{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}",
+ "name": "Mailing address"
+ },
+ {
+ "index": 1,
+ "streetAddress":"{{randomValue length=4 type='NUMERIC'}} Oak St",
+ "country":"Canada",
+ "province":"British Columbia",
+ "city":"Deer Lake",
+ "postalCode":"{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}",
+ "name": "Accountant's address"
+ }
+ ]
+}
diff --git a/frontend/stub/__files/response-clients-details-GD.json b/frontend/stub/__files/response-clients-details-GD.json
new file mode 100644
index 0000000000..5c6d774f85
--- /dev/null
+++ b/frontend/stub/__files/response-clients-details-GD.json
@@ -0,0 +1,54 @@
+{
+ "registryCompanyTypeCode": "GP",
+ "corpRegnNmbr": "{{randomValue length=8 type='NUMERIC'}}",
+ "clientNumber":"{{randomValue length=4 type='NUMERIC'}}",
+ "clientName": "KOVACEK, THOMPSON AND BOYER",
+ "doingBusinessAs": [
+ {"doingBusinessAsName": "KOVACEK Enterprises"},
+ {"doingBusinessAsName": "THOMPSON Enterprises"},
+ {"doingBusinessAsName": "BOYER Enterprises"}
+ ],
+ "clientAcronym": "KTB",
+ "clientTypeCode": "P",
+ "clientTypeDesc": "General Partnership",
+ "goodStandingInd": "Y",
+ "clientStatusCode": "A",
+ "clientStatusDesc": "Active",
+ "clientComment": "Email from Cheryl Bibby to request any letters for sec deposits be mailed to 3000, 28th St, Vernon",
+ "wcbFirmNumber": "{{randomValue length=7 type='NUMERIC'}}",
+ "contacts": [
+ {
+ "index": 0,
+ "contactType": "Accounts Receivable",
+ "firstName": "Test",
+ "lastName": "Uat",
+ "phoneNumber": "({{randomValue length=3 type='NUMERIC'}}) {{randomValue length=3 type='NUMERIC'}}-{{randomValue length=4 type='NUMERIC'}}",
+ "emailAddress": "uattest@gov.bc.ca",
+ "locations": [
+ "Mailing address",
+ "Accountant's address"
+ ],
+ "userId": "{{randomValue type='UUID'}}"
+ }
+ ],
+ "addresses": [
+ {
+ "index": 0,
+ "streetAddress":"{{randomValue length=3 type='NUMERIC'}} Richmond Ave",
+ "country":"Canada",
+ "province":"Saskatchewan",
+ "city":"Hampton",
+ "postalCode": "{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}",
+ "name": "Mailing address"
+ },
+ {
+ "index": 1,
+ "streetAddress":"{{randomValue length=4 type='NUMERIC'}} Oak St",
+ "country":"Canada",
+ "province":"British Columbia",
+ "city":"Deer Lake",
+ "postalCode":"{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}",
+ "name": "Accountant's address"
+ }
+ ]
+}
diff --git a/frontend/stub/__files/response-clients-details-I.json b/frontend/stub/__files/response-clients-details-I.json
new file mode 100644
index 0000000000..6762350358
--- /dev/null
+++ b/frontend/stub/__files/response-clients-details-I.json
@@ -0,0 +1,55 @@
+{
+ "registryCompanyTypeCode": null,
+ "corpRegnNmbr": null,
+ "clientNumber":"{{randomValue length=4 type='NUMERIC'}}",
+ "clientName": "Silver",
+ "legalFirstName": "John",
+ "legalMiddleName": "",
+ "birthdate": "1952-08-17",
+ "clientIdTypeCode": "BCDL",
+ "clientIdTypeDesc": "British Columbia Driver's Licence",
+ "clientIdentification": "64242646",
+ "clientAcronym": null,
+ "clientTypeCode": "I",
+ "clientTypeDesc": "Individual",
+ "goodStandingInd": null,
+ "clientStatusCode": "A",
+ "clientStatusDesc": "Active",
+ "clientComment": "Sample line 1.\nSample line 2.\nSample line 3.",
+ "wcbFirmNumber": "{{randomValue length=7 type='NUMERIC'}}",
+ "contacts": [
+ {
+ "index": 0,
+ "contactType": "Accounts Receivable",
+ "firstName": "Test",
+ "lastName": "Uat",
+ "phoneNumber": "({{randomValue length=3 type='NUMERIC'}}) {{randomValue length=3 type='NUMERIC'}}-{{randomValue length=4 type='NUMERIC'}}",
+ "emailAddress": "uattest@gov.bc.ca",
+ "locations": [
+ "Mailing address",
+ "Accountant's address"
+ ],
+ "userId": "{{randomValue type='UUID'}}"
+ }
+ ],
+ "addresses": [
+ {
+ "index": 0,
+ "streetAddress":"{{randomValue length=3 type='NUMERIC'}} Richmond Ave",
+ "country":"Canada",
+ "province":"Saskatchewan",
+ "city":"Hampton",
+ "postalCode": "{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}",
+ "name": "Mailing address"
+ },
+ {
+ "index": 1,
+ "streetAddress":"{{randomValue length=4 type='NUMERIC'}} Oak St",
+ "country":"Canada",
+ "province":"British Columbia",
+ "city":"Deer Lake",
+ "postalCode":"{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}",
+ "name": "Accountant's address"
+ }
+ ]
+}
diff --git a/frontend/stub/__files/response-clients-details-IV.json b/frontend/stub/__files/response-clients-details-IV.json
new file mode 100644
index 0000000000..c4700e894a
--- /dev/null
+++ b/frontend/stub/__files/response-clients-details-IV.json
@@ -0,0 +1,55 @@
+{
+ "registryCompanyTypeCode": null,
+ "corpRegnNmbr": null,
+ "clientNumber":"{{randomValue length=4 type='NUMERIC'}}",
+ "clientName": "Silver",
+ "legalFirstName": "John",
+ "legalMiddleName": "",
+ "birthdate": "1952",
+ "clientIdTypeCode": "BCDL",
+ "clientIdTypeDesc": "British Columbia Driver's Licence",
+ "clientIdentification": "6****646",
+ "clientAcronym": null,
+ "clientTypeCode": "I",
+ "clientTypeDesc": "Individual",
+ "goodStandingInd": null,
+ "clientStatusCode": "A",
+ "clientStatusDesc": "Active",
+ "clientComment": "Sample line 1.\nSample line 2.\nSample line 3.",
+ "wcbFirmNumber": "{{randomValue length=7 type='NUMERIC'}}",
+ "contacts": [
+ {
+ "index": 0,
+ "contactType": "Accounts Receivable",
+ "firstName": "Test",
+ "lastName": "Uat",
+ "phoneNumber": "({{randomValue length=3 type='NUMERIC'}}) {{randomValue length=3 type='NUMERIC'}}-{{randomValue length=4 type='NUMERIC'}}",
+ "emailAddress": "uattest@gov.bc.ca",
+ "locations": [
+ "Mailing address",
+ "Accountant's address"
+ ],
+ "userId": "{{randomValue type='UUID'}}"
+ }
+ ],
+ "addresses": [
+ {
+ "index": 0,
+ "streetAddress":"{{randomValue length=3 type='NUMERIC'}} Richmond Ave",
+ "country":"Canada",
+ "province":"Saskatchewan",
+ "city":"Hampton",
+ "postalCode": "{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}",
+ "name": "Mailing address"
+ },
+ {
+ "index": 1,
+ "streetAddress":"{{randomValue length=4 type='NUMERIC'}} Oak St",
+ "country":"Canada",
+ "province":"British Columbia",
+ "city":"Deer Lake",
+ "postalCode":"{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}",
+ "name": "Accountant's address"
+ }
+ ]
+}
diff --git a/frontend/stub/__files/response-clients-details-S.json b/frontend/stub/__files/response-clients-details-S.json
new file mode 100644
index 0000000000..9e273ce53a
--- /dev/null
+++ b/frontend/stub/__files/response-clients-details-S.json
@@ -0,0 +1,55 @@
+{
+ "registryCompanyTypeCode": "SP",
+ "corpRegnNmbr": "{{randomValue length=8 type='NUMERIC'}}",
+ "clientNumber":"{{randomValue length=4 type='NUMERIC'}}",
+ "clientName": "Scott",
+ "legalFirstName": "Michael",
+ "legalMiddleName": "Gary",
+ "doingBusinessAs": [
+ {"doingBusinessAsName": "Dunder Mifflin Paper Company"}
+ ],
+ "birthdate": "1962-08-17",
+ "clientAcronym": "DMPC",
+ "clientTypeCode": "RSP",
+ "clientTypeDesc": "Registered sole proprietorship",
+ "goodStandingInd": "N",
+ "clientStatusCode": "A",
+ "clientStatusDesc": "Active",
+ "clientComment": "Email from Michael Scott to request any letters for sec deposits be mailed to 3000, 28th St, Scranton",
+ "wcbFirmNumber": "{{randomValue length=7 type='NUMERIC'}}",
+ "contacts": [
+ {
+ "index": 0,
+ "contactType": "Accounts Receivable",
+ "firstName": "Test",
+ "lastName": "Uat",
+ "phoneNumber": "({{randomValue length=3 type='NUMERIC'}}) {{randomValue length=3 type='NUMERIC'}}-{{randomValue length=4 type='NUMERIC'}}",
+ "emailAddress": "uattest@gov.bc.ca",
+ "locations": [
+ "Mailing address",
+ "Accountant's address"
+ ],
+ "userId": "{{randomValue type='UUID'}}"
+ }
+ ],
+ "addresses": [
+ {
+ "index": 0,
+ "streetAddress":"{{randomValue length=3 type='NUMERIC'}} Richmond Ave",
+ "country":"Canada",
+ "province":"Saskatchewan",
+ "city":"Hampton",
+ "postalCode": "{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}",
+ "name": "Mailing address"
+ },
+ {
+ "index": 1,
+ "streetAddress":"{{randomValue length=4 type='NUMERIC'}} Oak St",
+ "country":"Canada",
+ "province":"British Columbia",
+ "city":"Deer Lake",
+ "postalCode":"{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}",
+ "name": "Accountant's address"
+ }
+ ]
+}
diff --git a/frontend/stub/__files/response-clients-details-SE.json b/frontend/stub/__files/response-clients-details-SE.json
new file mode 100644
index 0000000000..8c9544fa9b
--- /dev/null
+++ b/frontend/stub/__files/response-clients-details-SE.json
@@ -0,0 +1,53 @@
+{
+ "registryCompanyTypeCode": "SP",
+ "corpRegnNmbr": "{{randomValue length=8 type='NUMERIC'}}",
+ "clientNumber":"{{randomValue length=4 type='NUMERIC'}}",
+ "clientName": "Scott",
+ "legalFirstName": "Michael",
+ "legalMiddleName": "",
+ "doingBusinessAs": [],
+ "birthdate": "1962-08-17",
+ "clientAcronym": "",
+ "clientTypeCode": "RSP",
+ "clientTypeDesc": "Registered sole proprietorship",
+ "goodStandingInd": "N",
+ "clientStatusCode": "A",
+ "clientStatusDesc": "Active",
+ "clientComment": "",
+ "wcbFirmNumber": "{{randomValue length=7 type='NUMERIC'}}",
+ "contacts": [
+ {
+ "index": 0,
+ "contactType": "Accounts Receivable",
+ "firstName": "Test",
+ "lastName": "Uat",
+ "phoneNumber": "({{randomValue length=3 type='NUMERIC'}}) {{randomValue length=3 type='NUMERIC'}}-{{randomValue length=4 type='NUMERIC'}}",
+ "emailAddress": "uattest@gov.bc.ca",
+ "locations": [
+ "Mailing address",
+ "Accountant's address"
+ ],
+ "userId": "{{randomValue type='UUID'}}"
+ }
+ ],
+ "addresses": [
+ {
+ "index": 0,
+ "streetAddress":"{{randomValue length=3 type='NUMERIC'}} Richmond Ave",
+ "country":"Canada",
+ "province":"Saskatchewan",
+ "city":"Hampton",
+ "postalCode": "{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}",
+ "name": "Mailing address"
+ },
+ {
+ "index": 1,
+ "streetAddress":"{{randomValue length=4 type='NUMERIC'}} Oak St",
+ "country":"Canada",
+ "province":"British Columbia",
+ "city":"Deer Lake",
+ "postalCode":"{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}{{randomValue length=1 type='ALPHABETIC' uppercase=true}}{{randomValue length=1 type='NUMERIC'}}",
+ "name": "Accountant's address"
+ }
+ ]
+}
diff --git a/frontend/stub/__files/response-submissions-details-approved.json b/frontend/stub/__files/response-submissions-details-approved.json
index 0ea465a154..5d0c0d0be2 100644
--- a/frontend/stub/__files/response-submissions-details-approved.json
+++ b/frontend/stub/__files/response-submissions-details-approved.json
@@ -7,13 +7,14 @@
"approvedTimestamp": "{{now offset='-1 minutes' format='yyyy-MM-dd HH:mm:ss'}}",
"updateUser": "CLIADMIN",
"business": {
- "businessType": "Registered Business",
+ "businessType": "R",
"registrationNumber": "XX{{randomValue length=8 type='NUMERIC'}}",
"clientNumber":"{{randomValue length=8 type='NUMERIC'}}",
"organizationName": "THE TIMBER SOCIETY OF NORTH SASKATCHEWAN AND REGION LLC",
"clientType": "C",
- "goodStanding": "Y",
+ "goodStandingInd": "Y",
"clientTypeDesc": "Corporation",
+ "district": "DCC",
"districtDesc": "DCC - Cariboo-Chilcotin Natural Resource District"
},
"contact": [
diff --git a/frontend/stub/__files/response-submissions-details-dupped.json b/frontend/stub/__files/response-submissions-details-dupped.json
index d33e54ff6d..625cebd69e 100644
--- a/frontend/stub/__files/response-submissions-details-dupped.json
+++ b/frontend/stub/__files/response-submissions-details-dupped.json
@@ -7,13 +7,14 @@
"approvedTimestamp": "{{now offset='-1 minutes' format='yyyy-MM-dd HH:mm:ss'}}",
"updateUser": "Rinaldo Hendrix",
"business": {
- "businessType": "Registered Business",
+ "businessType": "R",
"registrationNumber": "BC{{randomValue length=8 type='NUMERIC'}}",
"clientNumber":"",
"organizationName": "Ziemann Group",
"clientType": "C",
"clientTypeDesc": "Corporation",
- "goodStanding": "Y",
+ "goodStandingInd": "Y",
+ "district": "DCC",
"districtDesc": "DCS - Cascades Natural Resource District"
},
"contact": [
diff --git a/frontend/stub/__files/response-submissions-details-review.json b/frontend/stub/__files/response-submissions-details-review.json
index a47598bece..fefb646b16 100644
--- a/frontend/stub/__files/response-submissions-details-review.json
+++ b/frontend/stub/__files/response-submissions-details-review.json
@@ -7,13 +7,14 @@
"approvedTimestamp": "{{now offset='-1 minutes' format='yyyy-MM-dd HH:mm:ss'}}",
"updateUser": "Isador Driver",
"business": {
- "businessType": "Registered Business",
+ "businessType": "R",
"registrationNumber": "GP{{randomValue length=8 type='NUMERIC'}}",
"clientNumber":"",
"organizationName": "KOVACEK, THOMPSON AND BOYER",
"clientType": "P",
- "goodStanding": null,
+ "goodStandingInd": null,
"clientTypeDesc": "General Partnership",
+ "district": "DCC",
"districtDesc": "DCC - Cariboo-Chilcotin Natural Resource District"
},
"contact": [
diff --git a/frontend/stub/__files/response-submissions-details-reviewedapproved.json b/frontend/stub/__files/response-submissions-details-reviewedapproved.json
index c55941bd58..310a679682 100644
--- a/frontend/stub/__files/response-submissions-details-reviewedapproved.json
+++ b/frontend/stub/__files/response-submissions-details-reviewedapproved.json
@@ -13,7 +13,8 @@
"organizationName": "Carter, Mante and Rau",
"clientType": "I",
"clientTypeDesc": "Individual",
- "goodStanding": "Y",
+ "goodStandingInd": "Y",
+ "district": "DKA",
"districtDesc": "DKA - Thompson Rivers Natural Resource District"
},
"contact": [
diff --git a/frontend/stub/__files/response-submissions-details-unregistered.json b/frontend/stub/__files/response-submissions-details-unregistered.json
index e6c23c871c..ae1c5fefe8 100644
--- a/frontend/stub/__files/response-submissions-details-unregistered.json
+++ b/frontend/stub/__files/response-submissions-details-unregistered.json
@@ -12,7 +12,8 @@
"clientNumber":"",
"organizationName": "Orn-O'Hara",
"clientTypeDesc": "Unregistered sole proprietorship",
- "goodStanding": "Y",
+ "goodStandingInd": "Y",
+ "district": "DQU",
"districtDesc": "DQU - Quesnel Natural Resource District"
},
"contact": [
diff --git a/frontend/stub/mappings/client_details.json b/frontend/stub/mappings/client_details.json
new file mode 100644
index 0000000000..c69b03248a
--- /dev/null
+++ b/frontend/stub/mappings/client_details.json
@@ -0,0 +1,128 @@
+{
+ "mappings": [
+ {
+ "name": "Client Details General Partnership",
+ "request": {
+ "urlPattern": "/api/clients/details/[gG]?(.*)",
+ "method": "GET"
+ },
+ "response": {
+ "status": 200,
+ "bodyFileName": "response-clients-details-G.json",
+ "transformers": [
+ "response-template"
+ ],
+ "fixedDelayMilliseconds": 500
+ }
+ },
+ {
+ "name": "Client Details General Partnership - Doing business as",
+ "request": {
+ "urlPattern": "/api/clients/details/[gG][dD](.*)",
+ "method": "GET"
+ },
+ "response": {
+ "status": 200,
+ "bodyFileName": "response-clients-details-GD.json",
+ "transformers": [
+ "response-template"
+ ],
+ "fixedDelayMilliseconds": 500
+ }
+ },
+ {
+ "name": "Client Details Sole Proprietorship",
+ "request": {
+ "urlPattern": "/api/clients/details/[sS](.*)",
+ "method": "GET"
+ },
+ "response": {
+ "status": 200,
+ "bodyFileName": "response-clients-details-S.json",
+ "transformers": [
+ "response-template"
+ ],
+ "fixedDelayMilliseconds": 500
+ }
+ },
+ {
+ "name": "Client Details Sole Proprietorship - Some empty fields",
+ "request": {
+ "urlPattern": "/api/clients/details/[sS][eE](.*)",
+ "method": "GET"
+ },
+ "response": {
+ "status": 200,
+ "bodyFileName": "response-clients-details-SE.json",
+ "transformers": [
+ "response-template"
+ ],
+ "fixedDelayMilliseconds": 500
+ }
+ },
+ {
+ "name": "Client Details Individual",
+ "request": {
+ "urlPattern": "/api/clients/details/[iI](.*)",
+ "method": "GET"
+ },
+ "response": {
+ "status": 200,
+ "bodyFileName": "response-clients-details-I.json",
+ "transformers": [
+ "response-template"
+ ],
+ "fixedDelayMilliseconds": 500
+ }
+ },
+ {
+ "name": "Client Details Individual - Viewer role",
+ "request": {
+ "urlPattern": "/api/clients/details/[iI][vV](.*)",
+ "method": "GET"
+ },
+ "response": {
+ "status": 200,
+ "bodyFileName": "response-clients-details-IV.json",
+ "transformers": [
+ "response-template"
+ ],
+ "fixedDelayMilliseconds": 500
+ }
+ },
+ {
+ "name": "Client Details - Error 400",
+ "request": {
+ "urlPattern": "/api/clients/details/(.*)e4..",
+ "method": "GET"
+ },
+ "response": {
+ "status": 404,
+ "body": "Client not found",
+ "fixedDelayMilliseconds": 200
+ }
+ },
+ {
+ "name": "Client Details - Error 500",
+ "request": {
+ "urlPattern": "/api/clients/details/(.*)e5..",
+ "method": "GET"
+ },
+ "response": {
+ "status": 500,
+ "body": "Server error",
+ "fixedDelayMilliseconds": 200
+ }
+ },
+ {
+ "name": "Client Details - Error Network",
+ "request": {
+ "urlPattern": "/api/clients/details/(.*)enet",
+ "method": "GET"
+ },
+ "response": {
+ "fault": "MALFORMED_RESPONSE_CHUNK"
+ }
+ }
+ ]
+}
diff --git a/frontend/tests/components/pages/client-details/SummaryView.cy.ts b/frontend/tests/components/pages/client-details/SummaryView.cy.ts
new file mode 100644
index 0000000000..0a7696e1ed
--- /dev/null
+++ b/frontend/tests/components/pages/client-details/SummaryView.cy.ts
@@ -0,0 +1,126 @@
+import type { ClientDetails } from "@/dto/CommonTypesDto";
+import SummaryView from "@/pages/client-details/SummaryView.vue";
+
+describe("", () => {
+ const getDefaultProps = () => ({
+ data: {
+ registryCompanyTypeCode: "SP",
+ corpRegnNmbr: "88888888",
+ clientNumber: "4444",
+ clientName: "Scott",
+ legalFirstName: "Michael",
+ legalMiddleName: "Gary",
+ doingBusinessAs: [{ doingBusinessAsName: "Dunder Mifflin Paper Company" }],
+ birthdate: "1962-08-17",
+ clientAcronym: "DMPC",
+ clientTypeCode: "RSP",
+ clientTypeDesc: "Registered sole proprietorship",
+ goodStandingInd: "Y",
+ clientStatusCode: "A",
+ clientStatusDesc: "Active",
+ clientComment:
+ "Email from Michael Scott to request any letters for sec deposits be mailed to 3000, 28th St, Scranton",
+ wcbFirmNumber: "7777777",
+ clientIdTypeDesc: "British Columbia Driver's Licence",
+ clientIdentification: "64242646",
+ } as ClientDetails,
+ });
+
+ let currentProps: ReturnType = null;
+ const mount = (props = getDefaultProps()) => {
+ currentProps = props;
+ return cy
+ .mount(SummaryView, {
+ props,
+ })
+ .its("wrapper")
+ .as("vueWrapper");
+ };
+
+ const testField = (selector: string, value: string) => {
+ cy.get(selector).should("be.visible");
+ cy.get(selector).contains(value);
+ expect(value.length).to.be.greaterThan(0);
+ };
+
+ const testFieldHidden = (selector: string) => {
+ cy.get(selector).should("not.exist");
+ };
+
+ it("renders the SummaryView component", () => {
+ mount();
+
+ testField("#clientNumber", currentProps.data.clientNumber);
+ testField("#acronym", currentProps.data.clientAcronym);
+ testField("#doingBusinessAs", currentProps.data.doingBusinessAs[0].doingBusinessAsName);
+ testField("#clientType", currentProps.data.clientTypeDesc);
+
+ // registryCompanyTypeCode + corpRegnNmbr
+ testField(
+ "#registrationNumber",
+ `${currentProps.data.registryCompanyTypeCode}${currentProps.data.corpRegnNmbr}`,
+ );
+
+ testField("#goodStanding", "Good standing");
+
+ // identification Label
+ testField("#identification", currentProps.data.clientIdTypeDesc);
+ // identification Value
+ testField("#identification", currentProps.data.clientIdentification);
+
+ testField("#dateOfBirth", currentProps.data.birthdate);
+ testField("#status", currentProps.data.clientStatusDesc);
+ testField("#notes", currentProps.data.clientComment);
+ });
+
+ it("hides optional fields when they are empty", () => {
+ const data: ClientDetails = {
+ ...getDefaultProps().data,
+ registryCompanyTypeCode: "",
+ corpRegnNmbr: "",
+ doingBusinessAs: [],
+ birthdate: "",
+ clientAcronym: "",
+ goodStandingInd: null,
+ clientComment: "",
+ clientIdTypeDesc: "",
+ clientIdentification: "",
+ };
+ mount({ data });
+
+ testFieldHidden("#acronym");
+ testFieldHidden("#registrationNumber");
+ testFieldHidden("#goodStanding");
+ testFieldHidden("#identification");
+ testFieldHidden("#doingBusinessAs");
+ testFieldHidden("#dataOfBirth");
+ testFieldHidden("#notes");
+ });
+
+ it("displays as many names the client has as Doing business as", () => {
+ const { data } = getDefaultProps();
+ data.doingBusinessAs[1] = { doingBusinessAsName: "Name #2" };
+ data.doingBusinessAs[2] = { doingBusinessAsName: "Name #3" };
+
+ mount({ data });
+
+ testField("#doingBusinessAs", data.doingBusinessAs[0].doingBusinessAsName);
+ testField("#doingBusinessAs", data.doingBusinessAs[1].doingBusinessAsName);
+ testField("#doingBusinessAs", data.doingBusinessAs[2].doingBusinessAsName);
+ });
+
+ it("sets the birthdate label to 'Date of birth' when date is complete", () => {
+ mount();
+
+ cy.get("#dateOfBirth").contains("Date of birth");
+ });
+
+ it("sets the birthdate label to 'Year of birth' when date has only four digits", () => {
+ const { data } = getDefaultProps();
+ data.birthdate = "1985";
+
+ mount({ data });
+
+ cy.get("#dateOfBirth").contains("Year of birth");
+ });
+});
diff --git a/frontend/tests/unittests/components/forms/ReadOnlyComponent.spec.ts b/frontend/tests/unittests/components/forms/ReadOnlyComponent.spec.ts
index d7f7afe481..2f9f09d2bc 100644
--- a/frontend/tests/unittests/components/forms/ReadOnlyComponent.spec.ts
+++ b/frontend/tests/unittests/components/forms/ReadOnlyComponent.spec.ts
@@ -15,7 +15,7 @@ describe('ReadOnlyComponent.vue', () => {
const wrapper = mount(ReadOnlyComponent, {
props: { label: 'Test Label' }
});
- expect(wrapper.find('.label-01').text()).toBe('Test Label');
+ expect(wrapper.find('.label-02').text()).toBe('Test Label');
});
it('renders default slot content', () => {
diff --git a/frontend/tests/unittests/pages/ClientDetailsPage.spec.ts b/frontend/tests/unittests/pages/ClientDetailsPage.spec.ts
index f6eb575541..300999b662 100644
--- a/frontend/tests/unittests/pages/ClientDetailsPage.spec.ts
+++ b/frontend/tests/unittests/pages/ClientDetailsPage.spec.ts
@@ -2,12 +2,21 @@ import { describe, it, expect } from "vitest";
import { mount } from "@vue/test-utils";
import ClientDetailsPage from "@/pages/ClientDetailsPage.vue";
+import { createMemoryHistory, createRouter } from "vue-router";
describe("ClientDetailsPage.vue", () => {
+ const router = createRouter({
+ history: createMemoryHistory(),
+ routes: [{ path: "/", component: ClientDetailsPage }],
+ });
+
// Helper function to mount component with props
- const createComponent = (propsData = {}) => {
+ const createComponent = (props = {}) => {
return mount(ClientDetailsPage, {
- propsData,
+ props,
+ global: {
+ plugins: [router],
+ },
});
};
diff --git a/frontend/tests/unittests/services/ForestClientService.spec.ts b/frontend/tests/unittests/services/ForestClientService.spec.ts
index 61062bfef8..9f32b7d42e 100644
--- a/frontend/tests/unittests/services/ForestClientService.spec.ts
+++ b/frontend/tests/unittests/services/ForestClientService.spec.ts
@@ -5,6 +5,8 @@ import {
getContactDescription,
getAddressDescription,
toTitleCase,
+ getTagColorByClientStatus,
+ goodStanding,
} from "@/services/ForestClientService";
import type { Contact, Address } from "@/dto/ApplyClientNumberDto";
@@ -123,10 +125,48 @@ describe("ForestClientService.ts", () => {
describe("toTitleCase", () => {
it.each([
["TWO WORDS", "Two Words"],
- ["NAME (DOING)", "Name (Doing)"],
- ["A.C.R.O.N.", "A.C.R.O.N."],
- ])("gets the expected result", (input, expectedOutput) => {
+ ["NAME (DOING)", "Name (Doing)"], // parentheses
+ ["A.C.R.O.N.", "A.C.R.O.N."], // period
+ ])("gets the expected result from input '%s': '%s'", (input, expectedOutput) => {
expect(toTitleCase(input)).toEqual(expectedOutput);
});
});
+
+ describe("getTagColorByClientStatus", () => {
+ it.each([
+ ["Active", "green"], // existing value #1
+ ["Deactivated", "purple"], // existing value #2
+ ["Bogus", ""], // non-existent value
+ ])("gets the expected result from input '%s': '%s'", (input, expectedOutput) => {
+ expect(getTagColorByClientStatus(input)).toEqual(expectedOutput);
+ });
+ });
+
+ describe("goodStanding", () => {
+ const yExpected = "Good standing";
+ const emptyExpected = "Unknown";
+ describe("when input is 'Y'", () => {
+ it("returns 'Good standing'", () => {
+ expect(goodStanding("Y")).toEqual(yExpected);
+ });
+ });
+ describe("when input is empty", () => {
+ it.each([[""], [undefined], [null]])("returns 'Unknown' for %j", (input) => {
+ expect(goodStanding(input)).toEqual(emptyExpected);
+ });
+ });
+ describe("when input is 'N'", () => {
+ it("returns something else", () => {
+ const nValue = goodStanding("N");
+
+ // is a non-empty string
+ expect(nValue).toEqual(expect.any(String));
+ expect(nValue.length).toBeGreaterThan(0);
+
+ // doesn't overlap with "Y" or empty values
+ expect(nValue).not.toEqual(yExpected);
+ expect(nValue).not.toEqual(emptyExpected);
+ });
+ });
+ });
});