- Schedule columns default to labels A–F (localStorage, per-browser, click to rename) - Settings → Advanced → Office Hours: configure Doctors (A-C) and Hygienists (D-F) AM/PM hours per weekday - Gray out schedule slots outside office hours; override dialog for manual exceptions - Override Office Hours toggle: select specific dates where all slots are open - Fix appointment move: send only real DB fields to avoid Zod strict-mode rejection of computed fields (hasProcedures, hasClaimWithNumber) - Fix backend PUT /appointments: safe error logging to prevent Prisma error crashing Node inspect - Add OfficeHours Prisma model and GET/PUT /api/office-hours route Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
32 lines
1.4 KiB
TypeScript
32 lines
1.4 KiB
TypeScript
import * as z from 'zod';
|
|
import { Prisma } from '../../../generated/prisma';
|
|
import Decimal from 'decimal.js';
|
|
import { ProcedureSourceSchema } from '../enums/ProcedureSource.schema'
|
|
|
|
import { DecimalJSLikeSchema, isValidDecimalInput } from '../../helpers/decimal-helpers';
|
|
const makeSchema = () => z.object({
|
|
id: z.number().int().optional(),
|
|
appointmentId: z.number().int(),
|
|
patientId: z.number().int(),
|
|
procedureCode: z.string(),
|
|
procedureLabel: z.string().optional().nullable(),
|
|
fee: z.union([
|
|
z.number(),
|
|
z.string(),
|
|
z.instanceof(Decimal),
|
|
z.instanceof(Prisma.Decimal),
|
|
DecimalJSLikeSchema,
|
|
]).refine((v) => isValidDecimalInput(v), {
|
|
message: "Field 'fee' must be a Decimal",
|
|
}).optional().nullable(),
|
|
category: z.string().optional().nullable(),
|
|
toothNumber: z.string().optional().nullable(),
|
|
toothSurface: z.string().optional().nullable(),
|
|
oralCavityArea: z.string().optional().nullable(),
|
|
source: ProcedureSourceSchema.optional(),
|
|
comboKey: z.string().optional().nullable(),
|
|
createdAt: z.coerce.date().optional()
|
|
}).strict();
|
|
export const AppointmentProcedureUncheckedCreateWithoutNpiProviderInputObjectSchema: z.ZodType<Prisma.AppointmentProcedureUncheckedCreateWithoutNpiProviderInput> = makeSchema() as unknown as z.ZodType<Prisma.AppointmentProcedureUncheckedCreateWithoutNpiProviderInput>;
|
|
export const AppointmentProcedureUncheckedCreateWithoutNpiProviderInputObjectZodSchema = makeSchema();
|