17 lines
501 B
TypeScript
17 lines
501 B
TypeScript
import { z } from "zod";
|
|
|
|
export const MarketSchema = z.enum(["SH", "SZ", "BJ"]);
|
|
|
|
export const WatchlistItemSchema = z.object({
|
|
userId: z.string().min(1),
|
|
code: z.string().min(1),
|
|
market: MarketSchema,
|
|
createdAt: z.string().min(1),
|
|
pinned: z.boolean().optional(),
|
|
tags: z.array(z.string().min(1)).optional(),
|
|
notes: z.string().optional(),
|
|
});
|
|
|
|
export type WatchlistItemInput = z.input<typeof WatchlistItemSchema>;
|
|
export type WatchlistItemParsed = z.output<typeof WatchlistItemSchema>;
|