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:
@@ -0,0 +1,24 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "lab_rx_template" (
|
||||
"id" SERIAL NOT NULL,
|
||||
"userId" INTEGER NOT NULL,
|
||||
"name" TEXT NOT NULL,
|
||||
"labName" TEXT,
|
||||
"labPhone" TEXT,
|
||||
"labFax" TEXT,
|
||||
"labAddress" TEXT,
|
||||
"labAccount" TEXT,
|
||||
"caseType" TEXT,
|
||||
"material" TEXT,
|
||||
"instructions" TEXT,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "lab_rx_template_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "lab_rx_template_userId_idx" ON "lab_rx_template"("userId");
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "lab_rx_template" ADD CONSTRAINT "lab_rx_template_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
@@ -0,0 +1,2 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "lab_rx_template" ADD COLUMN "sortOrder" INTEGER NOT NULL DEFAULT 0;
|
||||
@@ -0,0 +1,2 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "lab_rx_template" ADD COLUMN "doctorName" TEXT;
|
||||
Reference in New Issue
Block a user