46 lines
1016 B
TypeScript
46 lines
1016 B
TypeScript
export const SHIFT_TYPES: ShiftType[] = [
|
|
'REGULAR',
|
|
'EVENING',
|
|
'EMERGENCY',
|
|
'HOLIDAY',
|
|
'VACATION',
|
|
'SICK'
|
|
];
|
|
|
|
export type ShiftType = 'REGULAR' | 'EVENING' | 'EMERGENCY' | 'HOLIDAY' | 'VACATION' | 'SICK';
|
|
|
|
export type ShiftLegendItem = {
|
|
type: ShiftType;
|
|
color: string;
|
|
label_type: string;
|
|
text_color?: string;
|
|
};
|
|
|
|
export class Shift {
|
|
shift_id: number;
|
|
timesheet_id: number;
|
|
date: string; //YYYY-MM-DD
|
|
type: ShiftType;
|
|
start_time: string; //HH:mm:ss
|
|
end_time: string; //HH:mm:ss
|
|
comment: string | undefined;
|
|
is_approved: boolean;
|
|
is_remote: boolean;
|
|
|
|
constructor() {
|
|
this.shift_id = -1;
|
|
this.timesheet_id = -1;
|
|
this.date = '';
|
|
this.type = 'REGULAR';
|
|
this.start_time = '';
|
|
this.end_time = '';
|
|
this.comment = undefined;
|
|
this.is_approved = false;
|
|
this.is_remote = false;
|
|
}
|
|
}
|
|
|
|
export interface NewShift {
|
|
timesheet_id: number;
|
|
shifts: Shift[];
|
|
} |