Skip to content

Commit

Permalink
fix(be:FSADT1-1419): Client ID is not being saved (#1054)
Browse files Browse the repository at this point in the history
* fix(be:FSADT1-1419): Client ID is not being saved
  • Loading branch information
mamartinezmejia authored and paulushcgcj committed Aug 16, 2024
1 parent 0f9a83c commit 3d9a010
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,20 @@ public Mono<MessagingWrapper<ForestClientDto>> generateForestClient(
)
)
.withClientIdentification(
Objects.toString(
null == detailEntity.getIdentificationCode()
? Objects.toString(
detailEntity.getIdentificationCode(),
ProcessorUtil.splitName(
getUser(message, ApplicationConstant.CREATED_BY)
)[0]
)
: detailEntity.getClientIdentification()
)
.withClientNumber(message.payload())
.withAcronym(detailEntity.getClientAcronym())
)
.doOnNext(forestClient -> log.info("forest client generated for individual {}",
forestClient.clientIdTypeCode() + forestClient.clientIdentification()))
forestClient.clientIdTypeCode() + " " + forestClient.clientIdentification()))
.map(forestClient ->
new MessagingWrapper<>(forestClient, message.parameters())
.withParameter(ApplicationConstant.FOREST_CLIENT_NAME,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import ca.bc.gov.app.dto.legacy.ForestClientLocationDto;
import ca.bc.gov.app.entity.SubmissionLocationEntity;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.RegExUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
Expand Down Expand Up @@ -46,10 +47,10 @@ public Mono<String> createLocation(
detail.getProvinceCode().toUpperCase(),
detail.getPostalCode(),
detail.getCountryCode().toUpperCase(),
StringUtils.defaultString(detail.getBusinessPhoneNumber().replaceAll("\\D", "")),
RegExUtils.replaceAll(detail.getBusinessPhoneNumber(), "\\D", StringUtils.EMPTY),
StringUtils.EMPTY,
StringUtils.defaultString(detail.getSecondaryPhoneNumber().replaceAll("\\D", "")),
StringUtils.defaultString(detail.getFaxNumber().replaceAll("\\D", "")),
RegExUtils.replaceAll(detail.getSecondaryPhoneNumber(), "\\D", StringUtils.EMPTY),
RegExUtils.replaceAll(detail.getFaxNumber(), "\\D", StringUtils.EMPTY),
StringUtils.defaultString(detail.getEmailAddress()),
"N",
null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,13 @@ void shouldCreateForestClient() {
.submissionId(2)
.submissionDetailId(2)
.organizationName("James Baxter")
.firstName("James")
.lastName("Baxter")
.businessTypeCode("U")
.clientTypeCode("I")
.goodStandingInd("Y")
.identificationTypeCode("OTHR")
.clientIdentification("ABC:123")
.build();

when(submissionDetailRepository.findBySubmissionId(eq(2)))
Expand Down Expand Up @@ -98,8 +102,7 @@ void shouldCreateForestClient() {
"Jhon Snow submitted the individual with data acquired from BC Services Card")
.hasFieldOrPropertyWithValue("clientTypeCode", "I")
.hasFieldOrPropertyWithValue("clientIdTypeCode", "OTHR")
.hasFieldOrPropertyWithValue("clientIdentification",
"ottomated");
.hasFieldOrPropertyWithValue("clientIdentification", "ABC:123");

assertThat(message.parameters().get(ApplicationConstant.SUBMISSION_ID))
.isNotNull()
Expand Down

0 comments on commit 3d9a010

Please sign in to comment.