feat(staff): staff invitations by email (#133 slice B) #136
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
primatekuntech/kws!136
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/133-staff-invitations"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Slice B of #133: staff invitations by email (ADR 0030). Admin portal and POS (usher/checker) users join only by invitation; web, partner and mobile customers still register themselves.
POST /v1/admin/staff-invitations(Idempotency-Key,admin_portal.administration.manage, platform scope),GETlist,DELETE /{id}?version=(revoke; rows are never deleted),POST /v1/me/staff-invitations/accept(token in body, 1 KiB, every failure is one 404).staff_invitations(guard trigger, one new per email, audit excludes email and token hash); settingadmin_portal_url; worker emailnotify.staff_invitation(link<admin_portal_url>/accept-invitation#<token>&e=<email>) and jobstaff.invitations_expireevery 5 min.Not in this PR: the admin pages and the
/accept-invitationpage (#134).Reviews
Per-task reviews with fix rounds, then a whole-branch dual pass (Pass 1 ponytail, Pass 2 correctness) and one fix wave with re-checks. No Critical or Important findings remain; Ponytail Must fix list clear.
Checks
make cover91.6% (staff 96.0, staff/pgstore 90.6, notify 97.9, rbac/pgstore 84.9);go test ./...,make contract,make lint(0 issues);scripts/generate-clients.shran with no diff.Rulings
prompt=createfrom the accept page (assumption, see verify).Known limits (ADR 0030)
Cap of 100 pending can be passed by a few on concurrent invites; an overdue unswept row is in neither the new nor expired list for up to 5 min; inviter state read without a lock at accept; invite and accept lock in opposite order (rare deadlock gives retryable 503); API keys with the manage permission can create invitations; the idempotency record keeps the invited email 7 days;
admin_portal_urlnot scheme-checked;used_by/used_ateditable after use (as organization invitations).prompt=create, a real SMTP server, two real nodes. Worker and SMTP must run, andadmin_portal_urlmust be set, before invitations work.🤖 Generated with Claude Code