Shivd131 opened a new pull request, #5291:
URL: https://github.com/apache/fineract/pull/5291

   ## Description
   Fixes [FINERACT-2320](https://issues.apache.org/jira/browse/FINERACT-2320).
   
   **The Issue:**
   When `fineract.job.loan-cob-enabled` is set to `false`, the API endpoint 
`/loans/is-catch-up-running` throws a `JobIsNotFoundOrNotEnabledException`. 
This results in a `403 Forbidden` (or sometimes `400 Bad Request`) response, 
causing the "Manage Jobs" UI to display an error message unnecessarily.
   
   **The Fix:**
   Modified `LoanCOBCatchUpApiResource.java` to handle the empty Service 
`Optional` gracefully. Instead of throwing an exception, the API now correctly 
returns `200 OK` with a payload indicating the job is not running: 
`{"catchUpRunning": false}`.
   
   **Verification:**
   - Reproduced the issue locally by setting `export 
FINERACT_JOB_LOAN_COB_ENABLED=false`.
   - Confirmed the API previously returned `400/403`.
   - Applied the fix and confirmed via cURL that the API now returns `200 OK`.
   ```bash
   shivd@Shiv_Laptop MINGW64 ~/Documents/mifos/fineract (develop)
   $ curl -k -i -u mifos:password   -H "Fineract-Platform-TenantId: default"   
-X GET 
"https://localhost:8443/fineract-provider/api/v1/loans/is-catch-up-running";
   HTTP/1.1 200 
   X-Notification-Refresh: false
   Vary: Origin
   Vary: Access-Control-Request-Method
   Vary: Access-Control-Request-Headers
   X-Content-Type-Options: nosniff
   X-XSS-Protection: 0
   Cache-Control: no-cache, no-store, max-age=0, must-revalidate
   Pragma: no-cache
   Expires: 0
   Strict-Transport-Security: max-age=31536000 ; includeSubDomains
   X-Frame-Options: DENY
   Content-Type: application/json
   Content-Length: 24
   Date: Tue, 06 Jan 2026 18:37:55 GMT
   
   {"catchUpRunning":false}
   ```
   ## Checklist
   
   Please make sure these boxes are checked before submitting your pull request 
- thanks!
   
   - [x] Write the commit message as per [our 
guidelines](https://github.com/apache/fineract/blob/develop/CONTRIBUTING.md#pull-requests)
   - [x] Acknowledge that we will not review PRs that are not passing the build 
_("green")_ - it is your responsibility to get a proposed PR to pass the build, 
not primarily the project's maintainers.
   - [ ] Create/update [unit or integration 
tests](https://fineract.apache.org/docs/current/#_testing) for verifying the 
changes made.
   - [x] Follow our [coding 
conventions](https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions).
   - [x] Add required Swagger annotation and update API documentation at 
fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with 
details of any API changes
   - [x] [This PR must not be a "code 
dump"](https://cwiki.apache.org/confluence/display/FINERACT/Pull+Request+Size+Limit).
 Large changes can be made in a branch, with assistance. Ask for help on the 
[developer mailing list](https://fineract.apache.org/#contribute).


-- 
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