Skip to content

Commit 1bd82fe

Browse files
committed
chore: remove phase 3 features from phase 2 branch
- Remove shareToken field from meeting table (phase 3 only) - Remove share-token.ts utilities (not needed until phase 3) - Remove auth redirect utilities (meant for phase 3 public links) - Remove share link UI from meeting detail page - Fix enum naming: use lowercase_snake_case consistently - change_in/check_out (not CHECK_IN/CHECK_OUT) - start/finish/recess_start/recess_end (not START/FINISH/etc) - Regenerate migration with corrected schema Phase 2 is now strictly admin-facing attendance tracking. Phase 3 will add public share links later.
1 parent 9b5bce5 commit 1bd82fe

16 files changed

Lines changed: 59 additions & 311 deletions

File tree

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
CREATE TYPE "public"."attendance_event_type" AS ENUM('CHECK_IN', 'CHECK_OUT');--> statement-breakpoint
2-
CREATE TYPE "public"."meeting_event_type" AS ENUM('START', 'RECESS_START', 'RECESS_END', 'FINISH');--> statement-breakpoint
1+
CREATE TYPE "public"."attendance_event_type" AS ENUM('check_in', 'check_out');--> statement-breakpoint
2+
CREATE TYPE "public"."meeting_event_type" AS ENUM('start', 'recess_start', 'recess_end', 'finish');--> statement-breakpoint
33
CREATE TYPE "public"."meeting_status" AS ENUM('upcoming', 'ongoing', 'recess', 'finished');--> statement-breakpoint
44
CREATE TYPE "public"."scan_method" AS ENUM('qr_scan', 'manual');--> statement-breakpoint
55
CREATE TABLE "attendance" (
@@ -19,10 +19,8 @@ CREATE TABLE "meeting" (
1919
"status" "meeting_status" DEFAULT 'upcoming' NOT NULL,
2020
"started_at" timestamp with time zone,
2121
"finished_at" timestamp with time zone,
22-
"share_token" text,
2322
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
24-
"updated_at" timestamp with time zone DEFAULT now() NOT NULL,
25-
CONSTRAINT "meeting_shareToken_unique" UNIQUE("share_token")
23+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
2624
);
2725
--> statement-breakpoint
2826
CREATE TABLE "meeting_event" (
Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"id": "ad2789f2-0e2e-4b5d-a772-3dcb4dd1800f",
2+
"id": "08f446d3-3854-423e-aae4-cb3959f3ffd3",
33
"prevId": "50801af7-1b43-4288-8979-3d1673cf61ed",
44
"version": "7",
55
"dialect": "postgresql",
@@ -301,12 +301,6 @@
301301
"primaryKey": false,
302302
"notNull": false
303303
},
304-
"share_token": {
305-
"name": "share_token",
306-
"type": "text",
307-
"primaryKey": false,
308-
"notNull": false
309-
},
310304
"created_at": {
311305
"name": "created_at",
312306
"type": "timestamp with time zone",
@@ -325,15 +319,7 @@
325319
"indexes": {},
326320
"foreignKeys": {},
327321
"compositePrimaryKeys": {},
328-
"uniqueConstraints": {
329-
"meeting_shareToken_unique": {
330-
"name": "meeting_shareToken_unique",
331-
"nullsNotDistinct": false,
332-
"columns": [
333-
"share_token"
334-
]
335-
}
336-
},
322+
"uniqueConstraints": {},
337323
"policies": {},
338324
"checkConstraints": {},
339325
"isRLSEnabled": false
@@ -1007,18 +993,18 @@
1007993
"name": "attendance_event_type",
1008994
"schema": "public",
1009995
"values": [
1010-
"CHECK_IN",
1011-
"CHECK_OUT"
996+
"check_in",
997+
"check_out"
1012998
]
1013999
},
10141000
"public.meeting_event_type": {
10151001
"name": "meeting_event_type",
10161002
"schema": "public",
10171003
"values": [
1018-
"START",
1019-
"RECESS_START",
1020-
"RECESS_END",
1021-
"FINISH"
1004+
"start",
1005+
"recess_start",
1006+
"recess_end",
1007+
"finish"
10221008
]
10231009
},
10241010
"public.meeting_status": {

drizzle/meta/_journal.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,20 @@
8585
"when": 1770921828266,
8686
"tag": "0011_gray_warlock",
8787
"breakpoints": true
88+
},
89+
{
90+
"idx": 12,
91+
"version": "7",
92+
"when": 1770926506375,
93+
"tag": "0012_omniscient_ezekiel",
94+
"breakpoints": true
95+
},
96+
{
97+
"idx": 13,
98+
"version": "7",
99+
"when": 1770926687027,
100+
"tag": "0013_fair_living_lightning",
101+
"breakpoints": true
88102
}
89103
]
90104
}

