Skip to content

WEB-1072: Add support for Two Wheeler, Education and Agricultural loan products - #3764

Merged
IOhacker merged 1 commit into
openMF:devfrom
YousufFFFF:feature/two-wheeler-education-agriculture
Jul 31, 2026
Merged

WEB-1072: Add support for Two Wheeler, Education and Agricultural loan products#3764
IOhacker merged 1 commit into
openMF:devfrom
YousufFFFF:feature/two-wheeler-education-agriculture

Conversation

@YousufFFFF

@YousufFFFF YousufFFFF commented Jul 28, 2026

Copy link
Copy Markdown
Member

Description

This PR extends the template-based loan product creation workflow by introducing support for three additional loan product templates:

  • Two Wheeler Loan
  • Education Loan
  • Agricultural Loan

Each template is configured with loan-specific defaults, field visibility, editability, and validation rules to simplify product creation while aligning with the expected business requirements for each loan type. The changes provide a more guided and consistent experience for creating commonly used loan products without affecting the existing Personal Loan, Advanced Loan, or Classic loan product creation flows.

No additional dependencies are required.

Related issues and discussion

WEB-1072

Screenshots, if any

image
trim.5AB640B8-139E-4E27-95B5-65674582BEB1.MOV

Checklist

  • 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 loan product creation routes and wizard flows for Two Wheeler, Education, and Agriculture, with guided, mode-aware defaults and localized headings/descriptions.
    • Introduced a reusable Accounting step in the loan product wizard, including GL account selection and an Accounting section on the Review screen.
  • Bug Fixes
    • Improved wizard submission validation to block when the Accounting step is invalid, and refined step rendering so Accounting appears only when applicable.
  • Tests
    • Expanded golden parity and wizard-flow tests to lock step sequences, payload shapes, Accounting reuse/overrides, and invalid-state submission blocking.

@YousufFFFF
YousufFFFF requested a review from a team July 28, 2026 07:34
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

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

Adds Agriculture, Education, and Two Wheeler loan-product profiles with route-specific defaults, visibility, payload shaping, translations, and tests. The wizard also reuses the Classic accounting step for input, validation, submission payloads, and Review rendering.

Changes

Loan product profiles

