Add design approval workflow and per-image dimension tracking

- Add DesignApproval and DesignApprovalMessage models for design review workflow
- Add design approval admin interface (list, detail, chat, approve/reject)
- Add per-image dimension tracking to OrderItem
- Add design submission API endpoint
- Add AdminDesignEditor for admin-side design modifications
- Add DesignApprovalChat component for customer-admin communication
- Update design specification generation with image dimension details
- Add design persistence across login with next parameter redirect
- Add font properties UI with font size and color display

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
Andymick
2026-07-18 16:21:19 +01:00
co-authored by Claude Haiku 4.5
parent 10764f3a5b
commit 5c4774be84
16 changed files with 935 additions and 1 deletions
@@ -0,0 +1,3 @@
-- AlterTable
ALTER TABLE "Product" ADD COLUMN "referenceHeightCm" INTEGER,
ADD COLUMN "referenceWidthCm" INTEGER;
@@ -0,0 +1,3 @@
-- AlterTable
ALTER TABLE "OrderItem" ADD COLUMN "designHeightCm" DOUBLE PRECISION,
ADD COLUMN "designWidthCm" DOUBLE PRECISION;
@@ -0,0 +1,42 @@
-- CreateTable
CREATE TABLE "DesignApproval" (
"id" TEXT NOT NULL,
"customerId" TEXT,
"customerEmail" TEXT NOT NULL,
"customerName" TEXT,
"productId" TEXT NOT NULL,
"designJson" TEXT NOT NULL,
"designPreviewUrl" TEXT NOT NULL,
"designPreviewUrlBack" TEXT,
"placementPreviewUrl" TEXT,
"placementPreviewUrlBack" TEXT,
"designWidthCm" DOUBLE PRECISION,
"designHeightCm" DOUBLE PRECISION,
"color" TEXT NOT NULL,
"size" TEXT,
"status" TEXT NOT NULL DEFAULT 'PENDING',
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "DesignApproval_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "DesignApprovalMessage" (
"id" TEXT NOT NULL,
"designId" TEXT NOT NULL,
"sender" TEXT NOT NULL,
"body" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "DesignApprovalMessage_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "DesignApproval" ADD CONSTRAINT "DesignApproval_customerId_fkey" FOREIGN KEY ("customerId") REFERENCES "Customer"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "DesignApproval" ADD CONSTRAINT "DesignApproval_productId_fkey" FOREIGN KEY ("productId") REFERENCES "Product"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "DesignApprovalMessage" ADD CONSTRAINT "DesignApprovalMessage_designId_fkey" FOREIGN KEY ("designId") REFERENCES "DesignApproval"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "DesignApproval" ADD COLUMN "designImageDimensions" TEXT;
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "OrderItem" ADD COLUMN "designImageDimensions" TEXT;