e2e/fixtures/attendance.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class AttendanceTestHelper {
3333
id: crypto.randomUUID(),
3434
meetingId: this.meetingId,
3535
userId,
36-
eventType: "CHECK_IN",
36+
eventType: "check_in",
3737
scanMethod: "manual",
3838
scannedBy: this.adminUserId,
3939
timestamp: timestamp || new Date(),
@@ -51,7 +51,7 @@ export class AttendanceTestHelper {
5151
id: crypto.randomUUID(),
5252
meetingId: this.meetingId,
5353
userId,
54-
eventType: "CHECK_OUT",
54+
eventType: "check_out",
5555
scanMethod: "manual",
5656
scannedBy: this.adminUserId,
5757
timestamp: timestamp || new Date(),
@@ -84,9 +84,9 @@ export class AttendanceTestHelper {
8484
const currentlyIn = new Set<string>();
8585

8686
for (const event of events) {
87-
if (event.eventType === "CHECK_IN") {
87+
if (event.eventType === "check_in") {
8888
currentlyIn.add(event.userId);
89-
} else if (event.eventType === "CHECK_OUT") {
89+
} else if (event.eventType === "check_out") {
9090
currentlyIn.delete(event.userId);
9191
}
9292
}
@@ -102,9 +102,9 @@ export class AttendanceTestHelper {
102102
*/
103103
async transitionMeeting(status: "upcoming" | "ongoing" | "recess" | "finished", notes?: string): Promise<void> {
104104
const eventTypeMap = {
105-
ongoing: "START",
106-
recess: "RECESS_START",
107-
finished: "FINISH",
105+
ongoing: "start",
106+
recess: "recess_start",
107+
finished: "finish",
108108
} as const;
109109

110110
// Update meeting status

src/lib/server/attendance/share-token.ts

Lines changed: 0 additions & 87 deletions
This file was deleted.

src/lib/server/auth/redirect.ts

Lines changed: 0 additions & 123 deletions
This file was deleted.

src/lib/server/db/schema.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ export const meeting = pgTable("meeting", {
202202
status: meetingStatusEnum().notNull().default("upcoming"),
203203
startedAt: timestamp({ withTimezone: true }),
204204
finishedAt: timestamp({ withTimezone: true }),
205-
shareToken: text().unique(),
206205
...timestamps,
207206
});
208207

src/lib/shared/enums.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ export type MeetingStatus = (typeof MEETING_STATUS_VALUES)[number];
4040
/**
4141
* Meeting event type values (lifecycle events)
4242
*/
43-
export const MEETING_EVENT_TYPE_VALUES = ["START", "RECESS_START", "RECESS_END", "FINISH"] as const;
43+
export const MEETING_EVENT_TYPE_VALUES = ["start", "recess_start", "recess_end", "finish"] as const;
4444
export type MeetingEventType = (typeof MEETING_EVENT_TYPE_VALUES)[number];
4545

4646
/**
4747
* Attendance event type values (check-in/check-out)
4848
*/
49-
export const ATTENDANCE_EVENT_TYPE_VALUES = ["CHECK_IN", "CHECK_OUT"] as const;
49+
export const ATTENDANCE_EVENT_TYPE_VALUES = ["check_in", "check_out"] as const;
5050
export type AttendanceEventType = (typeof ATTENDANCE_EVENT_TYPE_VALUES)[number];
5151

5252
/**

0 commit comments

Comments
 (0)