Layer / File(s) Summary
Profile contracts and payload construction
src/app/products/loan-products/wizard/loan-product.config.ts, src/app/products/loan-products/wizard/loan-product.config.spec.ts
Adds guided profile modes, route mappings, profile defaults, visibility rules, payload normalization, product-card updates, and golden payload coverage.
Profile routes and localized entry points
src/app/products/products-routing.module.ts, src/app/products/loan-products/create-loan-product/*, src/assets/translations/*
Adds three loan creation routes, derives page titles from route profiles, and adds translated headings and descriptions.
Guided wizard defaults and visibility
src/app/products/loan-products/wizard/loan-product-wizard.component.ts, src/app/products/loan-products/wizard/loan-product-wizard.component.spec.ts
Applies profile-specific field visibility, initial values, template-default precedence, step sequences, and submission behavior.
Reusable accounting step integration
src/app/products/loan-products/wizard/loan-product-wizard.component.*, src/app/products/loan-products/create-loan-product/create-loan-product.component.html
Renders the accounting component, passes accounting data, validates its form, merges accounting values into the payload, and displays resolved accounts in Review.

Estimated code review effort: 5 (Critical) | ~90+ minutes

Sequence Diagram(s)

sequenceDiagram
  participant CreateLoanProductComponent
  participant LoanProductWizardComponent
  participant LoanProductAccountingStepComponent
  participant CreateLoanProductPayload
  CreateLoanProductComponent->>LoanProductWizardComponent: Pass accountingRuleData and profileMode
  LoanProductWizardComponent->>LoanProductAccountingStepComponent: Render accounting step with template data
  LoanProductAccountingStepComponent-->>LoanProductWizardComponent: Return accounting form values and validity
  LoanProductWizardComponent->>CreateLoanProductPayload: Merge accounting values into create payload
  LoanProductWizardComponent-->>CreateLoanProductComponent: Render accounting rule and resolved GL accounts in Review
Loading

Possibly related PRs

  • openMF/web-app#3687: Overlaps on accounting-step handling and working-capital accounting rule behavior.
  • openMF/web-app#3701: Overlaps on the convenient loan-product wizard flow and component/form handling.
  • openMF/web-app#3711: Overlaps on loan-product card metadata and wizard configuration changes.

Suggested reviewers: iohacker

🚥 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 matches the main change: adding support for Two Wheeler, Education, and agricultural loan products.
Docstring Coverage ✅ Passed Docstring coverage is 88.89% which is sufficient. The required threshold is 80.00%.
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: 7

🧹 Nitpick comments (3)
src/app/products/loan-products/wizard/loan-product-wizard.component.spec.ts (2)

734-743: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

visibleKeysByStep is copy-pasted four times.

Identical helper in the golden-parity, Two Wheeler, Education and Agriculture suites. Hoist one copy to the outer describe (and consider a shared profileComponent(mode, templateExtras) factory, since the four component builders differ only in profileMode and template extras).

Also applies to: 942-951, 1095-1104, 1228-1237

🤖 Prompt for 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.

In `@src/app/products/loan-products/wizard/loan-product-wizard.component.spec.ts`
around lines 734 - 743, Deduplicate the identical visibleKeysByStep helper
across the golden-parity, Two Wheeler, Education, and Agriculture suites by
defining one shared helper in the outer describe scope and updating each suite
to use it. Preserve its current fields-step filtering and visibleFields key
extraction; consider sharing the component builder only if it remains limited to
the differing profileMode and template extras.

1061-1076: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Misplaced test: profile-label coverage for all five modes lives inside the Two Wheeler suite.

Move to a top-level describe('profile labels') so it isn't lost when the Two Wheeler block is edited or skipped.

🤖 Prompt for 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.

In `@src/app/products/loan-products/wizard/loan-product-wizard.component.spec.ts`
around lines 1061 - 1076, Move the “exposes one profile label translation key
per mode” test out of the Two Wheeler-specific suite and into a top-level
describe('profile labels') block. Preserve all five mode assertions and their
expected translation keys, while keeping the Two Wheeler setup only as shared
fixture context if needed.
src/app/products/loan-products/wizard/loan-product-wizard.component.ts (1)

847-852: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Template value can defeat the Custom/Advanced false default.

Here the template wins (template.x ?? (guided ? INITIAL : false)), but getInitialFormState() (Line 904-905) forces false for non-guided regardless. If the backend template ever returns multiDisburseLoan/allowVariableInstallments as true, Custom/Advanced ends up with the exact combination the comment says Fineract rejects. Consider gating on the profile first for consistency with getInitialFormState().

♻️ Proposed change
-        allowVariableInstallments:
-          this.loanProductsTemplate.allowVariableInstallments ??
-          (this.isGuidedProfile ? INITIAL_FORM_STATE.allowVariableInstallments : false),
-        multiDisburseLoan:
-          this.loanProductsTemplate.multiDisburseLoan ??
-          (this.isGuidedProfile ? INITIAL_FORM_STATE.multiDisburseLoan : false),
+        allowVariableInstallments: this.isGuidedProfile
+          ? (this.loanProductsTemplate.allowVariableInstallments ?? INITIAL_FORM_STATE.allowVariableInstallments)
+          : false,
+        multiDisburseLoan: this.isGuidedProfile
+          ? (this.loanProductsTemplate.multiDisburseLoan ?? INITIAL_FORM_STATE.multiDisburseLoan)
+          : false,
🤖 Prompt for 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.

In `@src/app/products/loan-products/wizard/loan-product-wizard.component.ts`
around lines 847 - 852, Update the initialization of allowVariableInstallments
and multiDisburseLoan to gate on isGuidedProfile before applying
loanProductsTemplate values, ensuring non-guided Custom/Advanced profiles always
receive false as in getInitialFormState(). Preserve the existing guided-profile
fallback to INITIAL_FORM_STATE values.
🤖 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/products/loan-products/wizard/loan-product-wizard.component.ts`:
- Around line 642-649: Update the GL account lookup in the
ACCOUNTING_REVIEW_ACCOUNTS mapping to compare normalized ID values, allowing
equivalent string and numeric IDs such as "4" and 4 to match. Preserve the
existing empty-value guard and row filtering behavior.

In `@src/assets/translations/es-MX.json`:
- Around line 1134-1138: Localize the guided-loan content in
src/assets/translations/es-MX.json at lines 1134-1138 and 3421-3428: translate
the guided-loan headings, product labels, and descriptions into Mexican Spanish,
and verify that the Personal Loan and Custom / Advanced Loan Configuration
entries use the expected description keys.

In `@src/assets/translations/fr-FR.json`:
- Around line 1133-1137: Translate the newly added loan-product headings,
labels, and descriptions in fr-FR.json, including the entries around “Create
Agriculture Loan”, “Create Education Loan”, “Create Personal Loan”, “Create Two
Wheeler Loan”, and “Custom / Advanced Loan Configuration”. Replace the English
values with natural French translations throughout the referenced sections,
preserving the existing keys and JSON structure.

In `@src/assets/translations/lv-LV.json`:
- Around line 1130-1134: Complete the Latvian translations in
src/assets/translations/lv-LV.json at lines 1130-1134 by translating the five
product-creation headings, and at lines 3415-3422 by translating the new product
names and descriptions. Update both affected sites while preserving the existing
translation keys and JSON structure.

In `@src/assets/translations/ne-NE.json`:
- Around line 1129-1133: Translate all five heading values in
src/assets/translations/ne-NE.json lines 1129-1133 into Nepali, and translate
the new guided-loan names and descriptions in src/assets/translations/ne-NE.json
lines 3415-3422. Preserve the existing JSON keys and structure while replacing
only the English values.

In `@src/assets/translations/pt-PT.json`:
- Around line 1130-1134: Translate the new English loan-creation headings at
src/assets/translations/pt-PT.json lines 1130-1134 into approved Portuguese
values, and translate the product names and descriptions at
src/assets/translations/pt-PT.json lines 3415-3422 as well. Preserve the
existing translation keys and JSON structure.

In `@src/assets/translations/sw-SW.json`:
- Around line 1128-1132: In src/assets/translations/sw-SW.json at lines
1128-1132, replace the English values for the guided-loan headings with approved
Swahili translations; likewise update the loan labels and descriptions at lines
3412-3419 with their approved Swahili translations, preserving the existing
translation keys and JSON structure.

---

Nitpick comments:
In `@src/app/products/loan-products/wizard/loan-product-wizard.component.spec.ts`:
- Around line 734-743: Deduplicate the identical visibleKeysByStep helper across
the golden-parity, Two Wheeler, Education, and Agriculture suites by defining
one shared helper in the outer describe scope and updating each suite to use it.
Preserve its current fields-step filtering and visibleFields key extraction;
consider sharing the component builder only if it remains limited to the
differing profileMode and template extras.
- Around line 1061-1076: Move the “exposes one profile label translation key per
mode” test out of the Two Wheeler-specific suite and into a top-level
describe('profile labels') block. Preserve all five mode assertions and their
expected translation keys, while keeping the Two Wheeler setup only as shared
fixture context if needed.

In `@src/app/products/loan-products/wizard/loan-product-wizard.component.ts`:
- Around line 847-852: Update the initialization of allowVariableInstallments
and multiDisburseLoan to gate on isGuidedProfile before applying
loanProductsTemplate values, ensuring non-guided Custom/Advanced profiles always
receive false as in getInitialFormState(). Preserve the existing guided-profile
fallback to INITIAL_FORM_STATE values.
🪄 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 Plus

Run ID: 4f273a02-5860-4e7d-b514-b62fbb1fd9ee

📥 Commits

Reviewing files that changed from the base of the PR and between 5682206 and 3a0b7f2.

📒 Files selected for processing (21)
  • src/app/products/loan-products/create-loan-product/create-loan-product.component.html
  • src/app/products/loan-products/create-loan-product/create-loan-product.component.ts
  • src/app/products/loan-products/wizard/loan-product-wizard.component.html
  • src/app/products/loan-products/wizard/loan-product-wizard.component.spec.ts
  • src/app/products/loan-products/wizard/loan-product-wizard.component.ts
  • src/app/products/loan-products/wizard/loan-product.config.spec.ts
  • src/app/products/loan-products/wizard/loan-product.config.ts
  • src/app/products/products-routing.module.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/assets/translations/es-MX.json Outdated
Comment thread src/assets/translations/fr-FR.json Outdated
Comment thread src/assets/translations/lv-LV.json Outdated
Comment thread src/assets/translations/ne-NE.json Outdated
Comment thread src/assets/translations/pt-PT.json Outdated
Comment thread src/assets/translations/sw-SW.json Outdated

@IOhacker IOhacker 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.

@YousufFFFF could you plesae add a video?

@YousufFFFF

Copy link
Copy Markdown
Member Author

Yess sure @IOhacker

@YousufFFFF

Copy link
Copy Markdown
Member Author

I have attached a video @IOhacker

@YousufFFFF

Copy link
Copy Markdown
Member Author

I will add the translations fixes in some time @IOhacker.

@YousufFFFF
YousufFFFF force-pushed the feature/two-wheeler-education-agriculture branch from 3a0b7f2 to a84696b Compare July 28, 2026 19:29

@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: 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/assets/translations/lv-LV.json`:
- Line 1133: Update all affected Two Wheeler translations in
src/assets/translations/lv-LV.json: lines 1133 and 3421-3422. Replace
motorcycle-specific Latvian wording in the creation heading, product label, and
description with a semantically broader phrase such as “divriteņu
transportlīdzekļa aizdevums.”
🪄 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 Plus

Run ID: 54d613b5-9892-465f-b3db-42f5cf58c01f

📥 Commits

Reviewing files that changed from the base of the PR and between 3a0b7f2 and a84696b.

📒 Files selected for processing (21)
  • src/app/products/loan-products/create-loan-product/create-loan-product.component.html
  • src/app/products/loan-products/create-loan-product/create-loan-product.component.ts
  • src/app/products/loan-products/wizard/loan-product-wizard.component.html
  • src/app/products/loan-products/wizard/loan-product-wizard.component.spec.ts
  • src/app/products/loan-products/wizard/loan-product-wizard.component.ts
  • src/app/products/loan-products/wizard/loan-product.config.spec.ts
  • src/app/products/loan-products/wizard/loan-product.config.ts
  • src/app/products/products-routing.module.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 as they are similar to previous changes (19)
  • src/app/products/loan-products/create-loan-product/create-loan-product.component.html
  • src/assets/translations/ko-KO.json
  • src/assets/translations/en-US.json
  • src/assets/translations/de-DE.json
  • src/app/products/products-routing.module.ts
  • src/assets/translations/fr-FR.json
  • src/assets/translations/it-IT.json
  • src/assets/translations/es-MX.json
  • src/assets/translations/ne-NE.json
  • src/assets/translations/sw-SW.json
  • src/assets/translations/cs-CS.json
  • src/app/products/loan-products/create-loan-product/create-loan-product.component.ts
  • src/app/products/loan-products/wizard/loan-product-wizard.component.html
  • src/assets/translations/lt-LT.json
  • src/assets/translations/pt-PT.json
  • src/app/products/loan-products/wizard/loan-product-wizard.component.spec.ts
  • src/app/products/loan-products/wizard/loan-product.config.spec.ts
  • src/app/products/loan-products/wizard/loan-product-wizard.component.ts
  • src/app/products/loan-products/wizard/loan-product.config.ts

Comment thread src/assets/translations/lv-LV.json Outdated
@YousufFFFF
YousufFFFF force-pushed the feature/two-wheeler-education-agriculture branch 3 times, most recently from 590c853 to d0a7b8b Compare July 28, 2026 19:44
@YousufFFFF

Copy link
Copy Markdown
Member Author

Hello @IOhacker !
I have fixed all the coderabbit comments and even added a video too!
Thankyou for your review!

@YousufFFFF
YousufFFFF force-pushed the feature/two-wheeler-education-agriculture branch from d0a7b8b to 1b0b705 Compare July 28, 2026 20:41
@IOhacker

Copy link
Copy Markdown
Contributor

@YousufFFFF is there an endpoint for two wheelers loan? or agriculture loans? Seems this is video is using the same API....

@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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/assets/translations/lt-LT.json (1)

4253-4253: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Fix the Lithuanian currency-conversion messages.

The first string has an incorrect case agreement, and the second is unnatural. Prefer Šaltinio ir tikslinės valiutos negali būti vienodos and Nepavyko konvertuoti valiutos. Bandykite dar kartą.

Also applies to: 4272-4272

🤖 Prompt for 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.

In `@src/assets/translations/lt-LT.json` at line 4253, Update the Lithuanian
translation for “Source and target currencies cannot be identical” to “Šaltinio
ir tikslinės valiutos negali būti vienodos”, and update the related
currency-conversion failure message at the referenced translation entry to
“Nepavyko konvertuoti valiutos. Bandykite dar kartą.”
🤖 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/assets/translations/lt-LT.json`:
- Line 3458: Update the Lithuanian translation value for the funding description
to explicitly refer to study tuition fees, replacing the ambiguous “Mokslo”
wording with “Studijų mokesčio” while preserving the rest of the translated
meaning.

---

Outside diff comments:
In `@src/assets/translations/lt-LT.json`:
- Line 4253: Update the Lithuanian translation for “Source and target currencies
cannot be identical” to “Šaltinio ir tikslinės valiutos negali būti vienodos”,
and update the related currency-conversion failure message at the referenced
translation entry to “Nepavyko konvertuoti valiutos. Bandykite dar kartą.”
🪄 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 Plus

Run ID: 6c084641-9b67-4124-96a8-4e0f34c961e0

📥 Commits

Reviewing files that changed from the base of the PR and between f8292d4 and 1b0b705.

📒 Files selected for processing (21)
  • src/app/products/loan-products/create-loan-product/create-loan-product.component.html
  • src/app/products/loan-products/create-loan-product/create-loan-product.component.ts
  • src/app/products/loan-products/wizard/loan-product-wizard.component.html
  • src/app/products/loan-products/wizard/loan-product-wizard.component.spec.ts
  • src/app/products/loan-products/wizard/loan-product-wizard.component.ts
  • src/app/products/loan-products/wizard/loan-product.config.spec.ts
  • src/app/products/loan-products/wizard/loan-product.config.ts
  • src/app/products/products-routing.module.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 as they are similar to previous changes (17)
  • src/app/products/loan-products/create-loan-product/create-loan-product.component.html
  • src/assets/translations/de-DE.json
  • src/app/products/products-routing.module.ts
  • src/assets/translations/sw-SW.json
  • src/assets/translations/en-US.json
  • src/assets/translations/it-IT.json
  • src/assets/translations/pt-PT.json
  • src/assets/translations/ko-KO.json
  • src/app/products/loan-products/create-loan-product/create-loan-product.component.ts
  • src/assets/translations/cs-CS.json
  • src/app/products/loan-products/wizard/loan-product-wizard.component.ts
  • src/app/products/loan-products/wizard/loan-product.config.spec.ts
  • src/assets/translations/lv-LV.json
  • src/app/products/loan-products/wizard/loan-product.config.ts
  • src/assets/translations/fr-FR.json
  • src/app/products/loan-products/wizard/loan-product-wizard.component.spec.ts
  • src/app/products/loan-products/wizard/loan-product-wizard.component.html

Comment thread src/assets/translations/lt-LT.json Outdated
@YousufFFFF

Copy link
Copy Markdown
Member Author

@YousufFFFF is there an endpoint for two wheelers loan? or agriculture loans? Seems this is video is using the same API....

You're right that it's the same API, that's intentional, and there's no separate endpoint for any of these.

All five templates (Personal, Custom/Advanced, Two Wheeler, Education, Agriculture) submit to the single POST /loanproducts endpoint via ProductsService.createLoanProduct(). Fineract's loan-product model has no sub-type or category discriminator — a "two wheeler loan product" and an "agriculture loan product" are both just loan products whose field values are different. So there's nothing backend-side to add a template against, and no new endpoint this PR could have used.

@YousufFFFF

Copy link
Copy Markdown
Member Author

This also follows the pattern already merged in #3701 and #3711, Personal Loan and Custom/Advanced share the same endpoint the same way; this PR extends that mechanism to three more products rather than introducing a new approach.

@IOhacker

Copy link
Copy Markdown
Contributor

If they are the same, why to use another flow that increases the maintenance complexity?

@IOhacker

Copy link
Copy Markdown
Contributor

If you want to add products preconfigured, then you can create an API Rest to populate the loan products or create a liquibase script.

@YousufFFFF
YousufFFFF force-pushed the feature/two-wheeler-education-agriculture branch from 1b0b705 to 08c25da Compare July 28, 2026 20:59
@YousufFFFF

Copy link
Copy Markdown
Member Author

If they are the same, why to use another flow that increases the maintenance complexity?

The guided wizard was merged in #3701/#3711,Personal and Custom/Advanced have run on it since. This adds three profiles to that existing machinery: entries in hiddenDefaultsFor(), PROFILE_INITIAL_OVERRIDES and PROFILE_ROUTES. No new components, services or endpoints.

It also reduces divergence. The wizard previously had a hand-rolled accounting step that couldn't collect GL mappings at all. I replaced it with Classic's LoanProductAccountingStepComponent. The payload goes through Classic's own buildPayload() + sanitizeCreateLoanProductPayload, so the request contract has one owner, what's wizard-specific is field visibility and defaults, not duplicated logic.

@YousufFFFF

Copy link
Copy Markdown
Member Author

If you want to add products preconfigured, then you can create an API Rest to populate the loan products or create a liquibase script.

Those solve a different problem, I think, worth separating seeded products from creation templates.

A Liquibase script or seeding endpoint creates actual product rows in every tenant at install time. But a loan product isn't portable: for Cash/Accrual, fundSourceAccountId, loanPortfolioAccountId and the rest are mandatory and point at that tenant's GL accounts, plus currency, charges and delinquency buckets are all tenant-specific. A seed can't know any of those. And also once seeded, those rows show up in every product list whether the tenant wanted them or not.

@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: 1

🧹 Nitpick comments (1)
src/app/products/loan-products/wizard/loan-product.config.ts (1)

831-838: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Stale doc: guided modes list is no longer just Personal/Two Wheeler.

isGuidedProfileMode now covers education and agriculture too; the doc enumerating "(Personal, Two Wheeler)" will mislead the next reader about which profiles hit the guided path. Same wording appears in the buildPayload merge comment.

📝 Proposed doc fix
-/**
- * Guided template modes (Personal, Two Wheeler) hide the HIDDEN_DEFAULTS long-tail, force the
- * Progressive + advanced-payment-allocation stack and run the guided payload transforms in
- * {`@link` buildPayload}. Only Custom/Advanced exposes every control and lets the form win the merge.
- */
+/**
+ * Guided template modes (every profile except Custom/Advanced: Personal, Two Wheeler, Education,
+ * Agriculture) hide the HIDDEN_DEFAULTS long-tail and run the guided payload transforms in
+ * {`@link` buildPayload}. Forcing the Progressive + advanced-payment-allocation stack is a narrower
+ * subset — see {`@link` forcesProgressiveStack}. Only Custom/Advanced exposes every control and lets
+ * the form win the merge.
+ */
🤖 Prompt for 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.

