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

   ## Description
   
   JIRA: https://issues.apache.org/jira/browse/FINERACT-2583
   
   Three methods were executing per-iteration repository queries where all IDs 
were known before the loop:
   
   **HolidayWritePlatformServiceJpaRepositoryImpl.getSelectedOffices()**
   - `officeRepositoryWrapper.findOneWithNotFoundDetection(officeId)` was 
called on every iteration
   - Fix: collect IDs -> bulk `officeRepository.findAllById()` -> map lookup
   - `OfficeRepository` injected directly (same pattern as FINERACT-2579)
   
   **ProvisioningCriteriaAssembler.parseLoanProducts()**
   - `loanProductRepository.findById(productId).orElse(null)` was called on 
every product
   - Fix: collect IDs -> bulk `findAllById()` -> `map.getOrDefault(id, null)`
   - Preserves null-tolerant behavior of original (orElse(null))
   
   **CollateralAssembler.fromParsedJson()**
   - `codeValueRepository.findOneWithNotFoundDetection(collateralTypeId)` was 
called on every item
   - Fix: collect IDs -> bulk fetch -> map lookup
   - Throws `CodeValueNotFoundException` for missing IDs to replicate original 
behavior
   
   Same class of redundancy as FINERACT-2579. No logic changes.


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