[PR #87] Adding Code Issuing and Invite Management to the Admin Web
I requested this work.
- What was done: A window that issues codes, and a code tab, were connected to the customer detail screen. A code is what a customer uses to create an account, recover one, or add a sign-in method. The invite list gained customer search, facility and status filters, page navigation, and code revocation (cancelling a code already handed out). Revocation requires a reason.
- Chosen approach: An issued code lives only in the window’s component state. It is not stored in the React Query cache (a tool that keeps screen data for a while), browser storage, the URL, or logs. If the window is closed before the code is delivered, a confirmation asks whether to reissue. The server records a code only when the “delivered” button is pressed. A recovery code requires an identity check method (a way to confirm the customer is the account holder). A suspended account’s issue button is disabled.
- On failure: When the server returns 409 (the request does not fit the current state), the window shows “지금 상태에서는 코드를 발급할 수 없습니다. 고객 상태를 새로고침해 확인하세요.” — a message that asks the operator to refresh the customer’s state — and stays open. 500 and network errors keep the existing message.
- Checks: Type checking, linting (automatic code style checks), and 79 admin app tests passed. Test codes were changed to values that do not collide with fake phone numbers. Server tests could not run here because this environment has no Docker; GitHub CI checked them.
| Item | Detail |
|---|---|
| Scope | Code issuing window, code tab, invite list |
| Code storage | Window state only; not in cache, storage, URL, or logs |
| Delivery record | Written to the server only when “delivered” is pressed |
| 409 response | Shows a guidance message and keeps the window open |
| Checks | Type check, lint, 79 tests passed; server tests on GitHub CI |
Who did what
- I: requested the work. The two answers the owner gave were recorded in the decision log.
- Claude: built the issue window and the invite list, and fixed a mid-review finding. It also checked that the change touched only the admin web folder and docs.
- Fizz (GPT-6 Luna): wrote the tests.
- Pollen (OpenCode free model): reviewed the change. A wording mismatch for the 409 message found in review was fixed in the final commit.
Chosen and rejected
- Chosen: Code values stay in screen state only. Search, filter, and page values stay in the address, so the list survives a refresh.
- Rejected: Storing the issue response in the cache, because code values could remain in several places.
- Left out: An automated test for the 409 message was not added, because the plan kept the test count unchanged.
Not verified
- The 409 message is not covered by an automated test.
- The “delivery principle” text in the code window is a draft. The owner needs to confirm it matches the real operating guide.
- I did not look at the real browser screen myself while writing this record.
What I learned
For values that must not leak, count the places they could remain, one by one. This makes it easier to spot a missed place. Record a delivery only after the delivery is confirmed.