Skip to content

Fix: Make "Apply Annual Fees" currency-agnostic for non-INR deployments#3552

Open
Manishnemade12 wants to merge 1 commit into
openMF:devfrom
Manishnemade12:Hardcoded
Open

Fix: Make "Apply Annual Fees" currency-agnostic for non-INR deployments#3552
Manishnemade12 wants to merge 1 commit into
openMF:devfrom
Manishnemade12:Hardcoded

Conversation

@Manishnemade12
Copy link
Copy Markdown
Contributor

@Manishnemade12 Manishnemade12 commented Apr 30, 2026

Description

This PR fixes a critical internationalization (i18n) bug where the "Apply Annual Fees" menu option was completely hidden for any Fineract deployment not using the exact <charge-name> - INR convention (such as non-Rupee currencies like USD, EUR, KES, NGN, or localized charge names).

Five occurrences across the Savings, Shares, and Recurring Deposits modules were hardcoded to check charge.name === 'Annual fee - INR'. This string-matching brittle detection model was replaced with the stable, currency-agnostic Fineract API check charge.chargeTimeType?.id === 7. This conforms to Apache Fineract's global charge type enumeration for Annual Fees, ensuring the feature works accurately regardless of location, language, or currency.

Screenshots, if any

(Not applicable, business logic fix enabling hidden dropdown options for localized currencies)

Checklist

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

  • If you have multiple commits please combine them into one commit by squashing them.

  • Read and understood the contribution guidelines at web-app/.github/CONTRIBUTING.md.

Summary by CodeRabbit

  • Bug Fixes
    • Prevented unintended operations when confirmation dialogs are dismissed across clients, loans, savings, and other account views by adding defensive handling for empty dialog results.
    • Improved "Apply Annual Fees" detection and reliability in recurring deposits, savings, and shares accounts by switching to a charge-type based check; corrected a label typo for the apply-fees option.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'pre_merge_checks'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 78aff92f-bf5b-4e3c-9210-96ab60a6af8f

📥 Commits

Reviewing files that changed from the base of the PR and between de9b977 and f3478d9.

📒 Files selected for processing (6)
  • src/app/clients/clients-view/clients-view.component.ts
  • src/app/deposits/recurring-deposits/recurring-deposits-account-view/recurring-deposits-account-view.component.ts
  • src/app/loans/loans-view/loans-view.component.ts
  • src/app/savings/saving-account-actions/apply-annual-fees-savings-account/apply-annual-fees-savings-account.component.ts
  • src/app/savings/savings-account-view/savings-account-view.component.ts
  • src/app/shares/shares-account-view/shares-account-view.component.ts
🚧 Files skipped from review as they are similar to previous changes (6)
  • src/app/deposits/recurring-deposits/recurring-deposits-account-view/recurring-deposits-account-view.component.ts
  • src/app/shares/shares-account-view/shares-account-view.component.ts
  • src/app/clients/clients-view/clients-view.component.ts
  • src/app/savings/saving-account-actions/apply-annual-fees-savings-account/apply-annual-fees-savings-account.component.ts
  • src/app/savings/savings-account-view/savings-account-view.component.ts
  • src/app/loans/loans-view/loans-view.component.ts

Walkthrough

Adds early-return guards to dialog afterClosed handlers to avoid falsy responses and changes annual-fee detection from a name match to checking charge.chargeTimeType?.id === 7 across several account view and action components.

Changes

Dialog Guards and Charge Type Updates

Layer / File(s) Summary
Dialog response guard pattern
src/app/clients/clients-view/clients-view.component.ts, src/app/loans/loans-view/loans-view.component.ts, src/app/savings/savings-account-view/savings-account-view.component.ts
Dialog afterClosed() handlers return early when response is falsy across client (delete/unassign/view/delete signature), loan (recoverFromGuarantor, undoLoanAction, deleteLoanAccount), and savings (delete, calculate/post interest, enable/disable withhold tax, unblock) flows.
Annual fee charge identification by type ID
src/app/deposits/recurring-deposits/recurring-deposits-account-view/recurring-deposits-account-view.component.ts, src/app/savings/saving-account-actions/apply-annual-fees-savings-account/apply-annual-fees-savings-account.component.ts, src/app/savings/savings-account-view/savings-account-view.component.ts, src/app/shares/shares-account-view/shares-account-view.component.ts
“Apply Annual Fees” option and applyCharge() now detect annual-fee charges using charge.chargeTimeType?.id === 7 instead of matching charge.name === 'Annual fee - INR'. Button text typo corrected to Apply Annual Fees.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • IOhacker
  • alberto-art3ch
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly addresses the main objective: replacing hardcoded currency-specific charge name matching with a currency-agnostic check using charge type IDs across multiple modules.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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
Copy link
Copy Markdown
Contributor

IOhacker commented May 4, 2026

Please open a jira ticket, squash and commit

@Flashl3opard
Copy link
Copy Markdown

Hi @Manishnemade12, kindly open a Jira ticket as part of the contribution process. Also, the PR currently has 2 commits — please squash them into a single commit (will fix the Single Commit Check). Thanks!

Jira board reference - here

@Manishnemade12
Copy link
Copy Markdown
Contributor Author

Hi @Manishnemade12, kindly open a Jira ticket as part of the contribution process. Also, the PR currently has 2 commits — please squash them into a single commit (will fix the Single Commit Check). Thanks!

Jira board reference - here

Thanks for reference. I will do it as soon as possible.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/app/shares/shares-account-view/shares-account-view.component.ts`:
- Line 123: Update the button label string in shares-account-view.component (the
object property where name: 'Apply Anuual Fees') to correct the typo to 'Apply
Annual Fees'; locate the occurrences of the name property in
shares-account-view.component.ts (e.g., the button/config object that currently
reads 'Apply Anuual Fees') and replace "Anuual" with "Annual" so the UI displays
the correct label.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b26f9684-16e1-484b-a40e-bba6283ec8cb

📥 Commits

Reviewing files that changed from the base of the PR and between b3dea90 and 8256c65.

📒 Files selected for processing (6)
  • src/app/clients/clients-view/clients-view.component.ts
  • src/app/deposits/recurring-deposits/recurring-deposits-account-view/recurring-deposits-account-view.component.ts
  • src/app/loans/loans-view/loans-view.component.ts
  • src/app/savings/saving-account-actions/apply-annual-fees-savings-account/apply-annual-fees-savings-account.component.ts
  • src/app/savings/savings-account-view/savings-account-view.component.ts
  • src/app/shares/shares-account-view/shares-account-view.component.ts

Comment thread src/app/shares/shares-account-view/shares-account-view.component.ts Outdated
@Manishnemade12
Copy link
Copy Markdown
Contributor Author

@IOhacker @Flashl3opard done i created issue for this pr on jira

https://mifosforge.jira.com/browse/WEB-945?atlOrigin=eyJpIjoiMWMxNDBmODFlNjNmNDU0MWFlZWE0MGJlZWEyOGIzNDYiLCJwIjoiaiJ9

@Manishnemade12 Manishnemade12 requested a review from IOhacker May 13, 2026 14:03
…e charges by chargeTimeType ID

Also: update shares account view component (squashed changes from two commits)
@Manishnemade12
Copy link
Copy Markdown
Contributor Author

@IOhacker done i fixed typo

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.

3 participants