/** 前台身份与业务协议,数字人账号使用独立 DIGITAL_USER 类型。 */ export type AccountType = "SUPER_ADMIN" | "EMPLOYEE" | "DIGITAL_USER"; export type Role = { id: number; code: string; name: string; }; export type AuthUser = { id: number; username: string; displayName: string; accountType: AccountType; storeId?: number; storeName?: string; roles: Role[]; permissions: string[]; canManage: boolean; lastLoginAt?: string | null; mustChangePassword?: boolean; }; export type PermissionMenu = { key: string; title: string; permission: string; actions: string[]; }; export type PermissionPayload = { permissions: string[]; menus: PermissionMenu[]; }; export type ApiEnvelope = { success: boolean; data: T; message?: string; }; export type LoginResponse = { token: string; tokenType: "Bearer"; expiresIn: string; user: AuthUser; }; export type TaskStatus = "pending" | "in_progress" | "completed" | "cancelled"; export type TaskSummary = { id: string; title: string; description?: string; status: TaskStatus; priority: "low" | "normal" | "high" | "urgent"; dueAt?: string | null; assigneeName?: string; storeName?: string; }; export type TaskAssignee = { id: number; name: string; phone?: string; }; export type TaskEvent = { id: number; taskId?: number; eventType: "CREATED" | "UPDATED" | "STARTED" | "COMPLETED" | "CANCELLED" | "COMMENTED" | string; fromStatus?: string | null; toStatus?: string | null; comment?: string | null; createdAt?: string | null; }; export type TaskDetail = TaskSummary & { assignees: TaskAssignee[]; events: TaskEvent[]; createdAt?: string | null; updatedAt?: string | null; }; export type AnnouncementSummary = { id: string; title: string; summary?: string; level: "normal" | "important" | "urgent"; publishedAt?: string | null; read: boolean; }; export type AnnouncementDetail = AnnouncementSummary & { content: string; readAt?: string | null; createdAt?: string | null; updatedAt?: string | null; }; export type ShiftSummary = { id: string; date: string; position: string; startAt: string; endAt: string; status: "scheduled" | "cancelled" | "completed"; }; export type StoreEmployee = { id: number; name: string; phone?: string; status?: string; roles: Role[]; }; export type StoreDetail = { id: number; name: string; address?: string | null; phone?: string | null; status?: string; employees: StoreEmployee[]; }; export type MobileBootstrap = { user: AuthUser; permissions: string[]; unreadAnnouncementCount: number; pendingTaskCount: number; overdueTaskCount: number; todayShift: ShiftSummary | null; todayShifts: ShiftSummary[]; latestAnnouncements: AnnouncementSummary[]; tasks: TaskSummary[]; };