feat(goods): add editable custom products

This commit is contained in:
yeuimu
2026-08-21 14:45:42 +08:00
parent a4151607c5
commit b04623ebdd
16 changed files with 1045 additions and 43 deletions
@@ -0,0 +1,6 @@
CREATE TYPE "OriginGoodSource" AS ENUM ('SDS', 'CUSTOM');
ALTER TABLE "origin_goods"
ADD COLUMN "source" "OriginGoodSource" NOT NULL DEFAULT 'SDS';
CREATE INDEX "origin_goods_source_idx" ON "origin_goods"("source");
+7
View File
@@ -14,6 +14,11 @@ datasource db {
}
// ---------- Origin Goods ----------
enum OriginGoodSource {
SDS
CUSTOM
}
model OriginGood {
id BigInt @id @default(autoincrement()) @map("origin_good_id")
sdsGoodId String @unique @map("sds_good_id")
@@ -23,6 +28,7 @@ model OriginGood {
goodImage String? @map("good_image")
goodPrice Decimal? @map("good_price") @db.Decimal(12, 2)
delisted Boolean @default(false)
source OriginGoodSource @default(SDS)
createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz(6)
updatedAt DateTime @default(now()) @updatedAt @map("updated_at") @db.Timestamptz(6)
@@ -31,6 +37,7 @@ model OriginGood {
variants OriginGoodVariant[]
@@index([sdsCategoryId])
@@index([source])
@@map("origin_goods")
}