Skip to content

FINERACT-2244: Migrate Floating Rate module to CommandDispatcher#6013

Open
aditinikam wants to merge 3 commits into
apache:developfrom
aditinikam:FINERACT-2244
Open

FINERACT-2244: Migrate Floating Rate module to CommandDispatcher#6013
aditinikam wants to merge 3 commits into
apache:developfrom
aditinikam:FINERACT-2244

Conversation

@aditinikam

Copy link
Copy Markdown

Migrate org.apache.fineract.portfolio.floatingrates (fineract-rates) to the new command-processing infrastructure (FINERACT-2169), mirroring the Staff gold-standard pattern.

  • FloatingRatesApiResource injects CommandDispatcher; POST/PUT build typed FloatingRateCreate/UpdateCommand and return typed POJOs (FloatingRateCreateResponse/FloatingRateUpdateResponse). @produces hoisted to class level; inline read-permission checks removed from GETs.
  • Add typed command handlers (CommandHandler<Req,Res>, @Retry/@transactional), FloatingRateWriteService(+Impl), FloatingRateUpdateRequest (distinct payload type for dispatcher routing), and typed validateForCreate/Update + FloatingRate.createNew/update overloads (JsonCommand-free).
  • Legacy write path kept in parallel (FloatingRateWritePlatformService, old NewCommandSourceHandler handlers, JsonCommand domain/validator methods).
  • Rename FloatingRatesReadPlatformService -> FloatingRatesReadService (+Impl) across all callers.
  • Add fineract-command dependency to fineract-rates; register write-service bean; add /api/*/floatingrates GET/POST/PUT authorization matchers to SecurityConfig (READ/CREATE/UPDATE_FLOATINGRATE).

Description

Describe the changes made and why they were made. (Ignore if these details are present on the associated Apache Fineract JIRA ticket.)

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Write the commit message as per our guidelines
  • Acknowledge that we will not review PRs that are not passing the build ("green") - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
  • Create/update unit or integration tests for verifying the changes made.
  • Follow our coding conventions.
  • Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes
  • This PR must not be a "code dump". Large changes can be made in a branch, with assistance. Ask for help on the developer mailing list.

Your assigned reviewer(s) will follow our guidelines for code reviews.

Migrate org.apache.fineract.portfolio.floatingrates (fineract-rates) to the
new command-processing infrastructure (FINERACT-2169), mirroring the Staff
gold-standard pattern.

- FloatingRatesApiResource injects CommandDispatcher; POST/PUT build typed
  FloatingRateCreate/UpdateCommand and return typed POJOs
  (FloatingRateCreateResponse/FloatingRateUpdateResponse). @produces hoisted
  to class level; inline read-permission checks removed from GETs.
- Add typed command handlers (CommandHandler<Req,Res>, @Retry/@transactional),
  FloatingRateWriteService(+Impl), FloatingRateUpdateRequest (distinct payload
  type for dispatcher routing), and typed validateForCreate/Update +
  FloatingRate.createNew/update overloads (JsonCommand-free).
- Legacy write path kept in parallel (FloatingRateWritePlatformService, old
  NewCommandSourceHandler handlers, JsonCommand domain/validator methods).
- Rename FloatingRatesReadPlatformService -> FloatingRatesReadService (+Impl)
  across all callers.
- Add fineract-command dependency to fineract-rates; register write-service
  bean; add /api/*/floatingrates GET/POST/PUT authorization matchers to
  SecurityConfig (READ/CREATE/UPDATE_FLOATINGRATE).
…vice

Address review feedback on the new FloatingRateWriteService bean by removing
the parallel typed command-dispatcher write stack and reverting floating-rate
writes to the existing legacy command-source path.

- Delete net-new typed cluster: FloatingRateCreate/UpdateCommand,
  FloatingRateCreate/UpdateResponse, FloatingRateUpdateRequest, the
  FloatingRateCreate/UpdateCommandHandler dispatcher handlers, and
  FloatingRateWriteService(+Impl).
- Revert FloatingRate domain and FloatingRateDataValidator to develop,
  removing the typed JsonCommand-free overloads.
- Restore FloatingRatesApiResource POST/PUT to the CommandWrapperBuilder /
  logCommandSource path (returns CommandProcessingResult); keep the renamed
  FloatingRatesReadService.
- Remove the floatingRateWriteService bean and the fineract-command dependency.

The legacy FloatingRateWritePlatformService and @CommandType handlers are now
the sole write path. Read-service rename and SecurityConfig matchers retained.
…dDispatcher

Reverse the previous fallback-to-legacy and complete the CQRS migration so
floating-rate writes flow solely through the typed CommandDispatcher path.
No JsonCommand or FromJsonHelper remain in the write path.

- Restore the typed stack: FloatingRate{Create,Update}Command,
  FloatingRate{Create,Update}Response, FloatingRateUpdateRequest, the typed
  FloatingRate{Create,Update}CommandHandler, FloatingRateWriteService(+Impl),
  dispatcher-based FloatingRatesApiResource, the floatingRateWriteService bean,
  and the fineract-command dependency.
- Delete the legacy JSON cluster: FloatingRateWritePlatformService(+Impl), the
  @CommandType Create/UpdateFloatingRateCommandHandler, the JsonCommand-based
  FloatingRate.createNew/update/getRatePeriods overloads, the String/JsonElement
  FloatingRateDataValidator methods (and its FromJsonHelper dependency), and the
  CommandWrapperBuilder.createFloatingRate/updateFloatingRate builders.

Verified :fineract-core, :fineract-rates, :fineract-provider compileJava and
spotless.
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