123

Tables (36)

assorted_components

  • id — UUID — Primary key — NOT NULL
  • assorted_id — UUID — Foreign key → assorted_listings.id — NOT NULL
  • seq — INTEGER — NOT NULL
  • species_name — TEXT — NOT NULL
  • origin_text — TEXT
  • weight_kg — DECIMAL(10,3)

assorted_listing_media

  • id — UUID — Primary key — NOT NULL
  • listing_id — UUID — Foreign key → assorted_listings.id — NOT NULL
  • media_id — UUID — Foreign key → media_assets.id — NOT NULL
  • sort_order — INTEGER — NOT NULL
  • created_at — TIMESTAMPTZ(6) — NOT NULL

assorted_listings

  • id — UUID — Primary key — NOT NULL
  • store_id — UUID — Foreign key → stores.id — NOT NULL
  • business_date — DATE — NOT NULL
  • title — TEXT — NOT NULL
  • description — TEXT
  • extra_notes — TEXT
  • price — DECIMAL(12,2) — NOT NULL
  • is_open — BOOLEAN — NOT NULL
  • created_at — TIMESTAMPTZ(6) — NOT NULL
  • updated_at — TIMESTAMPTZ(6) — NOT NULL

coupons

  • id — UUID — Primary key — NOT NULL
  • scope — TEXT — NOT NULL
  • store_id — UUID — Foreign key → stores.id
  • name — TEXT — NOT NULL
  • discount_type — TEXT — NOT NULL
  • discount_value — DECIMAL(12,2) — NOT NULL
  • min_order_amount — DECIMAL(12,2)
  • max_discount_amount — DECIMAL(12,2)
  • starts_at — TIMESTAMPTZ(6)
  • ends_at — TIMESTAMPTZ(6)
  • is_active — BOOLEAN — NOT NULL
  • created_at — TIMESTAMPTZ(6) — NOT NULL

daily_listing_media

  • id — UUID — Primary key — NOT NULL
  • listing_id — UUID — Foreign key → daily_listings.id — NOT NULL
  • media_id — UUID — Foreign key → media_assets.id — NOT NULL
  • sort_order — INTEGER — NOT NULL
  • created_at — TIMESTAMPTZ(6) — NOT NULL

daily_listings

  • id — UUID — Primary key — NOT NULL
  • store_id — UUID — Foreign key → stores.id — NOT NULL
  • business_date — DATE — NOT NULL
  • product_template_id — UUID — Foreign key → product_templates.id — NOT NULL
  • price_per_kg — DECIMAL(12,2) — NOT NULL
  • stock_qty — DECIMAL(12,2) — NOT NULL
  • is_urgent — BOOLEAN — NOT NULL
  • urgent_weight — TEXT
  • urgent_price — TEXT
  • sale_status — TEXT — NOT NULL
  • allow_half_override — BOOLEAN
  • min_weight_override — DECIMAL(10,3)
  • max_weight_override — DECIMAL(10,3)
  • is_open — BOOLEAN — NOT NULL
  • created_at — TIMESTAMPTZ(6) — NOT NULL
  • updated_at — TIMESTAMPTZ(6) — NOT NULL

feedbacks

  • id — UUID — Primary key — NOT NULL
  • user_id — UUID — Foreign key
  • category — VARCHAR(50)
  • content — TEXT — NOT NULL
  • rating — SMALLINT
  • created_at — TIMESTAMPTZ(6) — NOT NULL

fish_species_catalog

  • id — UUID — Primary key — NOT NULL
  • name — TEXT — NOT NULL
  • created_at — TIMESTAMPTZ(6) — NOT NULL

inquiries

  • id — UUID — Primary key — NOT NULL
  • user_id — UUID — Foreign key — NOT NULL
  • category — VARCHAR(50) — NOT NULL
  • title — TEXT — NOT NULL
  • content — TEXT — NOT NULL
  • status — VARCHAR(20) — NOT NULL
  • created_at — TIMESTAMPTZ(6) — NOT NULL
  • updated_at — TIMESTAMPTZ(6) — NOT NULL

inventory_adjustments

  • id — UUID — Primary key — NOT NULL
  • listing_id — UUID — Foreign key → daily_listings.id — NOT NULL
  • delta_qty — DECIMAL(12,2) — NOT NULL
  • reason — TEXT
  • created_by — UUID — Foreign key
  • created_at — TIMESTAMPTZ(6) — NOT NULL

