feat(store): add two-level store categories for admin and partner open-store
CI / verify (pull_request) Has been cancelled
CI / verify (pull_request) Has been cancelled
Admin CRUD under stores menu; partner picks leaf category on create. Default sync only inserts missing rows and never updates existing ones. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -335,12 +335,18 @@ model CommonProductItem {
|
||||
}
|
||||
|
||||
model CommonStoreCategory {
|
||||
id BigInt @id @default(autoincrement()) @db.UnsignedBigInt
|
||||
code String @unique @db.VarChar(32)
|
||||
name String @db.VarChar(64)
|
||||
sort Int @default(0)
|
||||
stores Store[]
|
||||
id BigInt @id @default(autoincrement()) @db.UnsignedBigInt
|
||||
code String @unique @db.VarChar(32)
|
||||
name String @db.VarChar(64)
|
||||
sort Int @default(0)
|
||||
parentId BigInt? @map("parent_id") @db.UnsignedBigInt
|
||||
status String @default("ACTIVE") @db.VarChar(16)
|
||||
parent CommonStoreCategory? @relation("StoreCategoryTree", fields: [parentId], references: [id], onDelete: Restrict)
|
||||
children CommonStoreCategory[] @relation("StoreCategoryTree")
|
||||
stores Store[]
|
||||
|
||||
@@index([parentId, sort])
|
||||
@@index([status])
|
||||
@@map("common_store_category")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user