Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
mamartinezmejia committed Nov 21, 2024
1 parent f13340b commit 0d67ebd
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -55,7 +55,7 @@ public Mono<ClientDetailsDto> getClientDetailsByIncorporationNumber(
}

@GetMapping("/details/{clientNumber}")
public Mono<ForestClientDto> getClientDetailsByClientNumber(
public Mono<ForestClientDetailsDto> getClientDetailsByClientNumber(
@PathVariable String clientNumber,
JwtAuthenticationToken principal
) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
) {

}
Original file line number Diff line number Diff line change
@@ -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<ForestClientLocationDto> addresses,
List<ForestClientContactDto> contacts
) {

}
Original file line number Diff line number Diff line change
@@ -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
) {

}

Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -88,7 +89,7 @@ public Flux<ForestClientDto> searchLegacy(
registrationNumber, companyName, dto.clientNumber()));
}

public Mono<ForestClientDto> searchByClientNumber(
public Mono<ForestClientDetailsDto> searchByClientNumber(
String clientNumber
) {
log.info("Searching for client number {} in legacy", clientNumber);
Expand All @@ -102,7 +103,7 @@ public Mono<ForestClientDto> 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 {}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -142,7 +143,7 @@ public Mono<ClientDetailsDto> getClientDetailsByIncorporationNumber(
)));
}

public Mono<ForestClientDto> getClientDetailsByClientNumber(
public Mono<ForestClientDetailsDto> getClientDetailsByClientNumber(
String clientNumber,
String userId,
String businessId,
Expand Down

0 comments on commit 0d67ebd

Please sign in to comment.