Files
agiledancers/agiledancers-fe/src/app/core/api-models.ts
Wanja Krah 694bf3fa86
All checks were successful
Build, test and publish / verify (push) Successful in 7m31s
S16 postgresql opslag added
2026-11-04 17:10:25 +01:00

93 lines
2.4 KiB
TypeScript

export interface School {
id: number;
revision: number;
name: string;
dancerIds: number[];
danceGroupIds: number[];
showIds: number[];
}
export interface Dancer {
id: number;
name: string;
birthDate: string;
}
export type GroupType = 'SHOW_CASE' | 'PRE_EDUCATION' | 'SELECTION' | 'REGULAR' | 'PRE_SCHOOLER';
export type GroupStyle = 'HIPHOP' | 'JAZZ' | 'MODERN' | 'STREETDANCE' | 'CLASSIC' | 'BREAKDANCE';
export interface DanceGroup {
id: number;
category: string;
type: GroupType;
startAge: number;
endAge: number;
styles: GroupStyle[];
dancerIds: number[];
}
export type DayPartType = 'MORNING' | 'AFTERNOON' | 'EVENING';
export interface DayPart {
date: string;
type: DayPartType;
danceGroupIds: number[];
}
export interface Coach {
id: number;
name: string;
dancerId: number | null;
}
export interface Show {
id: number;
name: string;
dayParts: DayPart[];
appearances: Partial<Record<GroupType, number>>;
preferredDayParts: number;
finalized: boolean;
violations: string[];
}
export interface SchoolRequest {
name: string;
}
export interface DancerRequest {
name: string;
birthDate: string;
}
export interface GroupRequest {
category: string;
type: GroupType;
startAge: number;
endAge: number;
styles: GroupStyle[];
}
export interface ShowRequest {
name: string;
dayParts: { date: string; type: DayPartType }[];
appearances?: Partial<Record<GroupType, number>>;
preferredDayParts?: number;
}
export type ResourceKind = 'school' | 'dancer' | 'group' | 'show';
export type EditorTarget =
| { kind: 'school'; value?: School }
| { kind: 'dancer'; value?: Dancer }
| { kind: 'group'; value?: DanceGroup }
| { kind: 'show'; value?: Show };
export interface SchoolData {
school: School;
dancers: Dancer[];
groups: DanceGroup[];
shows: Show[];
coaches: Coach[];
}
export const GROUP_TYPES: { value: GroupType; label: string }[] = [
{ value: 'REGULAR', label: 'Regulier' },
{ value: 'SHOW_CASE', label: 'Showcase' },
{ value: 'PRE_EDUCATION', label: 'Vooropleiding' },
{ value: 'SELECTION', label: 'Selectie' },
{ value: 'PRE_SCHOOLER', label: 'Kleuters' },
];
export const GROUP_STYLES: { value: GroupStyle; label: string }[] = [
{ value: 'HIPHOP', label: 'Hiphop' },
{ value: 'JAZZ', label: 'Jazz' },
{ value: 'MODERN', label: 'Modern' },
{ value: 'STREETDANCE', label: 'Streetdance' },
{ value: 'CLASSIC', label: 'Klassiek' },
{ value: 'BREAKDANCE', label: 'Breakdance' },
];