Add isUsed on store items with API list filters.
Persists used/second-hand status per listing and supports isUsed=true on business and public store-item queries. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
c6b7629c77
commit
94e9a8ed1c
@@ -1141,6 +1141,7 @@ model StoreItem {
|
||||
businessId BigInt @map("business_id")
|
||||
productId BigInt @map("product_id")
|
||||
isActive Boolean @default(true) @map("is_active")
|
||||
isUsed Boolean @default(false) @map("is_used")
|
||||
sortOrder Int @default(0) @map("sort_order")
|
||||
createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz(6)
|
||||
updatedAt DateTime @default(now()) @updatedAt @map("updated_at") @db.Timestamptz(6)
|
||||
@@ -1152,6 +1153,7 @@ model StoreItem {
|
||||
@@unique([businessId, productId], map: "store_items_business_product_unique")
|
||||
@@index([businessId], map: "idx_store_items_business_id")
|
||||
@@index([productId], map: "idx_store_items_product_id")
|
||||
@@index([businessId, isUsed], map: "idx_store_items_business_is_used")
|
||||
@@map("store_items")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user