From 98b7ae290c2d400380d492c6b58f505a68adf319 Mon Sep 17 00:00:00 2001 From: AI Bot Date: Sun, 19 Jul 2026 14:59:30 +0530 Subject: [PATCH] feat(shared): add a new Zod validation schema for Location creation payload --- packages/shared/src/schema.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/shared/src/schema.ts b/packages/shared/src/schema.ts index 097042a3..5ba1b6da 100644 --- a/packages/shared/src/schema.ts +++ b/packages/shared/src/schema.ts @@ -94,6 +94,20 @@ export const participants = pgTable( } ); +// --- WebSocket Schemas --- +export const userJoinedPayloadSchema = z.object({ + userId: z.number(), + roomId: z.number(), + timestamp: z.date().default(() => new Date()), +}); + +// --- Location Schemas --- +export const locationCreationPayloadSchema = z.object({ + label: z.string().min(1).max(100, "Label must be less than 100 characters"), + lat: z.number().min(-90).max(90, "Latitude must be between -90 and 90"), + lng: z.number().min(-180).max(180, "Longitude must be between -180 and 180"), +}); + // Waitlist Schemas export const insertWaitlistSchema = z.object({ email: z.string().email(),