68 lines
1.7 KiB
TypeScript
68 lines
1.7 KiB
TypeScript
import { z } from "zod";
|
|
|
|
import type { PageableList, PageableParams } from "@/shared/model";
|
|
|
|
export interface AuthorizationsParams extends PageableParams {
|
|
keywordType?: string;
|
|
keyword?: string;
|
|
authorizationName?: string;
|
|
urlPatternValue?: string;
|
|
httpMethodCode?: string;
|
|
useYn?: string;
|
|
}
|
|
|
|
export interface Authorizations {
|
|
authorizationNo: number;
|
|
authorizationName: string;
|
|
urlPatternValue: string;
|
|
httpMethodCode: string;
|
|
sortSeq: number;
|
|
useYn: string;
|
|
siteId: string;
|
|
mdfr: string;
|
|
mdfcnDt: string;
|
|
}
|
|
|
|
export interface RoleAuthorizations {
|
|
roleId: string;
|
|
authorizationNo: number;
|
|
authorizationName: string;
|
|
urlPatternValue: string;
|
|
httpMethodCode: string;
|
|
sortSeq: number;
|
|
siteId: string;
|
|
createdAt: string;
|
|
}
|
|
|
|
export interface WithRoleAuthorizations extends Authorizations {
|
|
roleAuthorizations: RoleAuthorizations[];
|
|
}
|
|
|
|
export const authorizationFormSchema = z.object({
|
|
authorizationName: z.string(),
|
|
urlPatternValue: z.string(),
|
|
httpMethodCode: z.string(),
|
|
sortSeq: z.number(),
|
|
useYn: z.string(),
|
|
siteId: z.string(),
|
|
});
|
|
|
|
export type AuthorizationsList = PageableList<Authorizations>;
|
|
export type AuthorizationFormData = z.infer<typeof authorizationFormSchema>;
|
|
|
|
export interface AuthorizationsService {
|
|
getAuthorizationsList: (
|
|
params?: AuthorizationsParams,
|
|
) => Promise<AuthorizationsList>;
|
|
getAuthorizationInfo: (
|
|
authorizationNo: string,
|
|
) => Promise<WithRoleAuthorizations>;
|
|
createAuthorization: (
|
|
data: AuthorizationFormData,
|
|
) => Promise<WithRoleAuthorizations>;
|
|
updateAuthorization: (
|
|
authorizationNo: string,
|
|
data: AuthorizationFormData,
|
|
) => Promise<WithRoleAuthorizations>;
|
|
}
|