← Technical notes
Confidential / NDA3 diagrams

Seller onboarding and product variants

Independent sellers needed to open shops inside an app whose accounts, addresses and categories already existed.

TL;DR

NDA note: shop applications, category attributes, and up to two variant axes with a price and stock row per variant.

live trace · Application flowfrom the original diagram
Seller Apply API Seller store Store location Account detail 01apply with profile, address, account details, documents 02insert or update if rejected, status pending 03create default location from address 04create default account detail 05application submitted
  1. 01
    Seller → Apply APIapply with profile, address, account details, documents
  2. 02
    Apply API → Seller storeinsert or update if rejected, status pending
  3. 03
    Apply API → Store locationcreate default location from address
  4. 04
    Apply API → Account detailcreate default account detail
  5. 05
    Apply API → Sellerapplication submitted
01

Background

Independent sellers needed to open shops inside an app whose accounts, addresses and categories already existed. Products needed variants (for example size and colour) with their own price and stock.

02

How it works

  1. The seller applies using an existing account address and account details detail; the application copies them into the shop's default location and account details record.
  2. One shop per account. A rejected application is updated in place and resubmitted, not duplicated.
  3. Admin approves or rejects. Only an active shop can list products.
  4. Categories define attribute templates; the seller fills attributes and defines up to two variant axes.
  5. Every combination of axis values becomes a variant row with its own price and stock. The product keeps a denormalised minimum price for listing pages.
  6. Edits keep existing variant rows where possible, so stock and order references stay stable. Structural edits are blocked while stock is held by an unconfirmed checkout.
03

Design decisions

  • Snapshot address and account details onto the shop at apply time, so later edits to the buyer profile do not silently change the shop.
  • Two fixed variant axes instead of an open-ended axis table: simpler queries and admin UI, matching what sellers actually need.
  • Uniqueness enforced by database constraints (one shop per account, unique slug), with application checks in front.
All diagrams

Other views

Tap a table to see what it links to.

ACCOUNT
SELLER_STORE
STORE_LOCATION
OPENING_HOURS
ACCOUNT_DETAIL
CATEGORY
ATTRIBUTE_TEMPLATE
PRODUCT
VARIANT_AXIS
AXIS_VALUE
VARIANT
ATTRIBUTE_VALUE
  • ACCOUNT owns SELLER_STORE 1 → 0..1
  • SELLER_STORE has STORE_LOCATION 1 → many
  • STORE_LOCATION has OPENING_HOURS 1 → many
  • SELLER_STORE has ACCOUNT_DETAIL 1 → many
  • CATEGORY defines ATTRIBUTE_TEMPLATE 1 → many
  • SELLER_STORE lists PRODUCT 1 → many
  • CATEGORY classifies PRODUCT 1 → many
  • PRODUCT has VARIANT_AXIS 1 → many
  • VARIANT_AXIS has AXIS_VALUE 1 → many
  • PRODUCT has VARIANT 1 → many
  • PRODUCT has ATTRIBUTE_VALUE 1 → many

← Technical notes on the home page