You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by "elnafateh (via GitHub)" <gi...@apache.org> on 2026/08/07 12:47:16 UTC

[PR] FINERACT-2740: Reviewed loan-loss provisioning entry lifecycle [fineract]

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

   ## Description
   
   Describe the changes made and why they were made. (Ignore if these details are present on the associated Apache Fineract JIRA ticket.)
   
   ## 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.
   - [x] 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).
   - [x] If merging this PR resolves a JIRA issue, I will mark that issue as resolved and set "Fix Version/s" appropriately.
   
   Your assigned reviewer(s) will follow our [guidelines for code reviews](https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide).
   


-- 
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: issues-unsubscribe@fineract.apache.org

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


Re: [PR] FINERACT-2740: Reviewed loan-loss provisioning entry lifecycle [fineract]

Posted by "elnafateh (via GitHub)" <gi...@apache.org>.
elnafateh closed pull request #6243: FINERACT-2740: Reviewed loan-loss provisioning entry lifecycle
URL: https://github.com/apache/fineract/pull/6243


-- 
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: issues-unsubscribe@fineract.apache.org

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


Re: [PR] FINERACT-2740: Reviewed loan-loss provisioning entry lifecycle [fineract]

Posted by "adamsaghy (via GitHub) via issues" <is...@fineract.apache.org>.
adamsaghy commented on PR #6243:
URL: https://github.com/apache/fineract/pull/6243#issuecomment-7070703505

   Thanks @elnafateh for your patience. I replied on the dev list thread: https://lists.apache.org/thread/od338tzbmd73dyjy7wk9hknj8n7w4csy
   
   Short version of how I'd like to proceed:
   
   **1. Split out the actual gap into a small PR first.** Generating and posting are already separate commands with separate permissions (`CREATE_PROVISIONENTRIES` / `CREATE_PROVISIONJOURNALENTRIES`), and posting can be put under maker-checker. The path that skips any review is the "Generate Loan Loss Provisioning" job, which hardcodes `addJournalEntries = true`. A global configuration (default = current behaviour) that lets the job generate without posting closes that gap with very little code.
   
   **2. Keep the review lifecycle in this PR, but behind its own opt-in configuration (default off).** On top of the points in the earlier review (opt-in, status on GET, changelog placement, permissions out of `0002_initial_data`, tests), please also look at these:
   
   - **A rejected entry blocks its date for good.** There can only be one entry per date (`findByProvisioningEntryDate` → `ProvisioningEntryAlreadyCreatedException`), recreate is only allowed in DRAFT, REJECTED has no further transitions and there is no delete endpoint. Rejecting e.g. the month-end entry because the criteria were wrong means that date can never get a correct entry. There needs to be a way forward after rejection (allow recreate from REJECTED back to DRAFT, or let a new entry replace a rejected one for the same date).
   - **Job behaviour when the config is on.** The tasklet catches `Exception`, so with the current change it does not fail visibly: every run logs an error and persists nothing, because the check fires before `saveAndFlush`. When the review step is enabled, the job (and `createjournalentries=true` on create) should create a DRAFT entry and skip posting instead.
   - **Self-approval.** The user who created the entry can approve it. For a feature motivated by review/integrity, either reject approval by the creator when the config is on, or document that segregation of duties relies on permissions/maker-checker.
   - **Backfill.** Changeset 2 marks every existing row APPROVED, including entries that were never posted (`journal_entry_created = false`). If someone later enables the feature, those unreviewed entries count as approved. I'd backfill only posted entries as APPROVED and leave the rest as DRAFT.
   - **Date validation.** `approvedOnDate` / `rejectedOnDate` are taken from the request as-is. Please validate them (not in the future, not before the entry date) and reject unknown parameters through the deserializer, like the create command does.
   - **Ordering of drafts.** Posting is cumulative and `validateForCreateJournalEntry` only allows dates after the latest posted entry. Once a later entry is posted, older DRAFT/APPROVED entries can never be posted. It would help to reject approval of an entry dated on or before the latest posted one, so reviewers aren't approving something that can't be posted.
   
   Also, the branch has conflicts with `develop` and `regression-safety-db-changes` is failing, so a rebase is needed (the latest changelog part on `develop` is now `0286`; use the next free number and include it from `changelog-tenant.xml`).
   


-- 
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: issues-unsubscribe@fineract.apache.org

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


Re: [PR] FINERACT-2740: Reviewed loan-loss provisioning entry lifecycle [fineract]

Posted by "elnafateh (via GitHub)" <gi...@apache.org>.
elnafateh commented on PR #6243:
URL: https://github.com/apache/fineract/pull/6243#issuecomment-5246727736

   > Would you mind to share these changes and the introduced new workflow on the fineract dev mail list?
   
   yes, it's done


-- 
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: issues-unsubscribe@fineract.apache.org

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


Re: [PR] FINERACT-2740: Reviewed loan-loss provisioning entry lifecycle [fineract]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #6243:
URL: https://github.com/apache/fineract/pull/6243#issuecomment-6512299154

   This pull request seems to be stale.  Are you still planning to work on it?  We will automatically close it in 30 days.


-- 
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: issues-unsubscribe@fineract.apache.org

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


Re: [PR] FINERACT-2740: Reviewed loan-loss provisioning entry lifecycle [fineract]

Posted by "elnafateh (via GitHub) via issues" <is...@fineract.apache.org>.
elnafateh commented on PR #6243:
URL: https://github.com/apache/fineract/pull/6243#issuecomment-6976753532

   @adamsaghy No response on the dev mailing list yet, though @galovics left a reasonable review here. How would you like to proceed with this PR?


-- 
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: issues-unsubscribe@fineract.apache.org

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


Re: [PR] FINERACT-2740: Reviewed loan-loss provisioning entry lifecycle [fineract]

