test

Tables (10)

p_ai_request_history

  • id — bigint — NOT NULL
  • menu_id — bigint — Foreign key → p_menu.menu_id — NOT NULL
  • request — text
  • response — text
  • status — varchar(20) — NOT NULL
  • error_message — text
  • created_at — timestamp — NOT NULL
  • created_by — bigint

p_category

  • cat_id — bigint — NOT NULL
  • cat_name — varchar(100) — NOT NULL
  • created_at — timestamp — NOT NULL
  • created_by — bigint
  • updated_at — timestamp
  • updated_by — bigint
  • deleted_at — timestamp
  • deleted_by — bigint

p_menu

  • menu_id — bigint — NOT NULL
  • store_id — bigint — Foreign key → p_store.store_id — NOT NULL
  • name — varchar(200) — NOT NULL
  • description — text
  • is_ai_description — boolean
  • price — integer — NOT NULL
  • is_hidden — boolean
  • created_at — timestamp — NOT NULL
  • created_by — bigint
  • updated_at — timestamp
  • updated_by — bigint
  • deleted_at — timestamp
  • deleted_by — bigint

p_order

  • order_id — bigint — NOT NULL
  • order_number — varchar(64) — NOT NULL
  • store_id — bigint — Foreign key → p_store.store_id — NOT NULL
  • customer_id — bigint — Foreign key → p_user.user_id — NOT NULL
  • status — order_status — NOT NULL
  • total_amount — integer — NOT NULL
  • ordered_at — timestamp — NOT NULL
  • canceled_at — timestamp
  • cancel_allowed_until — timestamp — NOT NULL
  • updated_at — timestamp
  • updated_by — bigint
  • deleted_at — timestamp
  • deleted_by — bigint

p_order_item

  • id — bigint — NOT NULL
  • order_id — bigint — Foreign key → p_order.order_id — NOT NULL
  • menu_id — bigint — Foreign key → p_menu.menu_id — NOT NULL
  • menu_name — varchar(200) — NOT NULL
  • unit_price — integer — NOT NULL
  • quantity — integer — NOT NULL

p_payment

  • id — bigint — NOT NULL
  • order_id — bigint — Foreign key → p_order.order_id — NOT NULL
  • method — varchar(50) — NOT NULL
  • currency — varchar(3) — NOT NULL
  • amount — integer — NOT NULL
  • status — payment_status — NOT NULL
  • pg_transaction_id — varchar(255)
  • payment_key — varchar(200) — NOT NULL
  • requested_at — timestamp — NOT NULL
  • approved_at — timestamp
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp
  • updated_by — bigint
  • deleted_at — timestamp
  • deleted_by — bigint

p_review

  • id — bigint — NOT NULL
  • order_id — bigint — Foreign key → p_order.order_id — NOT NULL
  • store_id — bigint — Foreign key → p_store.store_id — NOT NULL
  • customer_id — bigint — Foreign key → p_user.user_id — NOT NULL
  • rating — smallint — NOT NULL
  • content — text
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp
  • updated_by — bigint
  • deleted_at — timestamp
  • deleted_by — bigint

p_store

  • store_id — bigint — NOT NULL
  • owner_id — bigint — Foreign key → p_user.user_id — NOT NULL
  • store_name — varchar(200) — NOT NULL
  • address — varchar(500) — NOT NULL
  • geom — geography — PostGIS
  • rating_avg — decimal(3,2) — NOT NULL
  • review_count — int — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp
  • updated_by — bigint
  • deleted_at — timestamp
  • deleted_by — bigint

p_store_category

  • store_id — bigint — Foreign key → p_store.store_id — NOT NULL
  • cat_id — bigint — Foreign key → p_category.cat_id — NOT NULL
  • created_at — timestamp — NOT NULL
  • created_by — bigint
  • updated_at — timestamp
  • updated_by — bigint
  • deleted_at — timestamp
  • deleted_by — bigint

p_user

  • user_id — bigint — NOT NULL
  • username — varchar(100) — NOT NULL
  • password — varchar(255) — NOT NULL
  • role — user_role — NOT NULL
  • address — varchar(500)
  • geom — geography — PostGIS
  • created_at — timestamp — NOT NULL
  • created_by — bigint
  • updated_at — timestamp
  • updated_by — bigint
  • deleted_at — timestamp
  • deleted_by — bigint