Fix(FINERACT-2320): Return false instead of 403 when Loan COB job is disabled

This commit is contained in:
Shiv Deshpande
2026-01-15 10:12:33 +01:00
committed by Adam Saghy
parent 07d67493df
commit 8f2dbe476c
@@ -86,7 +86,6 @@ public class LoanCOBCatchUpApiResource {
@Produces({ MediaType.APPLICATION_JSON })
@Operation(summary = "Retrieves whether Loan COB catch up is running", description = "Retrieves whether Loan COB catch up is running, and the current execution date if it is running.")
public IsCatchUpRunningDTO isCatchUpRunning() {
return loanCOBCatchUpServiceOp.map(LoanCOBCatchUpService::isCatchUpRunning)
.orElseThrow(() -> new JobIsNotFoundOrNotEnabledException(JobName.LOAN_COB.name()));
return loanCOBCatchUpServiceOp.map(LoanCOBCatchUpService::isCatchUpRunning).orElseGet(() -> new IsCatchUpRunningDTO(false, null));
}
}