Files
frontend/apps/cs/src/pages/module/model/role-authorizations-interface.ts
T

46 lines
1.2 KiB
TypeScript

import { z } from "zod";
import type { PageableList, PageableParams } from "@/shared/model";
export interface RoleAuthorizationsParams extends PageableParams {
keywordType?: string;
keyword?: string;
authorizationNo?: string;
}
export interface RoleAuthorizations {
roleId: string;
roleName: string;
roleContent: string;
useYn: string;
authorizationNo: number;
authYn: string;
}
export const roleAuthorizationsSchema = z.object({
roleId: z.string(),
authorizationNo: z.number(),
authYn: z.string(),
});
export const roleAuthorizationsFormSchema = z.object({
roleAuthorizations: z.array(roleAuthorizationsSchema),
});
export type RoleAuthorizationsList = PageableList<RoleAuthorizations>;
export type RoleAuthorizationsData = z.infer<typeof roleAuthorizationsSchema>[];
export type RoleAuthorizationsFormData = z.infer<
typeof roleAuthorizationsFormSchema
>;
export interface RoleAuthorizationsService {
getRoleAuthorizationsList: (
params: RoleAuthorizationsParams,
) => Promise<RoleAuthorizationsList>;
createRoleAuthorizations: (
data: RoleAuthorizationsData,
) => Promise<RoleAuthorizations>;
updateRoleAuthorizations: (
data: RoleAuthorizationsData,
) => Promise<RoleAuthorizations>;
}