feat: add Lab RX feature with template management and auto-seed defaults

- New lab_rx_template table with sortOrder and Prisma migrations
- Backend CRUD + reorder routes at /api/lab-rx/templates
- Auto-seeds 3 Highland Dental Studio defaults on first use per user
- LabRxModal: template picker, inline rename, up/down reorder, full
  template form with sections (Template Name / Lab Info / Case Details)
- RX popup: Tooth Number, Shade, Due Date, Doctor (from NPI providers),
  Instructions pre-filled with "Please make / Thank you!", print output
- lab-rx-templates.ts config file for future git-managed additions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-07-02 23:20:44 -04:00
parent ac4d8c4c74
commit abb2a0ac96
908 changed files with 4858 additions and 14271 deletions

File diff suppressed because one or more lines are too long

View File

@@ -500,6 +500,24 @@ exports.Prisma.PatientConversationScalarFieldEnum = {
updatedAt: 'updatedAt'
};
exports.Prisma.LabRxTemplateScalarFieldEnum = {
id: 'id',
userId: 'userId',
name: 'name',
labName: 'labName',
labPhone: 'labPhone',
labFax: 'labFax',
labAddress: 'labAddress',
labAccount: 'labAccount',
caseType: 'caseType',
material: 'material',
instructions: 'instructions',
doctorName: 'doctorName',
sortOrder: 'sortOrder',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.CommissionBatchScalarFieldEnum = {
id: 'id',
npiProviderId: 'npiProviderId',
@@ -667,6 +685,7 @@ exports.Prisma.ModelName = {
InsuranceContact: 'InsuranceContact',
ProcedureTimeslot: 'ProcedureTimeslot',
PatientConversation: 'PatientConversation',
LabRxTemplate: 'LabRxTemplate',
CommissionBatch: 'CommissionBatch',
CommissionBatchItem: 'CommissionBatchItem'
};

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +1,5 @@
{
"name": "prisma-client-d351a8e2afa5a626b25c24fc325b9f8c2c9b0ee5bb0f800b83ea538e43d12368",
"name": "prisma-client-2773da16452916320fe842966d774d65188a68e02f9e8e8f296d6070f7b7a13b",
"main": "index.js",
"types": "index.d.ts",
"browser": "default.js",

View File

@@ -50,6 +50,7 @@ model User {
procedureTimeslot ProcedureTimeslot?
insuranceContacts InsuranceContact[]
patientConversations PatientConversation[]
labRxTemplates LabRxTemplate[]
}
model Patient {
@@ -694,6 +695,29 @@ model PatientConversation {
@@map("patient_conversation")
}
model LabRxTemplate {
id Int @id @default(autoincrement())
userId Int
name String
labName String?
labPhone String?
labFax String?
labAddress String?
labAccount String?
caseType String?
material String?
instructions String?
doctorName String?
sortOrder Int @default(0)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@index([userId])
@@map("lab_rx_template")
}
// Commission tracking
model CommissionBatch {
id Int @id @default(autoincrement())