In `@src/app/products/loan-products/wizard/loan-product.config.ts` around lines
831 - 838, Update the documentation for isGuidedProfileMode and the related
buildPayload merge comment to describe all guided profiles, including education
and agriculture, rather than listing only Personal and Two Wheeler. Keep the
documented Custom/Advanced behavior and guided payload behavior accurate.
🤖 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/products/loan-products/wizard/loan-product.config.ts`:
- Around line 1493-1506: Update the education profile’s maxTrancheCount field
validation to require at least two tranches instead of zero. In the
multi-disburse payload construction around sendsMultiDisburseFields, normalize
an empty or null maxTrancheCount to the established default before sending,
while preserving valid user-provided values.

---

Nitpick comments:
In `@src/app/products/loan-products/wizard/loan-product.config.ts`:
- Around line 831-838: Update the documentation for isGuidedProfileMode and the
related buildPayload merge comment to describe all guided profiles, including
education and agriculture, rather than listing only Personal and Two Wheeler.
Keep the documented Custom/Advanced behavior and guided payload behavior
accurate.
🪄 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 Plus

Run ID: 92f90ed3-d6ad-4382-8b29-79fb92d25bdf

📥 Commits

Reviewing files that changed from the base of the PR and between 1b0b705 and 08c25da.

📒 Files selected for processing (21)
  • src/app/products/loan-products/create-loan-product/create-loan-product.component.html
  • src/app/products/loan-products/create-loan-product/create-loan-product.component.ts
  • src/app/products/loan-products/wizard/loan-product-wizard.component.html
  • src/app/products/loan-products/wizard/loan-product-wizard.component.spec.ts
  • src/app/products/loan-products/wizard/loan-product-wizard.component.ts
  • src/app/products/loan-products/wizard/loan-product.config.spec.ts
  • src/app/products/loan-products/wizard/loan-product.config.ts
  • src/app/products/products-routing.module.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 as they are similar to previous changes (20)
  • src/app/products/loan-products/create-loan-product/create-loan-product.component.html
  • src/app/products/products-routing.module.ts
  • src/assets/translations/en-US.json
  • src/assets/translations/cs-CS.json
  • src/assets/translations/fr-FR.json
  • src/assets/translations/lt-LT.json
  • src/assets/translations/es-CL.json
  • src/app/products/loan-products/create-loan-product/create-loan-product.component.ts
  • src/assets/translations/it-IT.json
  • src/assets/translations/lv-LV.json
  • src/app/products/loan-products/wizard/loan-product-wizard.component.html
  • src/assets/translations/es-MX.json
  • src/assets/translations/sw-SW.json
  • src/assets/translations/pt-PT.json
  • src/assets/translations/ne-NE.json
  • src/assets/translations/ko-KO.json
  • src/app/products/loan-products/wizard/loan-product.config.spec.ts
  • src/assets/translations/de-DE.json
  • src/app/products/loan-products/wizard/loan-product-wizard.component.spec.ts
  • src/app/products/loan-products/wizard/loan-product-wizard.component.ts

Comment thread src/app/products/loan-products/wizard/loan-product.config.ts
@IOhacker

IOhacker commented Jul 28, 2026 via email

Copy link
Copy Markdown
Contributor

@YousufFFFF

Copy link
Copy Markdown
Member Author

So how should I proceed now @IOhacker ?

@IOhacker

IOhacker commented Jul 28, 2026 via email

Copy link
Copy Markdown
Contributor

@YousufFFFF

Copy link
Copy Markdown
Member Author

Okay as you say, Victor, but what will be the other way of implementing this?

@IOhacker

IOhacker commented Jul 28, 2026 via email

Copy link
Copy Markdown
Contributor

feat: add Educational Loan template

feat: add Agricultural Loan template

Accounting with Tranche and spreadsheet followed
@YousufFFFF
YousufFFFF force-pushed the feature/two-wheeler-education-agriculture branch from 08c25da to 049013b Compare July 31, 2026 20:36
@IOhacker
IOhacker merged commit 10e0f91 into openMF:dev Jul 31, 2026
6 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.

2 participants