feat: complete ShiftCraft — AI-powered shift scheduling SaaS
Complete implementation including:
- Landing page with hero, features, how-it-works, pricing
- Employee management (CRUD with soft delete)
- AI constraint parser (Anthropic Claude API)
- German labor law templates (ArbZG §3, §5, §9)
- HiGHS ILP solver for optimal fair schedules
- Schedule calendar result view (employee × date grid)
- Shift framework configuration (periods + shifts)
- Subscription tiers: Free / Pro / Business
- PocketBase setup script with collection creation + seed data
- .env.example with all required variables documented
Pages: employees, constraints (list/new/templates), schedules (list/new/[id]),
settings (organization/shifts/billing), dashboard
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
59
shared/types/schedule.ts
Normal file
59
shared/types/schedule.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
export interface ShiftAssignment {
|
||||
employee_id: string
|
||||
employee_name: string
|
||||
shift_id: string
|
||||
shift_name: string
|
||||
period_id: string
|
||||
date: string // ISO date
|
||||
start_time: string
|
||||
end_time: string
|
||||
}
|
||||
|
||||
export interface SolveResult {
|
||||
status: 'solved' | 'infeasible' | 'error'
|
||||
assignments: ShiftAssignment[]
|
||||
objective_value?: number
|
||||
duration_ms?: number
|
||||
infeasibility_hints?: Array<{ constraint_id?: string; description: string }>
|
||||
}
|
||||
|
||||
export interface SolveInput {
|
||||
organization_id: string
|
||||
period_start: string
|
||||
period_end: string
|
||||
framework: {
|
||||
periods: Period[]
|
||||
shifts: Shift[]
|
||||
}
|
||||
employees: Employee[]
|
||||
constraints: Array<{ id: string; constraint_json: import('./constraint').ConstraintJSON; hard: boolean; weight?: number }>
|
||||
}
|
||||
|
||||
export interface Period {
|
||||
id: string
|
||||
name: string
|
||||
start_time: string
|
||||
end_time: string
|
||||
color: string
|
||||
}
|
||||
|
||||
export interface Shift {
|
||||
id: string
|
||||
period_id: string
|
||||
name: string
|
||||
duration_hours: number
|
||||
workers_required: number
|
||||
days_applicable: number[] // 0=Mon...6=Sun, empty = all days
|
||||
}
|
||||
|
||||
export interface Employee {
|
||||
id: string
|
||||
name: string
|
||||
roles: string[]
|
||||
skills: string[]
|
||||
employment_type: 'full_time' | 'part_time' | 'mini_job'
|
||||
weekly_hours_target: number
|
||||
max_weekly_hours: number
|
||||
available_periods: string[]
|
||||
unavailable_dates: string[]
|
||||
}
|
||||
Reference in New Issue
Block a user