Store a customer address list for physical catalog requests.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-26 11:12:10 +03:30
co-authored by Cursor
parent d0122ab08b
commit 7ee78b070a
11 changed files with 547 additions and 7 deletions
@@ -0,0 +1,13 @@
CREATE TABLE "CustomerAddress" (
"id" TEXT NOT NULL,
"customerId" TEXT NOT NULL,
"label" TEXT,
"text" TEXT NOT NULL,
"isDefault" BOOLEAN NOT NULL DEFAULT false,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "CustomerAddress_pkey" PRIMARY KEY ("id")
);
CREATE INDEX "CustomerAddress_customerId_idx" ON "CustomerAddress"("customerId");
ALTER TABLE "CustomerAddress" ADD CONSTRAINT "CustomerAddress_customerId_fkey" FOREIGN KEY ("customerId") REFERENCES "Customer"("id") ON DELETE CASCADE ON UPDATE CASCADE;
+14
View File
@@ -276,6 +276,7 @@ model Customer {
stockNotifyRequests StockNotifyRequest[]
productSuggestions ProductSuggestion[]
customerBrands CustomerBrand[]
addresses CustomerAddress[]
@@index([companyId])
@@index([appRole])
@@ -284,6 +285,19 @@ model Customer {
@@index([levelDefId])
}
model CustomerAddress {
id String @id @default(cuid())
customerId String
label String?
text String
isDefault Boolean @default(false)
createdAt DateTime @default(now())
customer Customer @relation(fields: [customerId], references: [id], onDelete: Cascade)
@@index([customerId])
}
model AdminUser {
id String @id @default(cuid())
fullName String
+12 -3
View File
File diff suppressed because one or more lines are too long
+306 -4
View File
File diff suppressed because one or more lines are too long