diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-09-03 12:44:32 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-09-03 12:44:32 +0000 |
| commit | 688d9884ca98b50d04ac78fc1f6e28e034a519c0 (patch) | |
| tree | 95cf4572882a4d771db9443140d8cf2735d840d7 /lib/rfq-last/validations.ts | |
| parent | 522176a23ad9db47f85ceed13b2e54d369aa6e0a (diff) | |
(대표님) rfq-last 작업, vendorDocu 스키마 변경, 벤더 문서 관련 변경
Diffstat (limited to 'lib/rfq-last/validations.ts')
| -rw-r--r-- | lib/rfq-last/validations.ts | 24 |
1 files changed, 23 insertions, 1 deletions
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<typeof searchParamsRfqCache.parse> - >;
\ 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<RfqLastAttachments>().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<ReturnType<typeof searchParamsRfqAttachmentsCache.parse>> + |
