From 0d67ebd4e2f5ddc9509b94093c4072935028183e Mon Sep 17 00:00:00 2001 From: Maria Martinez Date: Thu, 21 Nov 2024 11:43:53 -0800 Subject: [PATCH] no message --- .../controller/client/ClientController.java | 4 +-- .../dto/legacy/ForestClientContactDto.java | 17 ++++++++++ .../dto/legacy/ForestClientDetailsDto.java | 24 ++++++++++++++ .../dto/legacy/ForestClientLocationDto.java | 33 +++++++++++++++++++ .../service/client/ClientLegacyService.java | 5 +-- .../gov/app/service/client/ClientService.java | 3 +- 6 files changed, 81 insertions(+), 5 deletions(-) create mode 100644 backend/src/main/java/ca/bc/gov/app/dto/legacy/ForestClientContactDto.java create mode 100644 backend/src/main/java/ca/bc/gov/app/dto/legacy/ForestClientDetailsDto.java create mode 100644 backend/src/main/java/ca/bc/gov/app/dto/legacy/ForestClientLocationDto.java diff --git a/backend/src/main/java/ca/bc/gov/app/controller/client/ClientController.java b/backend/src/main/java/ca/bc/gov/app/controller/client/ClientController.java index 27e0bd24d7..96c3017b17 100644 --- a/backend/src/main/java/ca/bc/gov/app/controller/client/ClientController.java +++ b/backend/src/main/java/ca/bc/gov/app/controller/client/ClientController.java @@ -4,7 +4,7 @@ import ca.bc.gov.app.dto.bcregistry.ClientDetailsDto; import ca.bc.gov.app.dto.client.ClientListDto; import ca.bc.gov.app.dto.client.ClientLookUpDto; -import ca.bc.gov.app.dto.legacy.ForestClientDto; +import ca.bc.gov.app.dto.legacy.ForestClientDetailsDto; import ca.bc.gov.app.exception.NoClientDataFound; import ca.bc.gov.app.service.client.ClientLegacyService; import ca.bc.gov.app.service.client.ClientService; @@ -55,7 +55,7 @@ public Mono getClientDetailsByIncorporationNumber( } @GetMapping("/details/{clientNumber}") - public Mono getClientDetailsByClientNumber( + public Mono getClientDetailsByClientNumber( @PathVariable String clientNumber, JwtAuthenticationToken principal ) { diff --git a/backend/src/main/java/ca/bc/gov/app/dto/legacy/ForestClientContactDto.java b/backend/src/main/java/ca/bc/gov/app/dto/legacy/ForestClientContactDto.java new file mode 100644 index 0000000000..b7eda00585 --- /dev/null +++ b/backend/src/main/java/ca/bc/gov/app/dto/legacy/ForestClientContactDto.java @@ -0,0 +1,17 @@ +package ca.bc.gov.app.dto.legacy; + +public record ForestClientContactDto( + String clientNumber, + String clientLocnCode, + String contactCode, + String contactName, + String businessPhone, + String secondaryPhone, + String faxNumber, + String emailAddress, + String createdBy, + String updatedBy, + Long orgUnit +) { + +} diff --git a/backend/src/main/java/ca/bc/gov/app/dto/legacy/ForestClientDetailsDto.java b/backend/src/main/java/ca/bc/gov/app/dto/legacy/ForestClientDetailsDto.java new file mode 100644 index 0000000000..7b0c175acc --- /dev/null +++ b/backend/src/main/java/ca/bc/gov/app/dto/legacy/ForestClientDetailsDto.java @@ -0,0 +1,24 @@ +package ca.bc.gov.app.dto.legacy; + +import java.util.List; + +public record ForestClientDetailsDto ( + String clientNumber, + String clientName, + String legalFirstName, + String legalMiddleName, + String clientStatusCode, + String clientTypeCode, + String clientIdTypeCode, + String clientIdentification, + String registryCompanyTypeCode, + String corpRegnNmbr, + String clientAcronym, + String wcbFirmNumber, + String ocgSupplierNmbr, + String clientComment, + List addresses, + List contacts +) { + +} diff --git a/backend/src/main/java/ca/bc/gov/app/dto/legacy/ForestClientLocationDto.java b/backend/src/main/java/ca/bc/gov/app/dto/legacy/ForestClientLocationDto.java new file mode 100644 index 0000000000..a396f4afc6 --- /dev/null +++ b/backend/src/main/java/ca/bc/gov/app/dto/legacy/ForestClientLocationDto.java @@ -0,0 +1,33 @@ +package ca.bc.gov.app.dto.legacy; + +import java.time.LocalDate; +import lombok.With; + +@With +public record ForestClientLocationDto( + String clientNumber, + String clientLocnCode, + String clientLocnName, + String addressOne, + String addressTwo, + String addressThree, + String city, + String province, + String postalCode, + String country, + String businessPhone, + String homePhone, + String cellPhone, + String faxNumber, + String emailAddress, + String locnExpiredInd, + LocalDate returnedMailDate, + String trustLocationInd, + String cliLocnComment, + String createdBy, + String updatedBy, + Long orgUnit +) { + +} + diff --git a/backend/src/main/java/ca/bc/gov/app/service/client/ClientLegacyService.java b/backend/src/main/java/ca/bc/gov/app/service/client/ClientLegacyService.java index 49eb7753e1..352c84c5cd 100644 --- a/backend/src/main/java/ca/bc/gov/app/service/client/ClientLegacyService.java +++ b/backend/src/main/java/ca/bc/gov/app/service/client/ClientLegacyService.java @@ -3,6 +3,7 @@ import ca.bc.gov.app.dto.client.ClientListDto; import ca.bc.gov.app.dto.legacy.AddressSearchDto; import ca.bc.gov.app.dto.legacy.ContactSearchDto; +import ca.bc.gov.app.dto.legacy.ForestClientDetailsDto; import ca.bc.gov.app.dto.legacy.ForestClientDto; import io.micrometer.observation.annotation.Observed; import java.time.LocalDate; @@ -88,7 +89,7 @@ public Flux searchLegacy( registrationNumber, companyName, dto.clientNumber())); } - public Mono searchByClientNumber( + public Mono searchByClientNumber( String clientNumber ) { log.info("Searching for client number {} in legacy", clientNumber); @@ -102,7 +103,7 @@ public Mono searchByClientNumber( .queryParam("clientNumber", clientNumber) .build(Map.of()) ) - .exchangeToMono(response -> response.bodyToMono(ForestClientDto.class)) + .exchangeToMono(response -> response.bodyToMono(ForestClientDetailsDto.class)) .doOnNext( dto -> log.info( "Found Legacy data for in legacy with client number {}", diff --git a/backend/src/main/java/ca/bc/gov/app/service/client/ClientService.java b/backend/src/main/java/ca/bc/gov/app/service/client/ClientService.java index 1d7505afc7..c712ac18f0 100644 --- a/backend/src/main/java/ca/bc/gov/app/service/client/ClientService.java +++ b/backend/src/main/java/ca/bc/gov/app/service/client/ClientService.java @@ -13,6 +13,7 @@ import ca.bc.gov.app.dto.client.ClientValueTextDto; import ca.bc.gov.app.dto.client.EmailRequestDto; import ca.bc.gov.app.dto.client.LegalTypeEnum; +import ca.bc.gov.app.dto.legacy.ForestClientDetailsDto; import ca.bc.gov.app.dto.legacy.ForestClientDto; import ca.bc.gov.app.exception.ClientAlreadyExistException; import ca.bc.gov.app.exception.InvalidAccessTokenException; @@ -142,7 +143,7 @@ public Mono getClientDetailsByIncorporationNumber( ))); } - public Mono getClientDetailsByClientNumber( + public Mono getClientDetailsByClientNumber( String clientNumber, String userId, String businessId,