mvptest

Tables (9)

ai_recommendations

  • id — uuid
  • request_id — uuid — Foreign key → ai_requests.id — NOT NULL
  • product_id — uuid — Foreign key → products.id — NOT NULL
  • rank — int4 — NOT NULL
  • score — numeric
  • created_at — timestamptz

ai_requests

  • id — uuid
  • clerk_id — text — Foreign key → users.clerk_id — NOT NULL
  • request_type — text — NOT NULL
  • prompt — text — NOT NULL
  • model — text — NOT NULL
  • related_product_id — uuid — Foreign key → products.id
  • used_credits — int4
  • created_at — timestamptz

ai_results

  • id — uuid
  • request_id — uuid — Foreign key → ai_requests.id — NOT NULL
  • response — text — NOT NULL
  • metadata — jsonb
  • created_at — timestamptz

cart_items

  • id — uuid
  • clerk_id — text — Foreign key → users.clerk_id — NOT NULL
  • product_id — uuid — Foreign key → products.id — NOT NULL
  • quantity — int4 — NOT NULL
  • created_at — timestamptz
  • updated_at — timestamptz

order_items

  • id — uuid
  • order_id — uuid — Foreign key → orders.id — NOT NULL
  • product_id — uuid — Foreign key → products.id — NOT NULL
  • product_name — text
  • quantity — int4 — NOT NULL
  • price — numeric — NOT NULL
  • created_at — timestamptz

orders

  • id — uuid
  • clerk_id — text — Foreign key → users.clerk_id — NOT NULL
  • total_amount — numeric — NOT NULL
  • status — text — NOT NULL
  • shipping_address — jsonb
  • order_note — text
  • created_at — timestamptz
  • updated_at — timestamptz

products

  • id — uuid
  • name — text — NOT NULL
  • description — text
  • price — numeric — NOT NULL
  • category — text
  • stock_quantity — int4
  • is_active — boolean
  • created_at — timestamptz
  • updated_at — timestamptz

user_credits

  • id — uuid
  • clerk_id — text — Foreign key → users.clerk_id — NOT NULL
  • credit_balance — int4 — NOT NULL
  • updated_at — timestamptz

users

  • id — uuid
  • clerk_id — text — NOT NULL
  • name — text
  • created_at — timestamptz