2025-02-26 23:56:19 +01:00
|
|
|
export interface ScheduleEvent {
|
|
|
|
name: string,
|
|
|
|
id: string,
|
2025-03-10 14:40:02 +01:00
|
|
|
crew?: boolean,
|
2025-02-26 23:56:19 +01:00
|
|
|
host?: string,
|
|
|
|
cancelled?: boolean,
|
|
|
|
description?: string,
|
2025-03-07 20:15:41 +01:00
|
|
|
interested?: number,
|
2025-02-26 23:56:19 +01:00
|
|
|
slots: TimeSlot[],
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ScheduleLocation {
|
|
|
|
name: string,
|
|
|
|
id: string,
|
|
|
|
description?: string,
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface TimeSlot {
|
|
|
|
id: string,
|
|
|
|
start: string,
|
|
|
|
end: string,
|
|
|
|
locations: string[],
|
2025-03-15 18:18:08 +01:00
|
|
|
assigned?: number[],
|
2025-03-07 20:15:41 +01:00
|
|
|
interested?: number,
|
2025-02-26 23:56:19 +01:00
|
|
|
}
|
|
|
|
|
2025-03-10 20:58:33 +01:00
|
|
|
export interface Shift {
|
|
|
|
name: string,
|
|
|
|
id: string,
|
|
|
|
role: string,
|
|
|
|
description?: string,
|
|
|
|
slots: ShiftSlot[],
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface Role {
|
|
|
|
name: string,
|
|
|
|
id: string,
|
|
|
|
description?: string,
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ShiftSlot {
|
|
|
|
id: string,
|
|
|
|
start: string,
|
|
|
|
end: string,
|
2025-03-15 18:18:08 +01:00
|
|
|
assigned?: number[],
|
2025-03-10 20:58:33 +01:00
|
|
|
}
|
|
|
|
|
2025-02-26 23:56:19 +01:00
|
|
|
export interface Schedule {
|
|
|
|
locations: ScheduleLocation[],
|
|
|
|
events: ScheduleEvent[],
|
2025-03-10 20:58:33 +01:00
|
|
|
roles?: Role[],
|
|
|
|
rota?: Shift[],
|
2025-02-26 23:56:19 +01:00
|
|
|
}
|
2025-03-11 14:11:05 +01:00
|
|
|
|
|
|
|
export type ChangeRecord<T extends { id: string }> =
|
|
|
|
| { op: "set", data: T }
|
|
|
|
| { op: "del", data: { id: string }}
|
|
|
|
;
|
|
|
|
|
|
|
|
export interface SchedulePatch {
|
|
|
|
locations?: ChangeRecord<ScheduleLocation>[],
|
|
|
|
events?: ChangeRecord<ScheduleEvent>[],
|
|
|
|
roles?: ChangeRecord<Role>[],
|
|
|
|
rota?: ChangeRecord<Shift>[],
|
|
|
|
}
|