diff --git a/packages/shared/src/index.ts b/packages/shared/src/index.ts index 227521b..bd1dfbb 100644 --- a/packages/shared/src/index.ts +++ b/packages/shared/src/index.ts @@ -20,6 +20,9 @@ export type MeResponse = z.infer; export const InsoleType = z.enum(['Kurk', 'Berk', '3D']); export type InsoleType = z.infer; +export const Role = z.enum(['worker', 'admin']); +export type Role = z.infer; + export const Activity = z.object({ id: z.number().int(), name: z.string(), @@ -45,6 +48,8 @@ export const WorkSession = z.object({ user_id: z.string(), activity_id: z.number().int(), activity_name: z.string().optional(), // present on history/active joins + user_name: z.string().optional(), // present only on admin cross-user views + user_email: z.string().optional(), // present only on admin cross-user views insole_type: InsoleType.nullable(), pair_count: z.number().int(), start_time: z.string(), // ISO-8601 @@ -63,3 +68,12 @@ export const StartSessionInput = z.object({ pair_count: z.number().int().min(1).default(2), }); export type StartSessionInput = z.infer; + +export const AdminUser = z.object({ + id: z.string(), + email: z.string().email(), + name: z.string(), + role: Role, + created_at: z.string(), +}); +export type AdminUser = z.infer;