From 2e9490c4e992fbfb1e46c4a2f1d96dc35ba78086 Mon Sep 17 00:00:00 2001 From: Maria Martinez <77364706+mamartinezmejia@users.noreply.github.com> Date: Wed, 19 Apr 2023 13:21:12 -0700 Subject: [PATCH] FSADT1-722 (#435) * fix(be): - Changed the version of the jacobo plugin as the version 0.8.9 was failing locally * fix(fe): - Fixed deprecation warning message indicating that the 'importsNotUsedAsValues' option will be removed in TypeScript 5.5, and we should use the 'verbatimModuleSyntax' instead. * Partial commit to get changes from Paulo * This code is not longer needed * Reverted changed. Done for testing purposes. * Changed named to legal name as the current one is misleading as we are using both client type and legal type * feat(fe): - Draft for https://apps.nrs.gov.bc.ca/int/jira/browse/FSADT1-722 * Changed named to legal name as the current one is misleading as we are using both client type and legal type #2 * Changed named to legal name as the current one is misleading as we are using both client type and legal type #3 * Uncommented out code * feat(fe): - Completed FSADT1-722 * chore: fixing tests --------- Co-authored-by: Paulo Gomes da Cruz Junior --- .../gov/app/dto/client/ClientLookUpDto.java | 6 +- .../db/migration/V1__initializing_data.sql | 3 - .../java/ca/bc/gov/app/TestConstants.java | 4 +- .../ClientControllerIntegrationTest.java | 4 +- .../client/ClientServiceIntegrationTest.java | 4 +- frontend/components.d.ts | 4 +- frontend/src/App.vue | 11 +- frontend/src/common/LabelComponent.vue | 23 ++- frontend/src/dto/ApplyClientNumberDto.ts | 14 +- .../ApplyClientNumberPage.vue | 180 +++++++++++------- frontend/src/services/FetchService.ts | 10 +- frontend/tsconfig.vitest.json | 6 +- 12 files changed, 166 insertions(+), 103 deletions(-) diff --git a/backend/src/main/java/ca/bc/gov/app/dto/client/ClientLookUpDto.java b/backend/src/main/java/ca/bc/gov/app/dto/client/ClientLookUpDto.java index a9c35d93b4..6451c09a2c 100644 --- a/backend/src/main/java/ca/bc/gov/app/dto/client/ClientLookUpDto.java +++ b/backend/src/main/java/ca/bc/gov/app/dto/client/ClientLookUpDto.java @@ -11,7 +11,7 @@ "code": "00000002", "name": "BAXTER", "status": "ACTIVE", - "clientType": "SP" + "legalType": "SP" }""" ) public record ClientLookUpDto( @@ -22,7 +22,7 @@ public record ClientLookUpDto( @Schema(description = "The status of the client, could be ACTIVE or INACTIVE", example = "ACTIVE") String status, - @Schema(description = "The type of the client", example = "SP") - String clientType + @Schema(description = "The legal type of the client", example = "SP") + String legalType ) { } diff --git a/backend/src/main/resources/db/migration/V1__initializing_data.sql b/backend/src/main/resources/db/migration/V1__initializing_data.sql index be018b4399..82f27ae6da 100644 --- a/backend/src/main/resources/db/migration/V1__initializing_data.sql +++ b/backend/src/main/resources/db/migration/V1__initializing_data.sql @@ -198,9 +198,6 @@ insert into nrfc.client_type_code (client_type_code, description, effective_date 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 ('Z', 'Sole Proprietorship', current_timestamp, 'mariamar') on conflict (client_type_code) do nothing; - -update nrfc.client_type_code set expiry_date = current_timestamp where client_type_code not in ('C', 'Z'); insert into nrfc.contact_type_code (contact_type_code, description, effective_date, create_user) values ('AP', 'Accounts Payable', current_timestamp, 'mariamar') on conflict (contact_type_code) do nothing; insert into nrfc.contact_type_code (contact_type_code, description, effective_date, create_user) values ('AR', 'Accounts Receivable', current_timestamp, 'mariamar') on conflict (contact_type_code) do nothing; diff --git a/backend/src/test/java/ca/bc/gov/app/TestConstants.java b/backend/src/test/java/ca/bc/gov/app/TestConstants.java index 6b7abc7474..78258e6c5d 100644 --- a/backend/src/test/java/ca/bc/gov/app/TestConstants.java +++ b/backend/src/test/java/ca/bc/gov/app/TestConstants.java @@ -57,7 +57,7 @@ public class TestConstants { "code": "BC0772006", "name": "U3 POWER CORP.", "status": "ACTIVE", - "clientType": "SP" + "legalType": "SP" } ]"""; @@ -153,7 +153,7 @@ public class TestConstants { "code": "BC0772006", "name": "U3 POWER CORP.", "status": "ACTIVE", - "clientType": "SP" + "legalType": "SP" }"""; public static final String OPENMAPS_OK = """ diff --git a/backend/src/test/java/ca/bc/gov/app/controller/client/ClientControllerIntegrationTest.java b/backend/src/test/java/ca/bc/gov/app/controller/client/ClientControllerIntegrationTest.java index ff41be4d46..20da78f123 100644 --- a/backend/src/test/java/ca/bc/gov/app/controller/client/ClientControllerIntegrationTest.java +++ b/backend/src/test/java/ca/bc/gov/app/controller/client/ClientControllerIntegrationTest.java @@ -68,10 +68,10 @@ void shouldListCodesAsExpected() { .expectStatus().isOk() .expectBody() .jsonPath("$[0].code").isNotEmpty() - .jsonPath("$[0].code").isEqualTo("C") + .jsonPath("$[0].code").isEqualTo("A") .jsonPath("$[1].code").isNotEmpty() - .jsonPath("$[1].code").isEqualTo("Z"); + .jsonPath("$[1].code").isEqualTo("C"); } diff --git a/backend/src/test/java/ca/bc/gov/app/service/client/ClientServiceIntegrationTest.java b/backend/src/test/java/ca/bc/gov/app/service/client/ClientServiceIntegrationTest.java index e25beb7e3b..a4445c3dc0 100644 --- a/backend/src/test/java/ca/bc/gov/app/service/client/ClientServiceIntegrationTest.java +++ b/backend/src/test/java/ca/bc/gov/app/service/client/ClientServiceIntegrationTest.java @@ -25,8 +25,8 @@ class ClientServiceIntegrationTest extends AbstractTestContainerIntegrationTest void shouldListCodeAsExpected(LocalDate date) { StepVerifier .create(service.findActiveClientTypeCodes(date)) - .assertNext(results -> assertEquals("C", results.code())) - .expectNextCount(1) + .assertNext(results -> assertEquals("A", results.code())) + .expectNextCount(11) .verifyComplete(); } diff --git a/frontend/components.d.ts b/frontend/components.d.ts index cf70b084b1..bb66dedef8 100644 --- a/frontend/components.d.ts +++ b/frontend/components.d.ts @@ -15,13 +15,13 @@ declare module '@vue/runtime-core' { BCardHeader: typeof import('bootstrap-vue-3')['BCardHeader'] BCol: typeof import('bootstrap-vue-3')['BCol'] BCollapse: typeof import('bootstrap-vue-3')['BCollapse'] + BFormGroup: typeof import('bootstrap-vue-3')['BFormGroup'] BFormInput: typeof import('bootstrap-vue-3')['BFormInput'] + BFormRadio: typeof import('bootstrap-vue-3')['BFormRadio'] BFormSelect: typeof import('bootstrap-vue-3')['BFormSelect'] BPopover: typeof import('bootstrap-vue-3')['BPopover'] BRow: typeof import('bootstrap-vue-3')['BRow'] BTab: typeof import('bootstrap-vue-3')['BTab'] BTabs: typeof import('bootstrap-vue-3')['BTabs'] - RouterLink: typeof import('vue-router')['RouterLink'] - RouterView: typeof import('vue-router')['RouterView'] } } diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 4770dc5644..36ae51b9b5 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -8,8 +8,11 @@ :title="tab.title" :key="index" :active="index == 0" - > + > + + @@ -26,6 +29,8 @@ import { navBlue, navSelectBlue } from "./utils/color"; const keycloak: KeycloakInstance | undefined = inject("keycloak"); let tabs: Ref> = ref([]); +let bceidBusinessName = ref(); +let userId = ref(); if (keycloak && keycloak.tokenParsed && @@ -34,6 +39,8 @@ if (keycloak && } else { tabs.value = [{ title: "Apply a New Client", content: ApplyClientNumber }]; + bceidBusinessName = keycloak && keycloak.tokenParsed ? keycloak.tokenParsed.displayed : "Dev Test Client Name"; + userId = keycloak && keycloak.tokenParsed ? keycloak.subject : "devtest@gov.bc.ca"; } diff --git a/frontend/src/common/LabelComponent.vue b/frontend/src/common/LabelComponent.vue index 3e22ef5122..363929c616 100644 --- a/frontend/src/common/LabelComponent.vue +++ b/frontend/src/common/LabelComponent.vue @@ -3,14 +3,21 @@ - - - +
+   + + + + + +
diff --git a/frontend/src/dto/ApplyClientNumberDto.ts b/frontend/src/dto/ApplyClientNumberDto.ts index 5b9fe6a359..42430efff2 100644 --- a/frontend/src/dto/ApplyClientNumberDto.ts +++ b/frontend/src/dto/ApplyClientNumberDto.ts @@ -1,10 +1,11 @@ import type { CodeDescrType } from "@/core/CommonTypes"; export interface FormDataDto { - businessType: { - clientType: CodeDescrType; - }; + userId: string, businessInformation: { + businessType: string, + legalType: string, + clientType: string; incorporationNumber: string; businessName: null | string; goodStanding: string; @@ -42,10 +43,11 @@ export interface Contact { } export const formDataDto: FormDataDto = { - businessType: { - clientType: { value: "", text: "" }, - }, + userId: "", businessInformation: { + businessType: "", + legalType: "", + clientType: "", incorporationNumber: "", businessName: "", goodStanding: "", diff --git a/frontend/src/pages/applyclientnumber/ApplyClientNumberPage.vue b/frontend/src/pages/applyclientnumber/ApplyClientNumberPage.vue index 9c44f5b4a3..e58dd4cc33 100644 --- a/frontend/src/pages/applyclientnumber/ApplyClientNumberPage.vue +++ b/frontend/src/pages/applyclientnumber/ApplyClientNumberPage.vue @@ -1,47 +1,53 @@