Download src/modules/notifications/notifications.validation.js from moustafa7/gymco: direct link, hf CLI and curl.
- Browser
- Download file 748 Bytes
-
https://huggingface.co/spaces/moustafa7/gymco/resolve/main/src/modules/notifications/notifications.validation.js
- Command line
-
hf download hf://spaces/moustafa7/gymco/src/modules/notifications/notifications.validation.js
-
curl -L -o notifications.validation.js https://huggingface.co/spaces/moustafa7/gymco/resolve/main/src/modules/notifications/notifications.validation.js
748 Bytes
| import { z } from 'zod'; | |
| import { idParam, listQuery } from '../../common/validators/shared.js'; | |
| export const createNotificationSchema = z.object({ | |
| body: z.object({ | |
| memberId: z.string().uuid().nullable().optional(), | |
| type: z.enum(['renewal', 'payment', 'reminder']), | |
| channel: z.enum(['whatsapp', 'sms', 'email']), | |
| message: z.string().min(2), | |
| status: z.enum(['pending', 'sent', 'failed']).default('pending'), | |
| }), | |
| }); | |
| export const updateNotificationSchema = z.object({ | |
| ...idParam.shape, | |
| body: z.object({ | |
| status: z.enum(['pending', 'sent', 'failed']).optional(), | |
| sentAt: z.coerce.date().nullable().optional(), | |
| message: z.string().min(2).optional(), | |
| }), | |
| }); | |
| export const listNotificationsSchema = listQuery; | |