Repository navigation
fix(loans): show saved repayment dates when editing - #835
Aman-Mittal merged 1 commit into
Conversation
Read the existing first-repayment date into display-only state. Keep the replacement model empty until the officer chooses a date, so an unchanged edit preserves the existing update payload. Cover saved and missing dates, unchanged updates, explicit replacements and the existing create flow at desktop and mobile widths.
🔄 What this change talks toFrom the 1 application TypeScript file(s) changed in this pull request. sequenceDiagram
autonumber
participant LoanFormComponent as LoanFormComponent (Component)
participant PlatformDateService as PlatformDateService (Injected)
participant Router as Router (Injected)
participant LoanProductsService as LoanProductsService (API client)
participant Fineract as Fineract (REST API)
participant NotificationService as NotificationService (Injected)
participant LoansService as LoansService (API client)
participant MutationOutcomeService as MutationOutcomeService (Injected)
participant I18N as I18N (Injected)
LoanFormComponent->>PlatformDateService: today()
LoanFormComponent->>PlatformDateService: resolveToday()
LoanFormComponent->>Router: navigate()
LoanFormComponent->>LoanProductsService: getLoanproducts()
LoanProductsService->>Fineract: getLoanproducts()
Fineract-->>LoanProductsService: response
LoanFormComponent->>NotificationService: error()
LoanFormComponent->>LoanProductsService: getLoanproductsProductId()
LoanProductsService->>Fineract: getLoanproductsProductId()
Fineract-->>LoanProductsService: response
LoanFormComponent->>LoansService: getLoansLoanId()
LoansService->>Fineract: getLoansLoanId()
Fineract-->>LoansService: response
LoanFormComponent->>LoansService: putLoansLoanId()
LoansService->>Fineract: putLoansLoanId()
Fineract-->>LoansService: response
LoanFormComponent->>MutationOutcomeService: complete()
LoanFormComponent->>I18N: translate()
LoanFormComponent->>LoansService: postLoans()
LoansService->>Fineract: postLoans()
Fineract-->>LoansService: response
Generated by run 40193730677 from |
E2E — mocked backend🎭 E2E Tests✅ All green — 433 passed · 0 failed · 1 skipped, across 42 spec files in 9m 51s. By spec file
All 434 tests — click to expand
Slowest 10 — what the shard counts should be tuned against
📼 Download the HTML report, videos and traces — see the Generated by run 40193730690 from |
E2E — real Fineract🎭 E2E Tests✅ All green — 171 passed · 0 failed · 0 skipped, across 50 spec files in 11m 44s. By spec file
All 171 tests — click to expand
Slowest 10 — what the shard counts should be tuned against
📼 Download the HTML report, videos and traces — see the Generated by run 40193730690 from |
What and why
Editing a loan currently leaves the optional repayment-date picker at today, even when the loan has a saved first repayment date, and hides the “Not set” placeholder when none exists. Load the read API’s
expectedFirstRepaymentOnDateinto separate display state so both cases show the actual loan value.Opening/canceling the picker or saving an unchanged loan still omits
repaymentsStartingFromDatefrom the update. An officer-selected replacement uses the existing submission path. Create-mode selection and clearing retain their existing behavior.Part of #793; follows the edit-mode follow-up from #831. This addresses that follow-up only; the parent issue’s other items remain open.
Verification
TZ=UTCandTZ=America/New_York; 2 MFE tests passed.LoanAccountData.basicLoanDetailsexposeexpectedFirstRepaymentOnDate; generated UI API files were not edited. Existing installed dependencies were reused after verifying the exact package-lock hash; no dependency changes.Screenshots
Synthetic data from the passing browser run; the images live on a fork-only review branch outside this PR’s code diff.
AI assistance
Checklist