Re_Backend/src/validators/userPreference.validator.ts
2025-12-03 19:59:44 +05:30

14 lines
478 B
TypeScript

import { z } from 'zod';
export const updateNotificationPreferencesSchema = z.object({
emailNotificationsEnabled: z.boolean().optional(),
pushNotificationsEnabled: z.boolean().optional(),
inAppNotificationsEnabled: z.boolean().optional()
}).refine(
(data) => Object.keys(data).length > 0,
{ message: 'At least one notification preference must be provided' }
);
export type UpdateNotificationPreferencesRequest = z.infer<typeof updateNotificationPreferencesSchema>;