Posted by "elnafateh (via GitHub)" <gi...@apache.org>.
elnafateh commented on PR #6243:
URL: https://github.com/apache/fineract/pull/6243#issuecomment-5251651263

   > > > Would you mind to share these changes and the introduced new workflow on the fineract dev mail list?
   > > 
   > > 
   > > yes, it's done
   > 
   > https://lists.apache.org/thread/od338tzbmd73dyjy7wk9hknj8n7w4csy
   
   Will keep track, thanks


-- 
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: issues-unsubscribe@fineract.apache.org

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


Re: [PR] FINERACT-2740: Reviewed loan-loss provisioning entry lifecycle [fineract]

Posted by "elnafateh (via GitHub)" <gi...@apache.org>.
elnafateh commented on PR #6243:
URL: https://github.com/apache/fineract/pull/6243#issuecomment-5239594303

   @adamsaghy kindly review 


-- 
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: issues-unsubscribe@fineract.apache.org

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


Re: [PR] FINERACT-2740: Reviewed loan-loss provisioning entry lifecycle [fineract]

Posted by "elnafateh (via GitHub)" <gi...@apache.org>.
elnafateh commented on PR #6243:
URL: https://github.com/apache/fineract/pull/6243#issuecomment-5230876986

   kindly rerun tests


-- 
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: issues-unsubscribe@fineract.apache.org

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


Re: [PR] FINERACT-2740: Reviewed loan-loss provisioning entry lifecycle [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on PR #6243:
URL: https://github.com/apache/fineract/pull/6243#issuecomment-5251423092

   > > Would you mind to share these changes and the introduced new workflow on the fineract dev mail list?
   > 
   > yes, it's done
   
   https://lists.apache.org/thread/od338tzbmd73dyjy7wk9hknj8n7w4csy


-- 
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: issues-unsubscribe@fineract.apache.org

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


Re: [PR] FINERACT-2740: Reviewed loan-loss provisioning entry lifecycle [fineract]

Posted by "feryn-demo (via GitHub) via issues" <is...@fineract.apache.org>.
feryn-demo commented on PR #6243:
URL: https://github.com/apache/fineract/pull/6243#issuecomment-7080755118

   Two changes in this PR break existing behaviour.
   
   * `ProvisioningEntriesWritePlatformServiceJpaRepositoryImpl.java` line 175: `validateCanCreateJournalEntries()` always throws for a new `DRAFT` entry. The job "Generate Loan Loss Provisioning" and `createjournalentries=true` both fail, and the job persists no entry.
   * `0242_add_provisioning_entry_approval_lifecycle.xml` changeset 2: the update sets `status_enum = 200` on every row of `m_provisioning_history`. Entries with `journal_entry_created = false` become `APPROVED` without any review.


-- 
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: issues-unsubscribe@fineract.apache.org

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


Re: [PR] FINERACT-2740: Reviewed loan-loss provisioning entry lifecycle [fineract]

Posted by "elnafateh (via GitHub)" <gi...@apache.org>.
elnafateh commented on PR #6243:
URL: https://github.com/apache/fineract/pull/6243#issuecomment-5237739435

   @adamsaghy kindly rerun tests


-- 
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: issues-unsubscribe@fineract.apache.org

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


Re: [PR] FINERACT-2740: Reviewed loan-loss provisioning entry lifecycle [fineract]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #6243:
URL: https://github.com/apache/fineract/pull/6243#issuecomment-5642197496

   This pull request seems to be stale.  Are you still planning to work on it?  We will automatically close it in 30 days.


-- 
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: issues-unsubscribe@fineract.apache.org

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


Re: [PR] FINERACT-2740: Reviewed loan-loss provisioning entry lifecycle [fineract]

Posted by "elnafateh (via GitHub)" <gi...@apache.org>.
elnafateh commented on PR #6243:
URL: https://github.com/apache/fineract/pull/6243#issuecomment-5645382660

   > This pull request seems to be stale. Are you still planning to work on it? We will automatically close it in 30 days.
   
   yes


-- 
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: issues-unsubscribe@fineract.apache.org

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


Re: [PR] FINERACT-2740: Reviewed loan-loss provisioning entry lifecycle [fineract]

Posted by "feryn-demo (via GitHub) via issues" <is...@fineract.apache.org>.
feryn-demo commented on code in PR #6243:
URL: https://github.com/apache/fineract/pull/6243#discussion_r4658551544


##########
fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/service/ProvisioningEntriesWritePlatformServiceJpaRepositoryImpl.java:
##########
@@ -166,6 +167,12 @@ public ProvisioningEntry createProvisioningEntry(LocalDate date, boolean addJour
         Collection<LoanProductProvisioningEntry> entries = generateLoanProvisioningEntry(requestedEntry, date);
         requestedEntry.setProvisioningEntries(entries);
         if (addJournalEntries) {
+            // A freshly created entry is always DRAFT (see below), so this will always fail - which is
+            // intentional: immediate posting at creation time is exactly the gap this feature closes. Routing
+            // through the same guard used by the standalone journal-creation action (rather than silently
+            // ignoring the caller's request) keeps both entry points consistent and gives a clear error instead
+            // of a confusing silent no-op.
+            requestedEntry.validateCanCreateJournalEntries();

Review Comment:
   Every create with `addJournalEntries = true` fails here.
   
   * A new entry is always `DRAFT`, so `validateCanCreateJournalEntries()` always throws on this line.
   * The job "Generate Loan Loss Provisioning" calls this method with `addJournalEntries = true`. The job now persists no entry, because the throw happens before `saveAndFlush`.
   * `createjournalentries=true` on the create command also always fails, with no way to get a `DRAFT` entry in the same call.



-- 
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: issues-unsubscribe@fineract.apache.org

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