Skip to content

WEB-657: Working Capital Loan Disbursement and Discount fix#3623

Open
somasorosdpc wants to merge 1 commit into
openMF:devfrom
somasorosdpc:WEB-657/working-capital-discount-disbursement-fix
Open

WEB-657: Working Capital Loan Disbursement and Discount fix#3623
somasorosdpc wants to merge 1 commit into
openMF:devfrom
somasorosdpc:WEB-657/working-capital-discount-disbursement-fix

Conversation

@somasorosdpc
Copy link
Copy Markdown
Collaborator

@somasorosdpc somasorosdpc commented May 28, 2026

Description

Working capital loan product

  • Approve Loan, discount field is populated on init and disabled according to template
  • Disburse Loan, discount field is populated on init and disabled according to template
  • Discount transaction popup on transactions tab no longer supports manual undo

Related issues and discussion

WEB-657

Screenshots, if any

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

  • Fixed discount amount field initialization in loan approval and disbursement processes to properly reflect stored values and user permissions.
  • System now correctly identifies and handles discount fee transaction types.

New Features

  • Discount fee transactions are now protected from accidental undo operations to maintain data integrity.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 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: "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

Walkthrough

This PR extends loan transaction modeling to identify discount-fee transactions, prevents undo operations on those transactions, and refines discount amount form control initialization in approval and disbursement workflows by populating initial values and conditional disabled states.

Changes

Discount Fee Configuration

Layer / File(s) Summary
Discount Fee Type Model
src/app/loans/models/loan-transaction-type.model.ts
LoanTransactionType interface now includes discountFee: boolean field to classify transaction types as discount-fee related.
Discount Fee Transaction Undo Prevention
src/app/loans/loans-view/transactions-tab/transactions-tab.component.ts
New isDiscountFee() helper detects discount-fee transactions via the flag or transaction-type code matching. allowUndoTransaction() now includes this check to block undo for discount-fee transactions.
Discount Amount Form Control Initialization
src/app/loans/loans-view/loan-account-actions/approve-loan/approve-loan.component.ts, src/app/loans/loans-view/loan-account-actions/disburse/disburse.component.ts
Both approve-loan and disburse components now initialize discountAmount form controls with values from the backing data object and set disabled state based on the overrideDiscountDisabled flag, replacing prior uninitialized controls.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • openMF/web-app#3447: Updates working-capital discountAmount reactive form setup in disburse and approve-loan flows.

Suggested reviewers

  • alberto-art3ch
  • adamsaghy
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly relates to the main changes: initializing and disabling discount fields in approve/disburse loan workflows, and preventing undo of discount transactions for Working Capital loans.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ 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.

Copy link
Copy Markdown
Collaborator

@alberto-art3ch alberto-art3ch left a comment

Choose a reason for hiding this comment

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

LGTM

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