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(30, "최대 30자까지 입력할 수 있습니다.") .nonempty("최소 1자 이상 입력해주세요."), upCdNm: z.string().max(100).nonempty("최소 1자 이상 입력해주세요."), upCdExpln: z.string().max(1000).nullish(), cdSe: z.string().max(30).nonempty(), siteId: z.string().max(2).nullish(), useYn: z.string(), delYn: z.string(), }); export type UpCodeFormData = z.infer; export type UpCodeList = PageableList; export interface UpCodeService { getUpCodeList(params: UpCodeParams): Promise; upCodeDetail(upCodeId: string): Promise; updateUpCode(upCodeId: string, data: UpCodeFormData): Promise; createUpCode(data: UpCodeFormData): Promise; }