mirror of
https://github.com/donpat1to/Schichtenplaner.git
synced 2026-01-21 18:39:41 +01:00
changed email creation
This commit is contained in:
@@ -14,7 +14,6 @@ export interface Employee {
|
||||
}
|
||||
|
||||
export interface CreateEmployeeRequest {
|
||||
email: string;
|
||||
password: string;
|
||||
firstname: string;
|
||||
lastname: string;
|
||||
|
||||
@@ -3,15 +3,15 @@ export interface ShiftPlan {
|
||||
id: string;
|
||||
name: string;
|
||||
description?: string;
|
||||
startDate?: string; // Optional for templates
|
||||
endDate?: string; // Optional for templates
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
isTemplate: boolean;
|
||||
status: 'draft' | 'published' | 'archived' | 'template';
|
||||
createdBy: string;
|
||||
createdAt: string;
|
||||
timeSlots: TimeSlot[];
|
||||
shifts: Shift[];
|
||||
scheduledShifts?: ScheduledShift[]; // Only for non-template plans with dates
|
||||
scheduledShifts?: ScheduledShift[];
|
||||
}
|
||||
|
||||
export interface TimeSlot {
|
||||
@@ -85,7 +85,6 @@ export interface AssignEmployeeRequest {
|
||||
scheduledShiftId: string;
|
||||
}
|
||||
|
||||
|
||||
export interface UpdateRequiredEmployeesRequest {
|
||||
requiredEmployees: number;
|
||||
}
|
||||
@@ -2,15 +2,20 @@
|
||||
import { Employee } from './Employee.js';
|
||||
import { ShiftPlan } from './ShiftPlan.js';
|
||||
|
||||
// Add the missing type definitions
|
||||
// Updated Availability interface to match new schema
|
||||
export interface Availability {
|
||||
id: string;
|
||||
employeeId: string;
|
||||
planId: string;
|
||||
dayOfWeek: number; // 1=Monday, 7=Sunday
|
||||
timeSlotId: string;
|
||||
shiftId: string; // Now references shift_id instead of time_slot_id + day_of_week
|
||||
preferenceLevel: 1 | 2 | 3; // 1:preferred, 2:available, 3:unavailable
|
||||
notes?: string;
|
||||
// Optional convenience fields (can be joined from shifts and time_slots tables)
|
||||
dayOfWeek?: number;
|
||||
timeSlotId?: string;
|
||||
timeSlotName?: string;
|
||||
startTime?: string;
|
||||
endTime?: string;
|
||||
}
|
||||
|
||||
export interface Constraint {
|
||||
@@ -120,4 +125,77 @@ export interface ShiftRequirement {
|
||||
maxEmployees: number;
|
||||
assignedEmployees: string[];
|
||||
isPriority: boolean;
|
||||
}
|
||||
|
||||
// New types for the updated schema
|
||||
export interface EmployeeWithRoles extends Employee {
|
||||
roles: string[];
|
||||
}
|
||||
|
||||
export interface ShiftWithDetails {
|
||||
id: string;
|
||||
planId: string;
|
||||
timeSlotId: string;
|
||||
dayOfWeek: number;
|
||||
requiredEmployees: number;
|
||||
color?: string;
|
||||
timeSlot: {
|
||||
id: string;
|
||||
name: string;
|
||||
startTime: string;
|
||||
endTime: string;
|
||||
description?: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface AvailabilityWithDetails extends Availability {
|
||||
employee?: {
|
||||
id: string;
|
||||
firstname: string;
|
||||
lastname: string;
|
||||
employeeType: 'manager' | 'trainee' | 'experienced';
|
||||
canWorkAlone: boolean;
|
||||
};
|
||||
shift?: {
|
||||
dayOfWeek: number;
|
||||
timeSlotId: string;
|
||||
timeSlot?: {
|
||||
name: string;
|
||||
startTime: string;
|
||||
endTime: string;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
// Types for scheduling algorithm input
|
||||
export interface SchedulingInput {
|
||||
planId: string;
|
||||
startDate: string;
|
||||
endDate: string;
|
||||
constraints: Constraint[];
|
||||
options?: SolverOptions;
|
||||
}
|
||||
|
||||
// Types for scheduling results with enhanced information
|
||||
export interface EnhancedAssignment extends Assignment {
|
||||
employeeName: string;
|
||||
shiftDetails: {
|
||||
date: string;
|
||||
dayOfWeek: number;
|
||||
timeSlotName: string;
|
||||
startTime: string;
|
||||
endTime: string;
|
||||
};
|
||||
preferenceLevel: number;
|
||||
}
|
||||
|
||||
export interface SchedulingStatistics {
|
||||
totalShifts: number;
|
||||
totalAssignments: number;
|
||||
coverageRate: number;
|
||||
preferenceSatisfaction: number;
|
||||
constraintViolations: number;
|
||||
hardConstraintViolations: number;
|
||||
softConstraintViolations: number;
|
||||
processingTime: number;
|
||||
}
|
||||
Reference in New Issue
Block a user