38 lines
991 B
TypeScript
38 lines
991 B
TypeScript
import { z } from "zod";
|
|
import type { PageableList, PageableParams } from "@/shared/model";
|
|
|
|
export interface RoleParams extends PageableParams {
|
|
keywordType?: string;
|
|
keyword?: string;
|
|
}
|
|
|
|
export interface Role {
|
|
roleId: string;
|
|
roleName: string;
|
|
roleContent: string;
|
|
useYn: string;
|
|
mdfcnDt: string;
|
|
mdfrNm: string;
|
|
mngrYn: string;
|
|
}
|
|
|
|
export const roleFormSchema = z.object({
|
|
roleId: z.string(),
|
|
roleName: z.string(),
|
|
roleContent: z.string(),
|
|
useYn: z.string(),
|
|
mngrYn: z.string(),
|
|
});
|
|
|
|
export type RoleList = PageableList<Role>;
|
|
export type RoleFormData = z.infer<typeof roleFormSchema>;
|
|
|
|
export interface RoleService {
|
|
getRoles: (params?: RoleParams) => Promise<RoleList>;
|
|
getRoleInfo: (roleId: string) => Promise<Role>;
|
|
createRole: (data: RoleFormData) => Promise<void>;
|
|
updateRole: (roleId: string, data: RoleFormData) => Promise<void>;
|
|
deleteRole: (roleId: string) => Promise<void>;
|
|
checkDuplicateRoleId: (roleId: string) => Promise<boolean>;
|
|
}
|