feat: phase 3 — history endpoints (start, entries, complete)
This commit is contained in:
21
backend/src/validators/history.validators.ts
Normal file
21
backend/src/validators/history.validators.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const startHistorySchema = z.object({
|
||||
programId: z.string().min(1),
|
||||
});
|
||||
|
||||
export const addEntrySchema = z.object({
|
||||
exerciseId: z.string().min(1),
|
||||
sets: z.number().int().min(1),
|
||||
reps: z.number().int().min(1).optional(),
|
||||
weightKg: z.number().min(0).optional(),
|
||||
durationSec: z.number().int().min(1).optional(),
|
||||
});
|
||||
|
||||
export const completeHistorySchema = z.object({
|
||||
notes: z.string().max(500).optional(),
|
||||
});
|
||||
|
||||
export type StartHistoryInput = z.infer<typeof startHistorySchema>;
|
||||
export type AddEntryInput = z.infer<typeof addEntrySchema>;
|
||||
export type CompleteHistoryInput = z.infer<typeof completeHistorySchema>;
|
||||
Reference in New Issue
Block a user