Initial scaffold: wages app
Full wage cost reporting app — weekly/monthly views, rolling 12-week/12-month history, budget management, Workforce API sync with SSE backfill, net sales via forecasting public API, department filter, CSV export. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
commit
2e0592eb90
37 changed files with 3078 additions and 0 deletions
49
frontend/src/types.ts
Normal file
49
frontend/src/types.ts
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
export interface User {
|
||||
email: string
|
||||
name: string
|
||||
is_admin: boolean
|
||||
caps: string[]
|
||||
}
|
||||
|
||||
export function can(user: User, cap: string): boolean {
|
||||
return user.is_admin || user.caps.includes(cap)
|
||||
}
|
||||
|
||||
export interface DeptActuals {
|
||||
department_id: string
|
||||
department_name: string
|
||||
days: Record<string, { base_cost: number; total_cost: number; cost: number; shift_count: number }>
|
||||
}
|
||||
|
||||
export interface DeptScheduled {
|
||||
department_id: string
|
||||
department_name: string
|
||||
days: Record<string, { cost: number; shift_count: number }>
|
||||
}
|
||||
|
||||
export interface NetSalesDay {
|
||||
date: string
|
||||
net_sales: number
|
||||
py_sales: number
|
||||
accom: number
|
||||
dry: number
|
||||
wet: number
|
||||
is_past: boolean
|
||||
}
|
||||
|
||||
export interface WageBudget {
|
||||
month: string // 'YYYY-MM-DD' (first of month)
|
||||
budget_amount: number
|
||||
}
|
||||
|
||||
export interface Department {
|
||||
id: string
|
||||
name: string
|
||||
enabled?: boolean
|
||||
}
|
||||
|
||||
export interface AppSetting {
|
||||
key: string
|
||||
value: string
|
||||
updated_at: string
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue