mirror of
https://github.com/donpat1to/Schichtenplaner.git
synced 2026-01-21 18:39:41 +01:00
added init files
This commit is contained in:
35
backend/src/models/Shift.ts
Normal file
35
backend/src/models/Shift.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
// backend/src/models/Shift.ts
|
||||
export interface ShiftTemplate {
|
||||
id: string;
|
||||
name: string;
|
||||
shifts: TemplateShift[];
|
||||
createdBy: string;
|
||||
}
|
||||
|
||||
export interface TemplateShift {
|
||||
dayOfWeek: number; // 0-6
|
||||
name: string;
|
||||
startTime: string; // "08:00"
|
||||
endTime: string; // "12:00"
|
||||
requiredEmployees: number;
|
||||
}
|
||||
|
||||
export interface ShiftPlan {
|
||||
id: string;
|
||||
name: string;
|
||||
startDate: string;
|
||||
endDate: string;
|
||||
templateId?: string;
|
||||
shifts: AssignedShift[];
|
||||
status: 'draft' | 'published';
|
||||
createdBy: string;
|
||||
}
|
||||
|
||||
export interface AssignedShift {
|
||||
id: string;
|
||||
date: string;
|
||||
startTime: string;
|
||||
endTime: string;
|
||||
requiredEmployees: number;
|
||||
assignedEmployees: string[];
|
||||
}
|
||||
35
backend/src/models/ShiftTemplate.ts
Normal file
35
backend/src/models/ShiftTemplate.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
// backend/src/models/ShiftTemplate.ts
|
||||
export interface ShiftTemplate {
|
||||
id: string;
|
||||
name: string;
|
||||
description?: string;
|
||||
isDefault: boolean;
|
||||
createdBy: string;
|
||||
createdAt: string;
|
||||
shifts: TemplateShift[];
|
||||
}
|
||||
|
||||
export interface TemplateShift {
|
||||
id: string;
|
||||
templateId: string;
|
||||
dayOfWeek: number;
|
||||
name: string;
|
||||
startTime: string;
|
||||
endTime: string;
|
||||
requiredEmployees: number;
|
||||
color?: string;
|
||||
}
|
||||
|
||||
export interface CreateShiftTemplateRequest {
|
||||
name: string;
|
||||
description?: string;
|
||||
isDefault: boolean;
|
||||
shifts: Omit<TemplateShift, 'id' | 'templateId'>[];
|
||||
}
|
||||
|
||||
export interface UpdateShiftTemplateRequest {
|
||||
name?: string;
|
||||
description?: string;
|
||||
isDefault?: boolean;
|
||||
shifts?: Omit<TemplateShift, 'id' | 'templateId'>[];
|
||||
}
|
||||
15
backend/src/models/User.ts
Normal file
15
backend/src/models/User.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
// backend/src/models/User.ts
|
||||
export interface User {
|
||||
id: string;
|
||||
email: string;
|
||||
password: string; // gehashed
|
||||
name: string;
|
||||
role: 'admin' | 'instandhalter' | 'user';
|
||||
createdAt: Date;
|
||||
}
|
||||
|
||||
export interface UserSession {
|
||||
userId: string;
|
||||
token: string;
|
||||
expiresAt: Date;
|
||||
}
|
||||
Reference in New Issue
Block a user