Skip to content

FINERACT-2253: refactor account module to new command processing#5811

Closed
SamaSVM wants to merge 1 commit into
apache:developfrom
SamaSVM:FINERACT-2253/new-command-processing-account
Closed

FINERACT-2253: refactor account module to new command processing#5811
SamaSVM wants to merge 1 commit into
apache:developfrom
SamaSVM:FINERACT-2253/new-command-processing-account

Conversation

@SamaSVM

@SamaSVM SamaSVM commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Description

Refactored the account module (AccountTransfers and StandingInstruction) to align with the new command processing pattern already established in other modules.

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.

@SamaSVM SamaSVM force-pushed the FINERACT-2253/new-command-processing-account branch 4 times, most recently from 665094d to e4328f0 Compare April 29, 2026 11:17
@adamsaghy adamsaghy requested a review from vidakovic April 30, 2026 20:12
@SamaSVM SamaSVM force-pushed the FINERACT-2253/new-command-processing-account branch 3 times, most recently from 7add5f8 to 76768cb Compare May 20, 2026 10:02
@SamaSVM

SamaSVM commented May 20, 2026

Copy link
Copy Markdown
Contributor Author

@vidakovic Could you please review this PR when you have a moment? I’d appreciate any feedback you can provide.

@SamaSVM SamaSVM force-pushed the FINERACT-2253/new-command-processing-account branch 2 times, most recently from 7f1e564 to 17bfe98 Compare May 21, 2026 12:38
@SamaSVM SamaSVM force-pushed the FINERACT-2253/new-command-processing-account branch from 17bfe98 to 7ce2ede Compare May 27, 2026 10:06
private final DefaultToApiJsonSerializer<AccountTransferData> toApiJsonSerializer;
private final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService;
private final AccountTransfersReadPlatformService accountTransfersReadPlatformService;
private final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, we want to remove these legacy command processing components. Only read services and the new CommandDispatcher can be in the JAX-RS resource classes.

@@ -70,7 +75,6 @@ public class AccountTransfersApiResource {
+ "accounttransfers/template?fromClientId=1&fromAccountType=2&fromAccountId=1")
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountTransfersApiResourceSwagger.GetAccountTransfersTemplateResponse.class)))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we are already type-safe then we don't need these @ApiResponse and especially not @Schema annotations. Response code 200 is anyway trivial, because that's the default anyway. In short: the goal is to get rid of AccountTransfersApiResourceSwagger (and similar "Swagger" suffixed) classes in the first place.

@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountTransfersApiResourceSwagger.GetAccountTransfersTemplateResponse.class)))
public AccountTransferData template(@BeanParam AccountTransSearchParam accountTransSearchParam) {

context.authenticatedUser().validateHasReadPermission(AccountTransfersApiConstants.ACCOUNT_TRANSFER_RESOURCE_NAME);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see other already migrated packages. Authorization should be configured where it belongs... and that is SecurityConfig.java. Using the platform security context service is bad practice anyway.

@@ -86,11 +90,10 @@ public AccountTransferData template(@BeanParam AccountTransSearchParam accountTr
@Operation(summary = "Create new Transfer", operationId = "createAccountTransfer", description = "Ability to create new transfer of monetary funds from one account to another.")
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = AccountTransferRequest.class)))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, these are the annotations we want to get rid of. If we have proper types then these are not necessary: @RequestBody and @ApiResponse. Please fix this also for all following occurrences, won't comment on each.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SamaSVM another thing: there are currently 2 GSoC projects going on that - I think - have contain this package that you worked on. They are already assigned to students. Please contact @avivijay19 and @Aman-Mittal to coordinate... but probably you have to abandon this unfortunately. I will block now all sub-tasks on FINERACT-2169, because they are pretty much all now GSoC projects. FYI

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vidakovic Understood, thank you for your feedback.

@SamaSVM SamaSVM closed this May 27, 2026
@vidakovic

Copy link
Copy Markdown
Contributor

@SamaSVM sorry for that... there will be more to do 😉

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.

2 participants