Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x | import { z } from 'zod';
import { searchPaginationSchema } from '../common/common.schema';
export class DoctorZODSchema {
static readonly createDoctorSchema = z.strictObject({
address: z.string().min(5),
specialty: z.string().min(5),
biography: z.string().min(5).optional(),
pictureUrl: z.string().url().optional(),
mapPosition: z
.object({
lat: z.number().min(-90).max(90),
lng: z.number().min(-180).max(180),
})
.optional(),
});
static readonly updateDoctorSchema = z.strictObject({
id: z.string().uuid(),
address: z.string().min(5).optional(),
specialty: z.string().min(5).optional(),
status: z.enum(['AVAILABLE', 'UNAVAILABLE', 'SUSPENDED']).optional(),
biography: z.string().min(5).optional(),
pictureUrl: z.string().url().optional(),
mapPosition: z
.object({
lat: z.number().min(-90).max(90),
lng: z.number().min(-180).max(180),
})
.optional(),
});
static readonly deleteDoctorSchema = z.strictObject({
id: z.string().uuid(),
});
static readonly searchDoctorSchema = z.strictObject({
...searchPaginationSchema,
name: z.string().optional(),
email: z.string().email().optional(),
phone: z
.string()
.refine((phone) => /^\+\d{10,15}$/.test(phone), 'Invalid phone number')
.optional(),
status: z.enum(['AVAILABLE', 'UNAVAILABLE', 'SUSPENDED']).optional(),
address: z.string().min(5).optional(),
specialty: z.string().min(5).optional(),
nearMe: z
.object({
lat: z.string().refine((lat) => parseFloat(lat) >= -90 && parseFloat(lat) <= 90),
lng: z.string().refine((lat) => parseFloat(lat) >= -180 && parseFloat(lat) <= 180),
})
.optional(),
});
static readonly validateDeleteSchema = z.strictObject({
token: z.string().uuid(),
});
}
|