markets

  • id — UUID — Primary key — NOT NULL
  • code — TEXT — NOT NULL
  • name — TEXT — NOT NULL
  • is_active — BOOLEAN — NOT NULL
  • created_at — TIMESTAMPTZ(6) — NOT NULL

media_assets

  • id — UUID — Primary key — NOT NULL
  • storage_provider — TEXT — NOT NULL
  • bucket — TEXT
  • object_key — TEXT — NOT NULL
  • url — TEXT — NOT NULL
  • content_type — TEXT
  • byte_size — BIGINT
  • checksum — TEXT
  • width — INTEGER
  • height — INTEGER
  • created_by — UUID — Foreign key
  • created_at — TIMESTAMPTZ(6) — NOT NULL

notices

  • id — UUID — Primary key — NOT NULL
  • title — TEXT — NOT NULL
  • content — TEXT — NOT NULL
  • is_published — BOOLEAN — NOT NULL
  • created_at — TIMESTAMPTZ(6) — NOT NULL
  • updated_at — TIMESTAMPTZ(6) — NOT NULL

order_deliveries

  • id — UUID — Primary key — NOT NULL
  • order_id — UUID — Foreign key → orders.id — NOT NULL
  • delivery_type — TEXT — NOT NULL
  • courier_type — TEXT
  • recipient_name — TEXT — NOT NULL
  • recipient_phone — VARCHAR(30) — NOT NULL
  • address_line1 — TEXT
  • address_line2 — TEXT
  • secret_code — TEXT
  • requested_time — TEXT
  • requested_time_at — TIMESTAMPTZ(6)
  • created_at — TIMESTAMPTZ(6) — NOT NULL

order_items

  • id — UUID — Primary key — NOT NULL
  • order_id — UUID — Foreign key → orders.id — NOT NULL
  • listing_id — UUID — Foreign key → daily_listings.id
  • product_template_id — UUID — Foreign key → product_templates.id
  • item_name — TEXT — NOT NULL
  • qty — DECIMAL(12,2) — NOT NULL
  • requested_weight_min — DECIMAL(10,3)
  • requested_weight_max — DECIMAL(10,3)
  • requested_weight_text — TEXT
  • confirmed_weight — DECIMAL(10,3)
  • unit_type — TEXT
  • price_per_kg — DECIMAL(12,2)
  • processing_price_per_kg — DECIMAL(12,2)
  • trimming_option_text — TEXT
  • trimming_option_id — UUID — Foreign key → trimming_options.id
  • origin_country_code — TEXT
  • origin_detail — TEXT
  • product_type — TEXT
  • grade — TEXT
  • line_subtotal — DECIMAL(12,2) — NOT NULL
  • created_at — TIMESTAMPTZ(6) — NOT NULL

order_rejections

  • id — UUID — Primary key — NOT NULL
  • order_id — UUID — Foreign key → orders.id — NOT NULL
  • reason_code — TEXT
  • reason_text — TEXT
  • rejected_by — UUID — Foreign key
  • rejected_at — TIMESTAMPTZ(6) — NOT NULL

order_requests

  • id — UUID — Primary key — NOT NULL
  • order_id — UUID — Foreign key → orders.id — NOT NULL
  • soup_request — TEXT
  • extra_text — TEXT
  • packaging_request — BOOLEAN
  • packaging_type — TEXT
  • created_at — TIMESTAMPTZ(6) — NOT NULL

order_status_histories

  • id — UUID — Primary key — NOT NULL
  • order_id — UUID — Foreign key → orders.id — NOT NULL
  • from_status — TEXT
  • to_status — TEXT — NOT NULL
  • changed_by — UUID — Foreign key
  • note — TEXT
  • created_at — TIMESTAMPTZ(6) — NOT NULL

orders

  • id — UUID — Primary key — NOT NULL
  • order_no — TEXT
  • store_id — UUID — Foreign key → stores.id — NOT NULL
  • market_id — UUID — Foreign key → markets.id
  • buyer_user_id — UUID — Foreign key
  • order_channel — TEXT — NOT NULL
  • order_type — TEXT — NOT NULL
  • status — TEXT — NOT NULL
  • status_reason — TEXT
  • requested_at — TIMESTAMPTZ(6) — NOT NULL
  • accepted_at — TIMESTAMPTZ(6)
  • completed_at — TIMESTAMPTZ(6)
  • canceled_at — TIMESTAMPTZ(6)
  • subtotal_amount — DECIMAL(12,2) — NOT NULL
  • discount_amount — DECIMAL(12,2) — NOT NULL
  • delivery_fee — DECIMAL(12,2) — NOT NULL
  • total_amount — DECIMAL(12,2) — NOT NULL
  • applied_coupon_id — UUID — Foreign key → coupons.id
  • memo_internal — TEXT
  • half_status — TEXT
  • paired_order_id — UUID
  • created_at — TIMESTAMPTZ(6) — NOT NULL
  • updated_at — TIMESTAMPTZ(6) — NOT NULL

