From 688d9884ca98b50d04ac78fc1f6e28e034a519c0 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Wed, 3 Sep 2025 12:44:32 +0000 Subject: (대표님) rfq-last 작업, vendorDocu 스키마 변경, 벤더 문서 관련 변경 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/rfq-last/validations.ts | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'lib/rfq-last/validations.ts') diff --git a/lib/rfq-last/validations.ts b/lib/rfq-last/validations.ts index 09fd2f6f..b133433f 100644 --- a/lib/rfq-last/validations.ts +++ b/lib/rfq-last/validations.ts @@ -10,6 +10,7 @@ import { import * as z from "zod"; import { getFiltersStateParser, getSortingStateParser } from "@/lib/parsers"; +import { RfqLastAttachments } from "@/db/schema"; // RFQ 상태 옵션 export const RFQ_STATUS_OPTIONS = [ @@ -62,4 +63,25 @@ import { export type GetRfqsSchema = Awaited< ReturnType - >; \ No newline at end of file + >; + + + export const searchParamsRfqAttachmentsCache = createSearchParamsCache({ + flags: parseAsArrayOf(z.enum(["advancedTable", "floatingBar"])).withDefault([]), + page: parseAsInteger.withDefault(1), + perPage: parseAsInteger.withDefault(10), + sort: getSortingStateParser().withDefault([ + { id: "createdAt", desc: true }, + ]), + // 기본 필터 + attachmentType: parseAsArrayOf(z.string()).withDefault([]), + fileType: parseAsArrayOf(z.string()).withDefault([]), + search: parseAsString.withDefault(""), + // advanced filter + filters: getFiltersStateParser().withDefault([]), + joinOperator: parseAsStringEnum(["and", "or"]).withDefault("and"), + }) + + // 스키마 타입들 + export type GetRfqLastAttachmentsSchema = Awaited> + -- cgit v1.2.3