Aman-Mittal opened a new pull request, #851:
URL: https://github.com/apache/fineract-backoffice-ui/pull/851

   #850 fixed five optional date fields that rendered **today** for a value 
nobody set, and deferred ten because the right fix depends on whether the 
platform requires the field — a placeholder on a *mandatory* date only buys a 
server-side refusal. Those ten are settled here, read out of Fineract's own 
validators rather than inferred from the UI. Independent of #850 in files, so 
the two can merge in either order.
   
   The answer differs per field, and twice within the same form — which is why 
this wasn't a blanket conversion.
   
   ## Optional — the field says it is unset
   
   | field | the rule, and where it comes from |
   |---|---|
   | `wc-loan-form` `submittedOnDate` | 
`WorkingCapitalLoanApplicationDataValidator` documents it as optional and 
*substitutes the platform's current date* when absent — the tenant's date, 
better than anything the browser offers |
   | `wc-loan-product-form` `startDate`, `closeDate` | validated only when both 
are present |
   | `business-dates` `businessDate`, `cobDate` | both arrive from the server; 
the placeholder covers the window before they land, instead of showing today as 
if it were the tenant's date |
   | `email-campaign-form` `scheduledStartDate` | `EmailCampaignValidator` 
requires it **only** for a `SCHEDULE` campaign |
   
   ## Mandatory with a sensible default — seeded
   
   `wc-loan-form` `expectedDisbursementDate`. The same validator marks it 
mandatory (`// Mandatory: expectedDisbursementDate`), so it is seeded with the 
platform's today through `PlatformDateService`, as the client and loan forms do.
   
   Seeded **after** the edit-mode decision, not before. `resolveToday()` can 
answer immediately from cache, and my first attempt called it at the top of 
`ngOnInit` — which would have written today over an existing loan's own date on 
every visit to the edit form.
   
   ## Mandatory with no sensible default — the field blocks Save
   
   - `wc-breach-action-form` and `wc-delinquency-action-form` `endDate`: 
`notNull()` for the Pause action, which both forms already gate correctly. But 
the platform also enforces `startDate < endDate`, so today is not a default — 
it is a value that would be refused. Required, with a placeholder until the 
operator chooses.
   - `wc-loan-action-form` `expectedDisbursementDate`, offered only for 
`disburse`. I could not establish that command's rule from the module source, 
so it asks explicitly rather than defaulting a date for an action that moves 
money.
   
   ## What this rests on
   
   The rules come from `fineract-working-capital-loan`'s validators and 
`EmailCampaignValidator`, not from a running instance — the same way the 
family-member rules were established in #843. Where the source didn't answer, I 
have said so above rather than picked the convenient reading.
   
   ## Checks
   
   - unit suite 329 files / 2822 tests; **all five existing specs for these 
forms pass unedited** (67 cases between them)
   - one new case pins the single behaviour change — seeded versus deliberately 
unset, in the same form — and names the validator that decides it
   - `lint` silent, `tsc` clean, `i18n:check` clean, `format:check` clean; 
`check:ui-primitives`, `check:a11y-names`, `check:template-text`, 
`check:responsive` pass
   
   One thing worth a reviewer's eye: five of the converted `ion-item`s carried 
layout classes (`full-width`, `form-item`) that the structural conversion 
dropped. I caught that by diffing the removed lines rather than by it failing 
anything — no test covers item width. They are back on the field host, where 
`.form-item`'s `--border-radius` still reaches the inner `ion-item` because 
custom properties inherit.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to