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>
49 lines
960 B
TypeScript
49 lines
960 B
TypeScript
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
|
|
}
|