Aman-Mittal opened a new issue, #225:
URL: https://github.com/apache/fineract-backoffice-ui/issues/225
## What happens
Create a staff member from **Organization → Employees → Create**, fill in
only the required fields (Office, First Name, Last Name, Activation Date) and
save. The form stays where it is and shows the generic failure toast. Nothing
indicates which field is at fault, and every field marked required is already
filled in.
## Why
The form seeds its optional text fields to the empty string so the inputs
bind cleanly:
```ts
readonly staff = signal<Partial<StaffCreateRequest>>({
officeId: undefined, firstname: '', lastname: '', externalId: '',
mobileNo: '', isLoanOfficer: false, isActive: true, forceStatus: false,
});
```
Those empty strings are then spread straight into the payload. An empty
string is a *value* on the wire, not an omission, and Fineract validates it as
one:
> The parameter 'mobileNo' must contain only digits with an optional leading
'+' and be between 7 and 15 digits
Confirmed against a live instance — the identical payload with `mobileNo`
and `externalId` omitted is accepted.
## Business value
Employee records are a prerequisite for most day-to-day work: a staff member
has to exist before they can be assigned as a loan officer or a savings
officer, before a client can be given a relationship manager, and before any
portfolio can be attributed to anyone. A branch that does not record staff
mobile numbers — or is simply setting up its first office — currently cannot
create an employee at all, and the error names a field the form itself presents
as optional. Anyone hitting this has no way to work out that typing a phone
number is the workaround.
## Fix
Drop empty optional fields before submitting, so a field left blank is
genuinely absent rather than sent as `""`. `false` and `0` must survive — they
are real values, not blanks.
Also checked: the same shape appears in the funds form (`externalId: ''`),
but that endpoint accepts an empty string, so it is not affected. Verified
against a live instance rather than assumed.
## How it was found
By driving the UI end to end against a real backend, with no API seeding —
the create-staff step of a savings demo could not get past the form. Unit tests
and the mocked e2e suite both pass, because neither exercises the real
validation.
--
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]