add workload placement

This commit is contained in:
Yisroel Baum 2026-08-19 09:06:56 +03:00
parent 465db4a5b8
commit 46ba265f38
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
8 changed files with 291 additions and 34 deletions

View file

@ -6,6 +6,8 @@ import { API_BASE } from '@/utils/apiBase'
const isoDateSchema = z.string().regex(/^\d{4}-\d{2}-\d{2}$/)
export const workloadPlacementSchema = z.enum(['start', 'middle', 'end'])
export const scheduleSummarySchema = z.object({
id: z.number().int().positive(),
set: z.object({
@ -76,11 +78,13 @@ const errorResponseSchema = z.object({
export type ScheduleSummary = z.infer<typeof scheduleSummarySchema>
export type ScheduleDetail = z.infer<typeof scheduleDetailSchema>
export type AssignmentForDate = z.infer<typeof assignmentForDateSchema>
export type WorkloadPlacement = z.infer<typeof workloadPlacementSchema>
export type CreateScheduleInput = {
setId: number
levelId: number
startDate: string
targetDate: string
workloadPlacement: WorkloadPlacement
}
const LIST_ERROR = "We couldn't load your schedules."