AshharAhmadKhan opened a new pull request, #6217: URL: https://github.com/apache/fineract/pull/6217
## Description `createEntityAccess(JsonCommand command)` has been an empty stub returning null since the file was first created in `9d11434ee7` (Dec 6 2014). There is no API route, `CommandWrapperBuilder` method, permission record, or command handler for it anywhere in the codebase, and there never has been. `addNewEntityAccess(...)` was implemented from the start and did have one caller, `FineractEntityAccessUtil.checkConfigurationAndAddProductResrictionsForUserOffice(...)`. That changed in `66f8d7ce43` (June 9 2016), which rewrote the caller to call `fineractEntityToEntityMappingRepository.save(...)` directly instead, bypassing the write service entirely. Since then `addNewEntityAccess` has had zero callers. Alongside these two methods, the underlying `FineractEntityAccess` domain object, its repository, its repository wrapper, and the `m_entity_to_entity_access` table are only ever referenced from inside these two dead methods. Nothing else touches them. The live access control path, `FineractEntityAccessUtil`, used by Charges, Loan Products, and Savings Products, reads from `m_entity_to_entity_mapping` via `FineractEntityAccessReadServiceImpl`. This is a separate table from `m_entity_to_entity_access`. `createEntityToEntityMapping`, `updateEntityToEntityMapping`, and `deleteEntityToEntityMapping` stay exactly as they are and are not touched by this change. `m_entity_to_entity_access` has 0 rows in `load_sample_data.sql` and the project's generated schema docs list it at 0 rows as well. ### Changes made - Deleted `FineractEntityAccess.java` (domain) - Deleted `FineractEntityAccessRepository.java` - Deleted `FineractEntityAccessRepositoryWrapper.java` - Deleted `FineractEntityAccessData.java` - Deleted `FineractEntityAccessConstants.java` - Deleted `FineractEntityAccessConfigurationException.java` - Removed `createEntityAccess` and `addNewEntityAccess` from `FineractEntityAccessWriteService.java` and `FineractEntityAccessWriteServiceImpl.java`, along with the now-unused `entityAccessRepository` field, constructor param, and dead imports - Removed the commented-out `updateEntityAccess`/`removeEntityAccess` stubs from the interface - Added `0243_remove_unused_entity_access.xml`, a Liquibase changeset that drops `m_entity_to_entity_access` - Removed the `m_entity_to_entity_access` table definition and sample data block from `barebones_db.sql` and `load_sample_data.sql` ### Verification - Full-repo grep across `.java`, `.xml`, `.sql` for `FineractEntityAccess`, `FineractEntityAccessRepository`, `FineractEntityAccessRepositoryWrapper`, `FineractEntityAccessData`, `FineractEntityAccessConfigurationException`, and `FineractEntityAccessConstants`. No stragglers, all hits excluded as still-live (`FineractEntityAccessType`, `FineractEntityAccessNotFoundException`, `FineractEntityAccessUtil`, `FineractEntityAccessReadService`) - No reference to either method in `fineract-client` or `fineract-client-feign`, no OpenAPI/swagger entry for `createEntityAccess` - Test file grep across the repo. No results, no test references either method or class Discussed on the dev mailing list first: `[DISCUSS] ENTITYACCESS | createEntityAccess never implemented since 2014` Ticket: [FINERACT-2736](https://issues.apache.org/jira/browse/FINERACT-2736) -- 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]
