feat(shared): manual-session create/update contracts
Add CreateManualSessionInput and AdminUpdateSessionInput zod schemas plus inferred types. packages/shared has no test runner, so these are exercised via Task 2's API tests rather than a standalone parse test.
This commit is contained in:
@@ -86,3 +86,27 @@ export const AdminUser = z.object({
|
|||||||
created_at: z.string(),
|
created_at: z.string(),
|
||||||
});
|
});
|
||||||
export type AdminUser = z.infer<typeof AdminUser>;
|
export type AdminUser = z.infer<typeof AdminUser>;
|
||||||
|
|
||||||
|
export const CreateManualSessionInput = z.object({
|
||||||
|
user_id: z.string(),
|
||||||
|
activity_id: z.number().int(),
|
||||||
|
insole_type: InsoleType,
|
||||||
|
pair_count: z.number().int().min(1),
|
||||||
|
start_time: z.string(),
|
||||||
|
end_time: z.string(),
|
||||||
|
paused_seconds: z.number().int().min(0).default(0),
|
||||||
|
notes: z.string().nullable().optional(),
|
||||||
|
});
|
||||||
|
export type CreateManualSessionInput = z.infer<typeof CreateManualSessionInput>;
|
||||||
|
|
||||||
|
export const AdminUpdateSessionInput = z.object({
|
||||||
|
activity_id: z.number().int(),
|
||||||
|
insole_type: InsoleType.nullable(),
|
||||||
|
pair_count: z.number().int().min(1),
|
||||||
|
start_time: z.string(),
|
||||||
|
end_time: z.string().nullable(),
|
||||||
|
paused_seconds: z.number().int().min(0),
|
||||||
|
notes: z.string().nullable(),
|
||||||
|
status: SessionStatus,
|
||||||
|
});
|
||||||
|
export type AdminUpdateSessionInput = z.infer<typeof AdminUpdateSessionInput>;
|
||||||
|
|||||||
Reference in New Issue
Block a user