Skip to content

Commit

Permalink
fix(FSADT1-1514): fixed doing business as processing
Browse files Browse the repository at this point in the history
- added to external users the DBA field filled
- fixed the DBA field on the processor
  • Loading branch information
paulushcgcj committed Sep 24, 2024
1 parent a4d33dc commit dded9d3
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { getValidations } from "@/helpers/validators/GlobalValidators";
import { submissionValidation } from "@/helpers/validators/SubmissionValidators";
// Importing helper functions
import { retrieveClientType, exportAddress } from "@/helpers/DataConversors";
import { formDataDto } from '../../dto/ApplyClientNumberDto';
import {
getEnumKeyByEnumValue,
adminEmail,
Expand Down Expand Up @@ -159,6 +160,7 @@ const autoCompleteResult = ref<BusinessSearchResult>();
watch([autoCompleteResult], () => {
// reset business validation state
validation.business = false;
formData.value.businessInformation.doingBusinessAs = null;
if (autoCompleteResult.value && autoCompleteResult.value.code) {
toggleErrorMessages(false, false, false);
Expand All @@ -172,6 +174,10 @@ watch([autoCompleteResult], () => {
);
showAutoCompleteInfo.value = false;
if(formData.value.businessInformation.clientType === 'RSP') {
formData.value.businessInformation.doingBusinessAs = autoCompleteResult.value.name;
}
emit("update:data", formData.value);
//Also, we will load the backend data to fill all the other information as well
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public final class ApplicationConstant {
public static final String MATCHING_KIND = "kind";
public static final String MATCHED_USER = "matched-user";
public static final String IS_DOING_BUSINESS_AS = "isDoingBusinessAs";
public static final String DOING_BUSINESS_AS = "isDoingBusinessAs";
public static final String DOING_BUSINESS_AS = "doingBusinessAsName";

public static final BcRegistryDocumentRequestBodyDto
BUSINESS_SUMMARY_FILING_HISTORY =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.RegExUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
Expand Down Expand Up @@ -320,13 +319,12 @@ private Mono<String> createClientDoingBusinessAs(MessagingWrapper<ForestClientDt
.just(clientNumber)
//FSADT1-1388: Allow doing business as based on parameter
.filter(
forestClientNumber -> BooleanUtils
.toBoolean(
message
.getParameter(
ApplicationConstant.IS_DOING_BUSINESS_AS,
String.class
)
forestClientNumber ->
Boolean.TRUE.equals(message
.getParameter(
ApplicationConstant.IS_DOING_BUSINESS_AS,
Boolean.class
)
)
)
.doOnNext(forestClientNumber ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,12 @@ public Mono<MessagingWrapper<ForestClientDto>> generateForestClient(

//if Staff submitted, get the client name from the submission as doing business as
.doOnNext(submissionDetail -> {
if (isStaffSubmitted(message)) {
atomicClientName.set(submissionDetail.getDoingBusinessAs());
}
atomicClientName.set(
Optional
.ofNullable(submissionDetail.getDoingBusinessAs())
.filter(StringUtils::isNotBlank)
.orElse(submissionDetail.getOrganizationName())
);
})

.map(submissionDetail ->
Expand Down Expand Up @@ -139,15 +142,7 @@ public Mono<MessagingWrapper<ForestClientDto>> generateForestClient(
message.parameters()
)
.withParameter(ApplicationConstant.FOREST_CLIENT_NAME,
BooleanUtils.toString(
isStaffSubmitted(message),
atomicClientName.get(),
Optional
.ofNullable(forestClient.clientComment())
.filter(StringUtils::isNotBlank)
.map(comment -> comment.split("and company name ")[1])
.orElse(StringUtils.EMPTY)
)
atomicClientName.get().toUpperCase()
)
.withParameter(ApplicationConstant.REGISTRATION_NUMBER,
String.join(StringUtils.EMPTY,
Expand All @@ -161,16 +156,7 @@ public Mono<MessagingWrapper<ForestClientDto>> generateForestClient(
)
.withParameter(
ApplicationConstant.DOING_BUSINESS_AS,
BooleanUtils.toString(
isStaffSubmitted(message),
atomicClientName.get().toUpperCase(),
Optional
.ofNullable(forestClient.clientComment())
.filter(StringUtils::isNotBlank)
.map(comment -> comment.split("and company name ")[1])
.orElse(StringUtils.EMPTY)
.toUpperCase()
)
atomicClientName.get().toUpperCase()
)
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ private static Stream<Arguments> generateForestClient() {
.withParameter(ApplicationConstant.CREATED_BY, "IDIR\\JWICK")
.withParameter(ApplicationConstant.UPDATED_BY, "IDIR\\JWICK")
.withParameter(ApplicationConstant.FOREST_CLIENT_NAME,
"Baxter Corp")
"BAXTER CORP")
.withParameter(ApplicationConstant.REGISTRATION_NUMBER, "FM00184546")
.withParameter(ApplicationConstant.IS_DOING_BUSINESS_AS, true)
.withParameter(ApplicationConstant.DOING_BUSINESS_AS, "BAXTER CORP"),
Expand Down Expand Up @@ -497,7 +497,7 @@ private static Stream<Arguments> generateForestClient() {
.withParameter(ApplicationConstant.CREATED_BY, "IDIR\\JWICK")
.withParameter(ApplicationConstant.UPDATED_BY, "IDIR\\JWICK")
.withParameter(ApplicationConstant.FOREST_CLIENT_NAME,
"Baxter Corp")
"BAXTER CORP")
.withParameter(ApplicationConstant.REGISTRATION_NUMBER, "FM00184546")
.withParameter(ApplicationConstant.IS_DOING_BUSINESS_AS, true)
.withParameter(ApplicationConstant.DOING_BUSINESS_AS, "BAXTER CORP"),
Expand Down Expand Up @@ -638,7 +638,7 @@ private static Stream<Arguments> generateDoingBusinessAs() {
.withParameter(ApplicationConstant.CREATED_BY, "IDIR\\JWICK")
.withParameter(ApplicationConstant.UPDATED_BY, "IDIR\\JWICK")
.withParameter(ApplicationConstant.FOREST_CLIENT_NAME,
"Baxter Corp")
"BAXTER CORP")
.withParameter(ApplicationConstant.REGISTRATION_NUMBER, "FM00184546")
.withParameter(ApplicationConstant.IS_DOING_BUSINESS_AS, true)
.withParameter(ApplicationConstant.DOING_BUSINESS_AS, "BAXTER CORP")
Expand Down

0 comments on commit dded9d3

Please sign in to comment.