You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by GitBox <gi...@apache.org> on 2022/11/29 14:48:33 UTC

[GitHub] [fineract] adamsaghy commented on a diff in pull request #2777: [FINERACT-1678] Loan COB Catch Up

adamsaghy commented on code in PR #2777:
URL: https://github.com/apache/fineract/pull/2777#discussion_r1034853850


##########
fineract-provider/src/main/java/org/apache/fineract/cob/common/InitialisationTasklet.java:
##########
@@ -41,11 +47,16 @@ public class InitialisationTasklet implements Tasklet {
 
     @Override
     public RepeatStatus execute(@NotNull StepContribution contribution, @NotNull ChunkContext chunkContext) throws Exception {
+        HashMap<BusinessDateType, LocalDate> businessDates = ThreadLocalContextUtil.getBusinessDates();
         AppUser user = userRepository.fetchSystemUser();
         UsernamePasswordAuthenticationToken auth = new UsernamePasswordAuthenticationToken(user, user.getPassword(),
                 new NullAuthoritiesMapper().mapAuthorities(user.getAuthorities()));
         SecurityContextHolder.getContext().setAuthentication(auth);
         ThreadLocalContextUtil.setActionContext(ActionContext.COB);
+        String businessDate = Objects.requireNonNull((String) chunkContext.getStepContext().getStepExecution().getJobExecution()
+                .getExecutionContext().get(LoanCOBConstant.BUSINESS_DATE_PARAMETER_NAME));
+        businessDates.put(BusinessDateType.COB_DATE, LocalDate.parse(businessDate, DateTimeFormatter.ISO_DATE));

Review Comment:
   If we are about to support anyhow the SOB (Start of Business), we should update the other date (DEFAULT) as well, to the next day of the provided COB date. 
   This way if one of the Business steps would like to use the "following day" instead of the COB date, they can easily do that by setting the ActionContext to DEFAULT.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org