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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to