rymghosn commented on PR #6209:
URL: https://github.com/apache/fineract/pull/6209#issuecomment-5993213686

   @adamsaghy Rebased on latest `develop` and reworked per your review:
   
   - **No new native queries or CTEs.** Mappings are read through 
`FineractEntityToEntityMappingRepository` with an interface projection 
(fromId/toId). The office line comes from JPQL on `Office.hierarchy`, and the 
loan/savings office from JPQL repository queries.
   - **Visibility is computed once and cached, then applied by id.** 
`FineractEntityAccessReadService.retrieveOfficeEntityAccess` works out, per 
office and relation, which ids are restricted and which are granted. It is 
cached per tenant/office (`officeEntityAccess`) and evicted on entity-mapping 
create/update/delete, on office create/update, and when a product or charge is 
auto-restricted on creation. Read services no longer append IN-clauses; they 
include or exclude rows by id.
   - The three near-duplicate V2 lookup methods and the charge overloads now 
share one implementation each.
   - The entity-to-entity mapping scoping change is no longer in this PR; it 
lives only in #6197.
   - Charge filtering (FINERACT-2728) stays squashed in, as agreed earlier.
   - **Tests:** added unit tests for the visibility rules and a Feign 
integration test (`FeignOfficeSpecificLoanProductVisibilityTest`). It checks 
that unmapped, ancestor-mapped and own-office-mapped products show up in a 
branch client's loans template, a sibling-office-mapped one does not, and 
nothing changes with the flag off.
   
   One behaviour to note: a product mapped to an office is now visible to that 
office's child offices (ancestor lookup), which matches what the PR description 
intended. The previous code walked descendants instead.
   


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