payments

  • id — UUID — Primary key — NOT NULL
  • order_id — UUID — Foreign key → orders.id — NOT NULL
  • provider — TEXT
  • method — TEXT
  • status — TEXT — NOT NULL
  • amount — DECIMAL(12,2) — NOT NULL
  • currency — TEXT — NOT NULL
  • pg_tid — TEXT
  • requested_at — TIMESTAMPTZ(6) — NOT NULL
  • approved_at — TIMESTAMPTZ(6)
  • raw_payload — JSONB
  • created_at — TIMESTAMPTZ(6) — NOT NULL

product_template_media

  • id — UUID — Primary key — NOT NULL
  • product_template_id — UUID — Foreign key → product_templates.id — NOT NULL
  • media_id — UUID — Foreign key → media_assets.id — NOT NULL
  • sort_order — INTEGER — NOT NULL
  • created_at — TIMESTAMPTZ(6) — NOT NULL

product_templates

  • id — UUID — Primary key — NOT NULL
  • store_id — UUID — Foreign key → stores.id — NOT NULL
  • species_id — UUID — Foreign key → fish_species_catalog.id
  • species_name — TEXT — NOT NULL
  • product_name — TEXT — NOT NULL
  • description — TEXT
  • origin_country_code — TEXT
  • origin_country_name — TEXT
  • origin_detail — TEXT
  • product_type — TEXT
  • size — TEXT
  • grade — TEXT
  • condition — TEXT
  • unit_type — TEXT — NOT NULL
  • base_price — DECIMAL(12,2)
  • min_weight — DECIMAL(10,3)
  • max_weight — DECIMAL(10,3)
  • min_order_qty — DECIMAL(10,2) — NOT NULL
  • max_order_qty — DECIMAL(10,2)
  • allow_half — BOOLEAN — NOT NULL
  • allow_spicy_soup — BOOLEAN — NOT NULL
  • custom_countries — JSONB
  • is_active — BOOLEAN — NOT NULL
  • created_at — TIMESTAMPTZ(6) — NOT NULL
  • updated_at — TIMESTAMPTZ(6) — NOT NULL
  • deleted_at — TIMESTAMPTZ(6)

review_photos

  • id — UUID — Primary key — NOT NULL
  • review_id — UUID — Foreign key → reviews.id — NOT NULL
  • media_id — UUID — Foreign key → media_assets.id — NOT NULL
  • sort_order — INTEGER — NOT NULL
  • created_at — TIMESTAMPTZ(6) — NOT NULL

reviews

  • id — UUID — Primary key — NOT NULL
  • order_id — UUID — Foreign key → orders.id — NOT NULL
  • store_id — UUID — Foreign key → stores.id — NOT NULL
  • user_id — UUID — Foreign key — NOT NULL
  • rating — SMALLINT — NOT NULL
  • content — TEXT
  • created_at — TIMESTAMPTZ(6) — NOT NULL
  • updated_at — TIMESTAMPTZ(6) — NOT NULL
  • deleted_at — TIMESTAMPTZ(6)

store_accounts

  • id — UUID — Primary key — NOT NULL
  • store_id — UUID — Foreign key → stores.id — NOT NULL
  • type — VARCHAR(30) — NOT NULL
  • company_name — VARCHAR(200)
  • bank — VARCHAR(50) — NOT NULL
  • account_number — VARCHAR(50) — NOT NULL
  • holder — VARCHAR(100) — NOT NULL
  • sort_order — INTEGER — NOT NULL
  • created_at — TIMESTAMPTZ(6) — NOT NULL
  • updated_at — TIMESTAMPTZ(6) — NOT NULL

store_favorites

  • id — UUID — Primary key — NOT NULL
  • user_id — UUID — Foreign key — NOT NULL
  • store_id — UUID — Foreign key → stores.id — NOT NULL
  • created_at — TIMESTAMPTZ(6) — NOT NULL

