Files
DentalManagementMH06/packages/db/shared/schemas/results/OfficeContactGroupByResult.schema.ts
Gitead 7929dc6e19 feat: office address, multi-template SMS manager, hardcoded defaults with auto-seed
- Add streetAddress/city/state/zipCode fields to OfficeContact (schema + storage + UI)
- Support {officeAddress} variable in batch reminder SMS
- Replace single SMS template field with full CRUD template list (add/rename/edit/delete)
- Store SMS template list under _sms_template_list; first template synced to batch reminder
- Hardcode all AI chat template defaults into codebase (reminder SMS, greetings, fallback)
- Add seed-templates.ts that auto-seeds default templates for all users on server boot
- Update README: note that templates are auto-configured on first boot

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 23:18:04 -04:00

66 lines
1.9 KiB
TypeScript

import * as z from 'zod';
export const OfficeContactGroupByResultSchema = z.array(z.object({
id: z.number().int(),
userId: z.number().int(),
officeName: z.string(),
receptionistName: z.string(),
dentistName: z.string(),
phoneNumber: z.string(),
email: z.string(),
fax: z.string(),
streetAddress: z.string(),
city: z.string(),
state: z.string(),
zipCode: z.string(),
_count: z.object({
id: z.number(),
userId: z.number(),
officeName: z.number(),
receptionistName: z.number(),
dentistName: z.number(),
phoneNumber: z.number(),
email: z.number(),
fax: z.number(),
streetAddress: z.number(),
city: z.number(),
state: z.number(),
zipCode: z.number(),
user: z.number()
}).optional(),
_sum: z.object({
id: z.number().nullable(),
userId: z.number().nullable()
}).nullable().optional(),
_avg: z.object({
id: z.number().nullable(),
userId: z.number().nullable()
}).nullable().optional(),
_min: z.object({
id: z.number().int().nullable(),
userId: z.number().int().nullable(),
officeName: z.string().nullable(),
receptionistName: z.string().nullable(),
dentistName: z.string().nullable(),
phoneNumber: z.string().nullable(),
email: z.string().nullable(),
fax: z.string().nullable(),
streetAddress: z.string().nullable(),
city: z.string().nullable(),
state: z.string().nullable(),
zipCode: z.string().nullable()
}).nullable().optional(),
_max: z.object({
id: z.number().int().nullable(),
userId: z.number().int().nullable(),
officeName: z.string().nullable(),
receptionistName: z.string().nullable(),
dentistName: z.string().nullable(),
phoneNumber: z.string().nullable(),
email: z.string().nullable(),
fax: z.string().nullable(),
streetAddress: z.string().nullable(),
city: z.string().nullable(),
state: z.string().nullable(),
zipCode: z.string().nullable()
}).nullable().optional()
}));