fix(api): add Zod bounds on financial fields, type vacation router, type scenarioData
- dailyCostCents, hoursPerDay, percentage now validated at API boundary - vacation router no longer uses ctx.db as any - scenarioData reads through typed Zod schema Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -6,7 +6,7 @@ export const CreateAllocationBaseSchema = z.object({
|
||||
projectId: z.string(),
|
||||
startDate: z.coerce.date(),
|
||||
endDate: z.coerce.date(),
|
||||
hoursPerDay: z.number().min(0).max(24),
|
||||
hoursPerDay: z.number().positive().max(24),
|
||||
percentage: z.number().min(0).max(100),
|
||||
role: z.string().max(200).optional(),
|
||||
roleId: z.string().optional(),
|
||||
@@ -20,7 +20,7 @@ export const CreateDemandRequirementBaseSchema = z.object({
|
||||
projectId: z.string(),
|
||||
startDate: z.coerce.date(),
|
||||
endDate: z.coerce.date(),
|
||||
hoursPerDay: z.number().min(0).max(24),
|
||||
hoursPerDay: z.number().positive().max(24),
|
||||
percentage: z.number().min(0).max(100),
|
||||
role: z.string().max(200).optional(),
|
||||
roleId: z.string().optional(),
|
||||
@@ -36,7 +36,7 @@ export const CreateAssignmentBaseSchema = z.object({
|
||||
projectId: z.string(),
|
||||
startDate: z.coerce.date(),
|
||||
endDate: z.coerce.date(),
|
||||
hoursPerDay: z.number().min(0).max(24),
|
||||
hoursPerDay: z.number().positive().max(24),
|
||||
percentage: z.number().min(0).max(100),
|
||||
role: z.string().max(200).optional(),
|
||||
roleId: z.string().optional(),
|
||||
|
||||
Reference in New Issue
Block a user