Initial role user app

This commit is contained in:
湛兮
2026-06-02 14:46:39 +08:00
commit 003dc60111
62 changed files with 7835 additions and 0 deletions
+136
View File
@@ -0,0 +1,136 @@
export type AccountType = "SUPER_ADMIN" | "EMPLOYEE";
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<T> = {
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[];
};