Skip to content

Commit 2005214

Browse files
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

drizzle/0011_smiling_butterfly.sql

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
-- Rename member status enum values to align with Tietokilta bylaws (säännöt):
2+
-- "expired" → "resigned" (eronnut: voluntary resignation §8p1, deemed resigned §8p2, expelled §9)
3+
-- "cancelled" → "rejected" (hylätty: board rejected application, or payment failed)
4+
5+
ALTER TABLE "member" ALTER COLUMN "status" SET DATA TYPE text;--> statement-breakpoint
6+
UPDATE "member" SET "status" = 'resigned' WHERE "status" = 'expired';--> statement-breakpoint
7+
UPDATE "member" SET "status" = 'rejected' WHERE "status" = 'cancelled';--> statement-breakpoint
8+
DROP TYPE "public"."member_status";--> statement-breakpoint
9+
CREATE TYPE "public"."member_status" AS ENUM('awaiting_payment', 'awaiting_approval', 'active', 'resigned', 'rejected');--> statement-breakpoint
10+
ALTER TABLE "member" ALTER COLUMN "status" SET DATA TYPE "public"."member_status" USING "status"::"public"."member_status";

0 commit comments

Comments
 (0)