Aman-Mittal opened a new pull request, #227:
URL: https://github.com/apache/fineract-backoffice-ui/pull/227
Two defects, both of which stop a save from going through and neither of
which any existing test could catch. Found by driving the UI end to end against
a real Fineract with no API seeding.
Closes #226
Closes #225
---
### 1. Every dated submission fails on the 1st to the 9th of the month
`formatDateToFineract` built the day with `d.getDate()`, producing `"2
August 2026"`, while all **39** of its callers send that value alongside
`FINERACT_DATE_FORMAT = 'dd MMMM yyyy'`. `dd` means two digits, and Fineract
parses strictly against the format it is told to use — so the unpadded day did
not fail validation with a readable message, it failed to parse and came back
an unhandled **500**.
A/B against a live instance, day padding the only variable:
```
joiningDate='2 August 2026' -> HTTP 500
joiningDate='02 August 2026' -> HTTP 200
```
That covers staff, loan and savings creation, disbursement, repayment,
interest pauses, post-dated checks, journal entries — essentially every dated
write — for roughly a third of the calendar, including the 1st of the month,
when disbursements and month-start bookings land. The toast says only
"Operation failed", the date on screen looks valid, and retrying changes
nothing.
It survived because `date-formatter.spec.ts` only ever exercised the 15th:
```ts
expect(formatDateToFineract(new Date(2026, 0, 15))).toBe('15 January 2026');
```
and two component specs then asserted the unpadded output as the expected
payload, pinning the bug in place as intended behaviour. Both are corrected
here.
Added coverage: single-digit days from both `Date` and array inputs,
two-digit days left alone, and the invariant that actually matters — the
formatter's day is fixed-width, matching the `dd` it is always sent with.
### 2. Staff cannot be created without a mobile number
The form seeds `mobileNo` and `externalId` to `''` so the inputs bind, then
spreads them into the payload. An empty string is a value on the wire, not an
omission:
> The parameter 'mobileNo' must contain only digits with an optional leading
'+' and be between 7 and 15 digits
So an employee could not be created without typing a phone number, and the
error named a field the form itself presents as optional. Employee records gate
a lot of downstream work — loan officer and savings officer assignment,
relationship managers, portfolio attribution — so a branch setting up its first
office could not get started.
Blank optional fields are now dropped before submitting. `false` and `0`
survive, since they are real values and `isLoanOfficer: false` would otherwise
vanish.
Checked rather than assumed: the funds form has the same `''` seeding, but
that endpoint accepts an empty `externalId`, so it is left alone.
---
### Verification
- `773` unit tests pass (up from 768: four new formatter cases, one new
staff case). The one pre-existing failure was `interest-pause-form`, which had
encoded the unpadded format.
- `tsc`, `lint`, `format:check` clean.
- Both fixes confirmed against a live Fineract, and the end-to-end
walkthrough that surfaced them now gets past both steps.
### Note on why the mocked suite could not catch either
No mock parses a date or applies Fineract's parameter validation, so both
defects are invisible to the mocked e2e project and to unit tests by
construction — a spec can assert what the UI *sends*, but not that the server
accepts it. Both were found only by driving real screens against a real backend.
--
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]