Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(be:FSADT1-1419): Client ID is not being saved #1054

Merged
merged 6 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading