Skip to content

FINERACT-2722: Remove orphaned CashierWritePlatformService and ModifyCashierCommandHandler - #6198

Open
AshharAhmadKhan wants to merge 1 commit into
apache:developfrom
AshharAhmadKhan:FINERACT-2722-remove-orphaned-cashierwriteplatformservice
Open

FINERACT-2722: Remove orphaned CashierWritePlatformService and ModifyCashierCommandHandler#6198
AshharAhmadKhan wants to merge 1 commit into
apache:developfrom
AshharAhmadKhan:FINERACT-2722-remove-orphaned-cashierwriteplatformservice

Conversation

@AshharAhmadKhan

Copy link
Copy Markdown
Contributor

Description

Removes two dead classes from the teller/cashier module and one stale
javadoc reference.

CashierWritePlatformService
(fineract-branch/src/main/java/org/apache/fineract/organisation/teller/service/)
is a plain concrete class with no @Service or @Component
annotation. All three of its methods (allocateCashierToTeller,
deleteCashier, modifyCashier) are null stubs with no
implementation.

ModifyCashierCommandHandler
(fineract-branch/src/main/java/org/apache/fineract/organisation/teller/handler/)
injects CashierWritePlatformService through a constructor field and
calls modifyCashier on it. This handler has no @Service and no
@CommandType annotation, so Fineract's command dispatcher never
routes anything to it. Nothing else in the codebase constructs or
injects this handler.

Also removed a stale @see javadoc line in
DeleteCashierAllocationCommandHandler.java, which is live and
correctly wired to TellerWritePlatformService. The line pointed at
CashierWritePlatformService, which it never actually depended on.

Why this is safe

The live cashier-teller allocation path is
AllocateCashierToTellerCommandHandler, which calls
TellerWritePlatformService.allocateCashierToTeller(Long entityId, JsonCommand command),
implemented in TellerWritePlatformServiceJpaImpl.java line 197.
This is a separate class from CashierWritePlatformService that
happens to share method names.

Verification

  • Full-repo grep across .java, .xml, .yml, .yaml, .properties
    for both class names. Only the two deleted files and the one stale
    doc comment matched.
  • Permission table grep for MODIFYCASHIER / MODIFY_CASHIER. No
    results, no dangling m_permission row.
  • Reflection-based lookup grep (Class.forName, getBean). No
    results.
  • Test file grep across the repo (--include="*Test.java"). No
    results, no test references either class.

…CashierCommandHandler

CashierWritePlatformService contained only null-stub methods and had
no Spring annotation, never instantiated anywhere in the codebase.

ModifyCashierCommandHandler injected CashierWritePlatformService but
had no @service or @CommandType annotation, so it was never routed
to by the command dispatcher. Nothing else referenced it.

The live cashier-teller allocation path is
AllocateCashierToTellerCommandHandler, which calls
TellerWritePlatformService.allocateCashierToTeller(Long, JsonCommand)
in TellerWritePlatformServiceJpaImpl, a separate class that happens
to share method names with the removed one.

Also removed a stale @see javadoc reference to
CashierWritePlatformService in DeleteCashierAllocationCommandHandler,
which is live and correctly wired to TellerWritePlatformService.

Verified via full-repo grep across java/xml/yml/yaml/properties,
permission table grep, reflection-lookup grep, and test-file grep,
no other references found. Module compiles clean and existing
teller test suite passes.
@AshharAhmadKhan

Copy link
Copy Markdown
Contributor Author

hey @adamsaghy , failure look flaky, can you please retrigger those checks? thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant