diff --git a/processor/src/main/java/ca/bc/gov/app/service/client/ClientSubmissionProcessingService.java b/processor/src/main/java/ca/bc/gov/app/service/client/ClientSubmissionProcessingService.java index c9ca72cce1..727e43759d 100644 --- a/processor/src/main/java/ca/bc/gov/app/service/client/ClientSubmissionProcessingService.java +++ b/processor/src/main/java/ca/bc/gov/app/service/client/ClientSubmissionProcessingService.java @@ -33,7 +33,7 @@ public Mono> processSubmission( return submissionRepository .findById(submissionId) - .doOnNext(submission -> log.info("Loaded submission {}", submission)) + .doOnNext(submission -> log.info("Loaded submission {} created by {}", submission.getSubmissionId(), submission.getCreatedBy())) .flatMap(event -> submissionDetailRepository .findBySubmissionId(submissionId) @@ -60,6 +60,10 @@ public Mono> processSubmission( details.getClientTypeCode()) .withParameter(ApplicationConstant.MATCHED_USER, matching.getCreatedBy()) + .withParameter(ApplicationConstant.CREATED_BY, + event.getCreatedBy()) + .withParameter(ApplicationConstant.UPDATED_BY, + event.getUpdatedBy()) ) ) ); diff --git a/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyAbstractPersistenceService.java b/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyAbstractPersistenceService.java index b906b73304..e6569e5669 100644 --- a/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyAbstractPersistenceService.java +++ b/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyAbstractPersistenceService.java @@ -262,8 +262,8 @@ public Mono> createContact(MessagingWrapper m StringUtils.EMPTY ), submissionContact.getEmailAddress(), - ApplicationConstant.PROCESSOR_USER_NAME, - ApplicationConstant.PROCESSOR_USER_NAME, + getUser(message, ApplicationConstant.CREATED_BY), + getUser(message, ApplicationConstant.UPDATED_BY), ApplicationConstant.ORG_UNIT ) ) diff --git a/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyRegisteredSPPersistenceService.java b/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyRegisteredSPPersistenceService.java index 36007b587b..05a3d1606d 100644 --- a/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyRegisteredSPPersistenceService.java +++ b/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyRegisteredSPPersistenceService.java @@ -75,14 +75,14 @@ public Mono> generateForestClient( ) //if Staff submitted, get the client name from the submission as doing business as - .doOnNext(submissionDetail -> { + .doOnNext(submissionDetail -> atomicClientName.set( Optional .ofNullable(submissionDetail.getDoingBusinessAs()) .filter(StringUtils::isNotBlank) .orElse(submissionDetail.getOrganizationName()) - ); - }) + ) + ) .map(submissionDetail -> getBaseForestClient( diff --git a/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyService.java b/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyService.java index a75f3c8869..ac5608d80a 100644 --- a/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyService.java +++ b/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyService.java @@ -57,8 +57,7 @@ public Mono createLocation( null, "N", StringUtils.defaultString(detail.getNotes()), - ApplicationConstant.PROCESSOR_USER_NAME, - ApplicationConstant.PROCESSOR_USER_NAME, + user, user, ApplicationConstant.ORG_UNIT, ApplicationConstant.ORG_UNIT ); @@ -71,8 +70,6 @@ public Mono createContact(ForestClientContactDto dto) { return postRequestToLegacy( "/api/contacts", dto - .withCreatedBy(ApplicationConstant.PROCESSOR_USER_NAME) - .withUpdatedBy(ApplicationConstant.PROCESSOR_USER_NAME) ) .thenReturn(dto.clientNumber()); } @@ -81,8 +78,6 @@ public Mono createClient(ForestClientDto dto) { return postRequestToLegacy( "/api/clients", dto - .withCreatedBy(ApplicationConstant.PROCESSOR_USER_NAME) - .withUpdatedBy(ApplicationConstant.PROCESSOR_USER_NAME) ); } @@ -97,8 +92,8 @@ public Mono createDoingBusinessAs( new ClientDoingBusinessAsDto( clientNumber, doingBusinessAsName, - Objects.toString(createdBy,ApplicationConstant.PROCESSOR_USER_NAME), - Objects.toString(updatedBy,ApplicationConstant.PROCESSOR_USER_NAME), + Objects.toString(createdBy, ApplicationConstant.PROCESSOR_USER_NAME), + Objects.toString(updatedBy, ApplicationConstant.PROCESSOR_USER_NAME), ApplicationConstant.ORG_UNIT ) )