Skip to content

Featured Products

Table: public.featured_products

Columns

Column Type Default Description
id uuid PK UUID
product_id uuid FK → products(id) Featured product
seller_id uuid FK → sellers(id) Owner
start_date timestamptz NOT NULL Feature start
end_date timestamptz NOT NULL Feature end
fee_paid numeric 0 Amount paid
payment_status text 'pending' pending, completed, failed
is_active boolean true Active toggle
position int 0 Sort position
created_at timestamptz now()

Indexes

  • idx_featured_products_active on (is_active, start_date, end_date)
  • idx_featured_products_seller on seller_id

Business Logic

  • Products with an active featured_products entry appear in the home screen featured carousel
  • Position determined by position column (lower = higher)
  • Admin can toggle is_active to override
  • Seller must have an active subscription with available featured slots