From 8ad7eaf8e1b6381ceb09de2194dcac98b61a1a29 Mon Sep 17 00:00:00 2001 From: Maria Martinez Date: Wed, 7 Aug 2024 10:56:25 -0700 Subject: [PATCH] feat(FSADT1-1390): First nartions - Part #2 --- .../bc/gov/app/dto/client/ClientTypeEnum.java | 2 +- .../app/service/opendata/OpenDataService.java | 3 +- .../validators/StaffFormValidations.ts | 10 ++++++ ...FirstNationClientInformationWizardStep.vue | 33 ++++++++++++++++++- 4 files changed, 45 insertions(+), 3 deletions(-) diff --git a/backend/src/main/java/ca/bc/gov/app/dto/client/ClientTypeEnum.java b/backend/src/main/java/ca/bc/gov/app/dto/client/ClientTypeEnum.java index d1e452c6b8..7d8edb5583 100644 --- a/backend/src/main/java/ca/bc/gov/app/dto/client/ClientTypeEnum.java +++ b/backend/src/main/java/ca/bc/gov/app/dto/client/ClientTypeEnum.java @@ -14,7 +14,7 @@ */ public enum ClientTypeEnum { // Enum constants representing client types - C, S, A, I, P, L, RSP, USP; + C, S, A, I, P, L, RSP, USP, B; // A map for reverse lookup of enum constants by their name private static final Map CONSTANTS = new HashMap<>(); diff --git a/backend/src/main/java/ca/bc/gov/app/service/opendata/OpenDataService.java b/backend/src/main/java/ca/bc/gov/app/service/opendata/OpenDataService.java index 2ecdb01f21..da293b6ad8 100644 --- a/backend/src/main/java/ca/bc/gov/app/service/opendata/OpenDataService.java +++ b/backend/src/main/java/ca/bc/gov/app/service/opendata/OpenDataService.java @@ -43,7 +43,8 @@ private Mono convertToDto(Feature openDataFeature) { openDataFeature.properties().addressLine2(), openDataFeature.properties().addressLine1() ), - StringUtils.EMPTY, + StringUtils.isNotBlank(openDataFeature.properties().addressLine2()) ? + openDataFeature.properties().addressLine1() : StringUtils.EMPTY, null, new ClientValueTextDto("CA", "Canada"), provinceDto, diff --git a/frontend/src/helpers/validators/StaffFormValidations.ts b/frontend/src/helpers/validators/StaffFormValidations.ts index 1765e83f25..1b4d1b6d53 100644 --- a/frontend/src/helpers/validators/StaffFormValidations.ts +++ b/frontend/src/helpers/validators/StaffFormValidations.ts @@ -72,6 +72,16 @@ fieldValidations["businessInformation.lastName"] = [ hasOnlyNamingCharacters("last name"), ]; +fieldValidations["businessInformation.workSafeBcNumber"] = [ + optional(isOnlyNumbers("WorkSafeBC number should contain only numbers")), + optional(isMaxSizeMsg("WorkSafeBC", 6)) +]; + +fieldValidations["businessInformation.clientAcronym"] = [ + optional(isMaxSizeMsg("acronym", 8)), + optional(isAscii("acronym")), +]; + // For the input field. fieldValidations["identificationType.text"] = [isNotEmpty("You must select an ID type.")]; diff --git a/frontend/src/pages/staffform/FirstNationClientInformationWizardStep.vue b/frontend/src/pages/staffform/FirstNationClientInformationWizardStep.vue index dc1c5a5b47..8454237de4 100644 --- a/frontend/src/pages/staffform/FirstNationClientInformationWizardStep.vue +++ b/frontend/src/pages/staffform/FirstNationClientInformationWizardStep.vue @@ -31,7 +31,7 @@ import { // @ts-ignore import Information16 from "@carbon/icons-vue/es/information/16"; -// Defining the props and emiter to reveice the data and emit an update +// Defining the props and emiter to receive the data and emit an update const props = defineProps<{ data: FormDataDto; active: boolean; @@ -53,6 +53,8 @@ watch( // -- Validation of the component -- const validation = reactive>({ businessName: !!formData.value.businessInformation.businessName, + workSafeBcNumber: true, + clientAcronym: true }); const checkValid = () => @@ -148,5 +150,34 @@ const mapFirstNationInfo = (firstNations: ForestClientDetailsDto[] = []) => { Loading first nation details... + + +