Skip to content

WEB-657: rename wc loan accounting rule CASH_BASED to ACC_DEF_REV_AM - #3687

Merged
adamsaghy merged 1 commit into
openMF:devfrom
Cocoa-Puffs:WEB-657-rename-working-capital-accounting
Jun 29, 2026
Merged

WEB-657: rename wc loan accounting rule CASH_BASED to ACC_DEF_REV_AM#3687
adamsaghy merged 1 commit into
openMF:devfrom
Cocoa-Puffs:WEB-657-rename-working-capital-accounting

Conversation

@Cocoa-Puffs

@Cocoa-Puffs Cocoa-Puffs commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Description

Originally WC loans were created with a cash based accounting scheme in mind. But that does not accurately reflect the current model. Which is closer to an accrual based accounting. So the new name of this accounting will be "Accrual with deferred revenue amortization".

Related issues and discussion

#{WEB-657}

image image

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

  • New Features

    • Added a new accounting rule option for loan products, including updated form behavior and account label naming.
    • Expanded language support by adding the new accounting label translation across multiple locales.
  • Bug Fixes

    • Updated rule mapping so the new accounting option is recognized and named consistently across loan accounting logic and the UI.

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

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: "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: 1bb80bf5-fb66-47c2-92b9-daba5848620b

📥 Commits

Reviewing files that changed from the base of the PR and between 6a6fed5 and 5bd8061.

📒 Files selected for processing (15)
  • src/app/core/utils/accounting.ts
  • src/app/products/loan-products/loan-product-stepper/loan-product-accounting-step/loan-product-accounting-step.component.ts
  • src/assets/translations/cs-CS.json
  • src/assets/translations/de-DE.json
  • src/assets/translations/en-US.json
  • src/assets/translations/es-CL.json
  • src/assets/translations/es-MX.json
  • src/assets/translations/fr-FR.json
  • src/assets/translations/it-IT.json
  • src/assets/translations/ko-KO.json
  • src/assets/translations/lt-LT.json
  • src/assets/translations/lv-LV.json
  • src/assets/translations/ne-NE.json
  • src/assets/translations/pt-PT.json
  • src/assets/translations/sw-SW.json
✅ Files skipped from review due to trivial changes (12)
  • src/assets/translations/ko-KO.json
  • src/assets/translations/es-MX.json
  • src/assets/translations/es-CL.json
  • src/assets/translations/ne-NE.json
  • src/assets/translations/pt-PT.json
  • src/assets/translations/lt-LT.json
  • src/assets/translations/sw-SW.json
  • src/assets/translations/fr-FR.json
  • src/assets/translations/it-IT.json
  • src/assets/translations/de-DE.json
  • src/assets/translations/cs-CS.json
  • src/assets/translations/en-US.json
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/app/core/utils/accounting.ts
  • src/assets/translations/lv-LV.json
  • src/app/products/loan-products/loan-product-stepper/loan-product-accounting-step/loan-product-accounting-step.component.ts

Walkthrough

The working-capital accounting rule now uses ACC_DEF_REV_AM instead of CASH_BASED in the accounting utility and loan-product stepper. Matching translation keys were added across locale files.

Changes

Accounting rule rollout

Layer / File(s) Summary
Rule code plumbing
src/app/core/utils/accounting.ts, src/app/products/loan-products/loan-product-stepper/loan-product-accounting-step/loan-product-accounting-step.component.ts
getAccountingRulesForLoans returns ACC_DEF_REV_AM, getAccountRuleName recognizes it, and the working-capital stepper branches on the same rule id.
Locale labels
src/assets/translations/*.json
Locale translation catalogs add ACC_DEF_REV_AM labels for the accounting catalog.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • adamsaghy
🚥 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 clearly and accurately summarizes the main change: renaming the working capital loan accounting rule from CASH_BASED to ACC_DEF_REV_AM.
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.
✨ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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/core/utils/accounting.ts`:
- Around line 41-45: Confirm the working-capital backend rule-code is returned
as ACC_DEF_REV_AM so the frontend switch logic in accounting.ts and the loan
product accounting stepper paths resolve correctly. Check the API response/model
that feeds the product accounting flow and align the backend value with the
existing ACC_DEF_REV_AM constant used in getAccountingRuleCode and related
stepper logic, rather than introducing or relying on CASH_BASED. If the backend
currently emits a different rule-code, update it at the source so the frontend
does not fall through its accounting selection logic.

In `@src/assets/translations/ne-NE.json`:
- Line 478: The Nepali translation for ACC_DEF_REV_AM uses an inconsistent term
for amortization; update the wording in the translation entry to use the
established term from the same file, matching the Amortization and Amortization
Schedule keys. Keep the rest of the phrase intact and replace the incorrect
"खम्बीकरण" wording with the consistent "परिशोधन" terminology so the translation
stays aligned across ne-NE.json.
🪄 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: cd09d9b9-3dd7-481f-a77d-82311903f4da

📥 Commits

Reviewing files that changed from the base of the PR and between 62672df and 6a6fed5.

📒 Files selected for processing (15)
  • src/app/core/utils/accounting.ts
  • src/app/products/loan-products/loan-product-stepper/loan-product-accounting-step/loan-product-accounting-step.component.ts
  • src/assets/translations/cs-CS.json
  • src/assets/translations/de-DE.json
  • src/assets/translations/en-US.json
  • src/assets/translations/es-CL.json
  • src/assets/translations/es-MX.json
  • src/assets/translations/fr-FR.json
  • src/assets/translations/it-IT.json
  • src/assets/translations/ko-KO.json
  • src/assets/translations/lt-LT.json
  • src/assets/translations/lv-LV.json
  • src/assets/translations/ne-NE.json
  • src/assets/translations/pt-PT.json
  • src/assets/translations/sw-SW.json

Comment thread src/app/core/utils/accounting.ts
Comment thread src/assets/translations/ne-NE.json Outdated
@Cocoa-Puffs
Cocoa-Puffs force-pushed the WEB-657-rename-working-capital-accounting branch from 6a6fed5 to 5bd8061 Compare June 26, 2026 08:01

@alberto-art3ch alberto-art3ch left a comment

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.

LGTM

@adamsaghy
adamsaghy merged commit d57ce75 into openMF:dev Jun 29, 2026
5 checks passed
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