Skip to content

MX-202: Fix the API 02. TRANSFER BETWEEN ACCOUNTS - #123

Merged
IOhacker merged 1 commit into
openMF:developfrom
IOhacker:develop
Apr 12, 2026
Merged

MX-202: Fix the API 02. TRANSFER BETWEEN ACCOUNTS#123
IOhacker merged 1 commit into
openMF:developfrom
IOhacker:develop

Conversation

@IOhacker

@IOhacker IOhacker commented Apr 12, 2026

Copy link
Copy Markdown
Contributor

MX-202: Fix the API 02. TRANSFER BETWEEN ACCOUNTS

Summary by CodeRabbit

  • Refactor

    • Consolidated and reorganized fund transfer API constants into a dedicated utility class for improved code maintainability.
    • Removed unused imports.
  • Bug Fixes

    • Enhanced input validation to properly reject blank or whitespace-only JSON content in fund transfer requests, ensuring data integrity.

@coderabbitai

coderabbitai Bot commented Apr 12, 2026

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR relocates API parameter constants for self-service funds transfer from the general SelfServiceApiConstants class to a dedicated SelfAccountTransferApiConstants class. It also updates validation logic to reject blank JSON input and removes an unused import.

Changes

Cohort / File(s) Summary
API Constants Reorganization
src/main/java/org/apache/fineract/selfservice/account/api/SelfAccountTransferApiConstants.java
New utility class introducing 13 public String constants for transfer request parameters (toOfficeId, toClientId, transferDate, transferAmount, etc.) and a public CREATE_TRANSFER_REQUEST_DATA_PARAMETERS unmodifiable set.
Constants Removal
src/main/java/org/apache/fineract/selfservice/registration/SelfServiceApiConstants.java
Removed 13 transfer-related parameter constants and the CREATE_TRANSFER_REQUEST_DATA_PARAMETERS set previously declared in this general-purpose constants class.
Validation Enhancement
src/main/java/org/apache/fineract/selfservice/account/data/SelfAccountTransferDataValidator.java
Updated validateCreate() method to treat blank or whitespace JSON input as invalid by replacing null check with StringUtils.isBlank().
Import Cleanup
src/main/java/org/apache/fineract/selfservice/account/api/SelfAccountTransferApiResource.java
Removed unused import of AccountTransfersApiResource.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • MX-203: Fix the API 03. TRANSFER TO THIRD PARTY #120: Related changes to self-service funds-transfer code structure, involving relocation of transfer request parameter constants and modifications to SelfAccountTransferApiResource and SelfAccountTransferDataValidator.

Suggested labels

⏱️ <10 Min Review

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title references a ticket identifier (MX-202) and mentions fixing an API for account transfers, which aligns with the main changes moving transfer constants from SelfServiceApiConstants to a new dedicated SelfAccountTransferApiConstants class.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@IOhacker
IOhacker merged commit 268c456 into openMF:develop Apr 12, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant