Ashhar Ahmad Khan created FINERACT-2755:
-------------------------------------------

             Summary: Remove unimplemented Teller/Cashier read endpoints 
(getCashierData, findTellerTransaction, fetchTellerTransactionsByTellerId, 
getJournals, fetchTellerJournals) that have silently returned null since 2013
                 Key: FINERACT-2755
                 URL: https://issues.apache.org/jira/browse/FINERACT-2755
             Project: Apache Fineract
          Issue Type: Task
            Reporter: Ashhar Ahmad Khan


What is being removed

Five methods on TellerManagementReadPlatformServiceImpl, all unimplemented 
stubs that return null:

getCashierData(officeId, tellerId, staffId, date)
findTellerTransaction(transactionId)
fetchTellerTransactionsByTellerId(tellerId, fromDate, toDate)
getJournals(officeId, tellerId, cashierId, dateFrom, dateTo)
fetchTellerJournals(tellerId, cashierId, fromDate, toDate)

These backed five REST endpoints across three resource classes:

GET /cashiers (CashierApiResource, operationId retrieveAllCashiers)
GET /tellers/\{tellerId}/transactions (TellerApiResource, operationId 
retrieveAllTransactionsForTeller)
GET /tellers/\{tellerId}/transactions/\{transactionId} (TellerApiResource, 
operationId retrieveOneTransactionForTeller)
GET /tellers/\{tellerId}/journals (TellerApiResource, operationId 
retrieveAllJournalsForTeller)
GET /cashiersjournal (TellerJournalApiResource, operationId 
retrieveAllCashierJournals)

None of the three resource classes null-check the return value, so all five 
endpoints return HTTP 204 with an empty body regardless of what is requested, 
including for resource IDs that do not exist.

CashierApiResource and TellerJournalApiResource have no other endpoints, so 
removing their one method removes the class entirely. TellerApiResource keeps 
its other working endpoints (create/update/delete cashier, settle cash, 
retrieve cashier transactions, retrieve cashier transactions with summary, 
retrieve cashier transaction template); only the three broken methods are 
removed from it.

 

Why it's dead code

Traced with git log --all -S on each method signature. All five appear only in 
the original Cash Management initial commit (5afed47767, 2013) and are touched 
afterward only by mechanical passes: the GSoC'17 Swagger integration, the 
FINERACT-835 automatic Swagger doc generation, the FINERACT-1779 Lombok 
conversion, and the FINERACT-2679 backward-compatible client method renaming. 
No commit in the repository's full history ever gives any of the five a real 
method body.

Verified directly against a local develop-branch build. All five endpoints 
return HTTP 204 with no error, including GET /tellers/1/transactions/1 queried 
against a transactionId that does not exist, which still returned 204 rather 
than 404.

Raised for community input on the dev list before removal:
https://lists.apache.org/thread/m972c6dgr46lob01smkryqwq6dxn7lms
No objections or concerns were raised in response.

 

Changes made

Deleted CashierApiResource.java (its only endpoint called the broken 
getCashierData)
Deleted TellerJournalApiResource.java (its only endpoint called the broken 
getJournals)
Removed the three broken endpoint methods (getTransactionData, 
findTransactionData, getJournalData) from TellerApiResource.java, along with 
the TellerTransactionData, TellerJournalData, and DateRange imports that became 
unused once those methods were removed
Removed all five method declarations from 
TellerManagementReadPlatformService.java, along with the TellerTransactionData 
and TellerJournalData imports that became unused
Removed all five method bodies from 
TellerManagementReadPlatformServiceImpl.java, along with the same two 
now-unused imports

 

Verification

grep across the full repo for each method name and for 
TellerJournalData/TellerTransactionData returns no remaining references outside 
the removed code
No entry for any of the five operationIds or their @AlternativeOperationId 
aliases exists in fineract-client or fineract-client-feign; no generated SDK 
method wraps any of these five endpoints
The one integration test referencing the teller/cashier module, 
CashierTransactionsHelper.java, only calls retrieveCashierTransactions and 
retrieveCashierTransactionsWithSummary, both of which are implemented methods 
unaffected by this change
No cucumber .feature file references cashier or teller transaction/journal 
endpoints
:fineract-branch:compileJava and :fineract-provider:compileJava both build 
clean; spotlessCheck passes; all 15 existing tests in 
TellerWritePlatformServiceJpaImplTest pass unchanged



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to