store_media

  • id — UUID — Primary key — NOT NULL
  • store_id — UUID — Foreign key → stores.id — NOT NULL
  • media_id — UUID — Foreign key → media_assets.id — NOT NULL
  • purpose — TEXT — NOT NULL
  • sort_order — INTEGER — NOT NULL
  • created_at — TIMESTAMPTZ(6) — NOT NULL

store_members

  • id — UUID — Primary key — NOT NULL
  • store_id — UUID — Foreign key → stores.id — NOT NULL
  • user_id — UUID — Foreign key — NOT NULL
  • role — TEXT — NOT NULL
  • created_at — TIMESTAMPTZ(6) — NOT NULL

store_notice_media

  • id — UUID — Primary key — NOT NULL
  • notice_id — UUID — Foreign key → store_notices.id — NOT NULL
  • media_id — UUID — Foreign key → media_assets.id — NOT NULL
  • sort_order — INTEGER — NOT NULL
  • created_at — TIMESTAMPTZ(6) — NOT NULL

store_notices

  • id — UUID — Primary key — NOT NULL
  • store_id — UUID — Foreign key → stores.id — NOT NULL
  • title — TEXT
  • content — TEXT — NOT NULL
  • is_pinned — BOOLEAN — NOT NULL
  • is_public — BOOLEAN — NOT NULL
  • published_at — TIMESTAMPTZ(6)
  • created_by — UUID — Foreign key
  • created_at — TIMESTAMPTZ(6) — NOT NULL
  • updated_at — TIMESTAMPTZ(6) — NOT NULL
  • deleted_at — TIMESTAMPTZ(6)

stores

  • id — UUID — Primary key — NOT NULL
  • market_id — UUID — Foreign key → markets.id — NOT NULL
  • name — TEXT — NOT NULL
  • owner_user_id — UUID — Foreign key
  • phone — VARCHAR(30)
  • address_line1 — TEXT
  • address_line2 — TEXT
  • directions — TEXT
  • business_hours — JSONB
  • description — TEXT
  • announcement_text — TEXT
  • tags — TEXT
  • rating_avg — DECIMAL(3,2) — NOT NULL
  • review_count — INTEGER — NOT NULL
  • follower_count — INTEGER — NOT NULL
  • is_open — BOOLEAN — NOT NULL
  • control_panel_settings — JSONB
  • created_at — TIMESTAMPTZ(6) — NOT NULL
  • updated_at — TIMESTAMPTZ(6) — NOT NULL
  • deleted_at — TIMESTAMPTZ(6)

trimming_options

  • id — UUID — Primary key — NOT NULL
  • product_template_id — UUID — Foreign key → product_templates.id — NOT NULL
  • pricing_unit — TEXT — NOT NULL
  • option_name — TEXT — NOT NULL
  • price — INTEGER — NOT NULL
  • is_default — BOOLEAN — NOT NULL
  • sort_order — INTEGER — NOT NULL
  • created_at — TIMESTAMPTZ(6) — NOT NULL

user_addresses

  • id — UUID — Primary key — NOT NULL
  • user_id — UUID — Foreign key — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • phone — VARCHAR(30)
  • address_line1 — TEXT — NOT NULL
  • address_line2 — TEXT
  • is_default — BOOLEAN — NOT NULL
  • created_at — TIMESTAMPTZ(6) — NOT NULL
  • updated_at — TIMESTAMPTZ(6) — NOT NULL

user_coupons

  • id — UUID — Primary key — NOT NULL
  • user_id — UUID — Foreign key — NOT NULL
  • coupon_id — UUID — Foreign key → coupons.id — NOT NULL
  • acquired_at — TIMESTAMPTZ(6) — NOT NULL
  • used_at — TIMESTAMPTZ(6)
  • order_id — UUID — Foreign key → orders.id

user_identities

  • id — UUID — Primary key — NOT NULL
  • user_id — UUID — Foreign key — NOT NULL
  • provider — TEXT — NOT NULL
  • provider_subject — TEXT — NOT NULL
  • provider_email — VARCHAR(255)
  • raw_profile — JSONB
  • created_at — TIMESTAMPTZ(6) — NOT NULL

user_refund_accounts

  • id — UUID — Primary key — NOT NULL
  • user_id — UUID — Foreign key — NOT NULL
  • bank — VARCHAR(50) — NOT NULL
  • account_number — VARCHAR(50) — NOT NULL
  • holder — VARCHAR(100) — NOT NULL
  • created_at — TIMESTAMPTZ(6) — NOT NULL
  • updated_at — TIMESTAMPTZ(6) — NOT NULL