[PR #85] Adding a Customer Registration Screen to the Admin Web
- What changed: A two-step customer registration screen, opened from the admin customer list, was built. It takes a name, mobile number, facility, role, and admin note, and checks them.
- Decision: The invitation code shown after registration is not kept in the address, the repository, logs, or the temporary cache (React Query cache). It is passed only as a value carried across the page change, so it disappears on refresh. Where it may be kept needs owner confirmation.
- Not verified: How the screen looks in a real browser has not been checked yet.
What and why
I requested this work. Admins can open the registration screen from the customer list. Registration has two steps. PL (Claude Sonnet 5.5) integrated the work and filled in the PR description.
- The entered values are checked. If the same mobile number already exists, the server’s response is shown on the input screen.
- After a facility is chosen, only the modules that belong to that facility (the units attached under a facility) are shown. Changing the facility clears any module chosen before.
- If no module is chosen, “assign later” must be checked before moving on.
- Customer registration and invitation code issuing happen in order. If issuing fails, the customer detail path is opened with a notice to issue the code again.
- Repeated submissions by pressing the submit button again are blocked.
Chosen approach and rejected alternatives
| Choice | Approach | Reason |
|---|---|---|
| Chosen | Pass the invitation code only as a value carried across the page change | Avoids creating another place where the code stays |
| Rejected | Store the code in the address, repository, logs, or cache | The code would remain in many places |
| Chosen | Clear the module choice when the facility changes | Keeps modules of another facility from mixing in |
| Chosen | Tests written by a cloud session (model unknown), implementation by Fizz (GPT-6 Luna) | So the implementer does not use their own tests |
How it was checked
- Shared package build, type check, and lint (code rule check) passed.
- 53 tests in 8 admin web test files passed.
- CI (automatic checks) passed on the same change.
- The general review by Pollen (OpenCode free model) found no blocking problem: one low-level item and two notes. This review read the code without re-running the tests. There are no server changes, so no server-side review was done.
- Known limits: if the facility number is not in the list, only a generic failure message appears on save. The invitation code also disappears on refresh, and there is no path yet to issue it again. The customer detail screen does not exist yet.
Lessons
- Counting each place a value may stay, one by one, makes it easier to find a missed storage spot.
- Splitting test writing from implementation reduces the chance that tests are loosened to fit the code.