Skip to content

Commit

Permalink
Added configuration to recompute attendace on update muster roll
Browse files Browse the repository at this point in the history
  • Loading branch information
holashchand committed Dec 18, 2024
1 parent 7cfa96f commit 77ec306
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ public class MusterRollServiceConfiguration {
@Value("${works.contract.service.code}")
private String contractServiceCode;

@Value("${musterroll.update.recompute.attendance.enabled:false}")
private boolean recomputeAttendanceEnabled;

@PostConstruct
public void initialize() {
TimeZone.setDefault(TimeZone.getTimeZone(timeZone));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ private MusterRoll fetchExistingMusterRoll(MusterRoll musterRoll) {
* @return
*/
private boolean isComputeAttendance (MusterRoll musterRoll) {
if (musterRoll.getAdditionalDetails() != null) {
if (config.isRecomputeAttendanceEnabled() && musterRoll.getAdditionalDetails() != null) {
try {
JsonNode node = mapper.readTree(mapper.writeValueAsString(musterRoll.getAdditionalDetails()));
if (node.findValue(COMPUTE_ATTENDENSE) != null && StringUtils.isNotBlank(node.findValue(COMPUTE_ATTENDENSE).textValue())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,6 @@ works.bankaccounts.search.endpoint=/bankaccount-service/bankaccount/v1/_search

#-----------Contract service code------------#
works.contract.service.code=WORKS-CONTRACT

#-----------Muster roll update api config------------#
musterroll.update.recompute.attendance.enabled=false

0 comments on commit 77ec306

Please sign in to comment.