53 lines
1.3 KiB
TypeScript
53 lines
1.3 KiB
TypeScript
import { z } from "zod";
|
|
import type { PageableParams, PageableList } from "@/shared/model";
|
|
|
|
export interface UpCodeParams extends PageableParams {
|
|
keyword?: string;
|
|
upCd?: string;
|
|
cdSe?: string;
|
|
useYn?: string;
|
|
siteId?: string;
|
|
}
|
|
|
|
export interface UpCode {
|
|
upCd: string;
|
|
upCdNm: string;
|
|
upCdExpln: string;
|
|
cdSe: string;
|
|
siteId: string;
|
|
useYn: string;
|
|
regDt: string;
|
|
}
|
|
|
|
export interface UpCodeDetail extends UpCodeFormData {
|
|
upCd: string;
|
|
upCdNm: string;
|
|
upCdExpln: string;
|
|
cdSe: string;
|
|
siteId: string;
|
|
useYn: string;
|
|
delYn: string;
|
|
regDt: string;
|
|
rgTrNm: string;
|
|
}
|
|
|
|
export const upCodeFormSchema = z.object({
|
|
upCd: z.string().max(10).nonempty(),
|
|
upCdNm: z.string().max(100).nonempty(),
|
|
upCdExpln: z.string().max(1000).nullish(),
|
|
cdSe: z.string().max(10).nonempty(),
|
|
siteId: z.string().max(2).nullish(),
|
|
useYn: z.string(),
|
|
delYn: z.string(),
|
|
});
|
|
|
|
export type UpCodeFormData = z.infer<typeof upCodeFormSchema>;
|
|
export type UpCodeList = PageableList<UpCode>;
|
|
|
|
export interface UpCodeService {
|
|
getUpCodeList(params: UpCodeParams): Promise<UpCodeList>;
|
|
upCodeDetail(upCodeId: string): Promise<UpCodeDetail>;
|
|
updateUpCode(upCodeId: string, data: UpCodeFormData): Promise<void>;
|
|
createUpCode(data: UpCodeFormData): Promise<void>;
|
|
}
|