- 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>
27 lines
626 B
TypeScript
27 lines
626 B
TypeScript
import { prisma as db } from "@repo/db/client";
|
|
|
|
export const officeContactStorage = {
|
|
async getOfficeContact(userId: number) {
|
|
return db.officeContact.findUnique({ where: { userId } });
|
|
},
|
|
|
|
async upsertOfficeContact(userId: number, data: {
|
|
officeName?: string;
|
|
receptionistName?: string;
|
|
dentistName?: string;
|
|
phoneNumber?: string;
|
|
email?: string;
|
|
fax?: string;
|
|
streetAddress?: string;
|
|
city?: string;
|
|
state?: string;
|
|
zipCode?: string;
|
|
}) {
|
|
return db.officeContact.upsert({
|
|
where: { userId },
|
|
update: data,
|
|
create: { userId, ...data },
|
|
});
|
|
},
|
|
};
|