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:
Alireza Hassani
2026-09-19 12:17:28 +03:30
co-authored by Cursor
parent c6b7629c77
commit 94e9a8ed1c
5 changed files with 82 additions and 15 deletions
@@ -0,0 +1,6 @@
-- Used / second-hand flag on store listings (product-level).
ALTER TABLE store_items
ADD COLUMN IF NOT EXISTS is_used BOOLEAN NOT NULL DEFAULT FALSE;
CREATE INDEX IF NOT EXISTS idx_store_items_business_is_used
ON store_items (business_id, is_used);