Commit 2005214
fix: align member status enum with Tietokilta bylaws (#160)
* feat: align member status lifecycle with Tietokilta bylaws
Rename member status enums: expired → resigned, cancelled → rejected
to match Tietokilta bylaws (§8 p1/p2 resignation, §9 expulsion, §26
board approval).
- Add shared state machine (VALID_TRANSITIONS) in src/lib/server/utils/member.ts
with isValidTransition/validateTransition helpers
- Wire transition validation into all admin remote functions (individual + bulk)
- Add confirmation dialogs (AlertDialog) for all admin member status actions
- Simplify bulk toolbar to approve + deem resigned only
- Auto-fill deem resigned reason with bylaw reference text
- Allow approve for awaiting_payment members (cash payment scenario)
- Only show deem resigned for active members with ended membership period
- Fix all remaining "expired"/"cancelled" references across codebase
(verify-qr, dashboard, purchase pages, comments)
- Update i18n translations (fi/en) for new status names and dialogs
- Add integration tests for transition validation util + DB lifecycle scenarios
- Regenerate drizzle migration on top of latest main
https://claude.ai/code/session_016X5yHMsXcSVFPgJPtiKxL3
* fix: address PR review feedback
- Filter bulk approve dialog to show only eligible members (approvable)
- Move hardcoded Finnish deem-resigned reason to i18n (deemResignedDefaultReason)
- Remove dead bulk exports: bulkRejectMembers, bulkResignMembers, bulkReactivateMembers
- Convert approveMember from form() to command() with confirmation dialog
- Add individual approve confirmation dialog (confirmApproveSingleTitle/Description)
- Cache Date.now() in getSelectedMembersByStatus for consistency
- Add trailing newline to migration file
- Remove unused getSelectedMemberNames and memberIdSchema import
https://claude.ai/code/session_016X5yHMsXcSVFPgJPtiKxL3
* fix: stale comment in auto-approval (expired → resigned)
https://claude.ai/code/session_016X5yHMsXcSVFPgJPtiKxL3
* fix: restrict auto-approval to active predecessors only, tighten approve actions
- Auto-approval now requires active (not resigned) predecessor membership,
since deeming resigned is a deliberate board action at year-end (§8 p2)
and resigned members should go through board review on renewal
- Restrict approveMember/bulkApproveMembers to only awaiting_approval and
awaiting_payment statuses — resigned/rejected must use reactivateMember
- Document bulk deem resigned asymmetry (period-ended guard for year-end cleanup)
https://claude.ai/code/session_016X5yHMsXcSVFPgJPtiKxL3
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 3581245 commit 2005214
40 files changed
Lines changed: 1860 additions & 456 deletions
File tree
- drizzle
- meta
- e2e
- src
- lib
- components
- ui/alert-dialog
- i18n
- en
- fi
- server
- db
- payment
- utils
- routes/[locale=locale]/(app)
- admin
- members
- import
- verify-qr
- membership
- new
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
0 commit comments