collect-system/packages/common/src/models/staff.ts

39 lines
738 B
TypeScript
Raw Normal View History

2025-02-05 15:10:40 +08:00
import { Staff, Department } from "@prisma/client";
import { RolePerms } from "../enum";
export type StaffRowModel = {
2025-02-25 08:25:54 +08:00
avatar: string;
dept_name: string;
officer_id: string;
phone_number: string;
showname: string;
username: string;
2025-02-05 15:10:40 +08:00
};
export type UserProfile = Staff & {
2025-02-25 08:25:54 +08:00
permissions: RolePerms[];
deptIds: string[];
parentDeptIds: string[];
domain: Department;
department: Department;
2025-02-05 15:10:40 +08:00
};
export type StaffDto = Staff & {
2025-02-25 08:25:54 +08:00
domain?: Department;
department?: Department;
2025-02-05 15:10:40 +08:00
};
export interface AuthDto {
2025-02-25 08:25:54 +08:00
token: string;
staff: StaffDto;
refreshToken: string;
perms: string[];
2025-02-05 15:10:40 +08:00
}
export interface JwtPayload {
2025-02-25 08:25:54 +08:00
sub: string;
username: string;
2025-02-05 15:10:40 +08:00
}
export interface TokenPayload {
2025-02-25 08:25:54 +08:00
id: string;
phoneNumber: string;
name: string;
}