Product Architecture

How visionHub works, end to end.

A visual walkthrough of the core flows, rule engines and data domains that power the marketplace.

Roles & permissions

Customer

  • Browse catalog
  • Place multi-seller orders
  • Track shipments
  • Manage consent

Seller

  • CRUD products
  • Fulfill assigned orders
  • View revenue & settlements
  • Manage shipping

Admin

  • Approve/reject/block sellers
  • Configure commissions
  • View all orders & suborders
  • Trigger settlements

Order lifecycle

1

Cart

2

Order placed

3

Split into suborders

4

Seller fulfills

5

Delivered

A single customer order fans out into one suborder per seller. Each suborder has its own status, tracking code and shipping context — invisible to other sellers.

Commission engine

Rule resolution

function resolveCommission(seller, global):
  if seller.commissionOverride != null:
    return seller.commissionOverride
  return global.marketplaceCommission

fee      = suborder.total * rate / 100
earnings = suborder.total - fee

Applied at settlement time

  1. Order completed → suborder totals frozen.
  2. Marketplace fee computed per suborder.
  3. Seller earnings accumulate into balance.
  4. Admin issues a manual settlement to zero the balance.

Seller onboarding state machine

SignupPending
ApprovedRejected
Blocked (admin)

Only approved sellers can list products or receive orders. Blocked or rejected sellers keep their historical data.

Shipping

Correios-ready integration

  • Rate calculation by CEP
  • Label generation per suborder
  • Tracking event stream

Data model

User ─┬─ Customer
      ├─ Seller ── Products (1..n)
      └─ Admin

Order ── SubOrder (1..n) ── OrderItem (1..n) ─ Product
Order ── Customer
SubOrder ── Seller ── Settlement (1..n)
Consent ── User (versioned)
Notification ── audience[]

Compliance (LGPD)

Versioned consent

Every user carries a consentVersion stamp. When the policy version changes, users are re-prompted on next sign-in. Records are immutable and auditable.

Notifications

Event → audience routing

seller.registeredadmin
seller.approvedseller
seller.rejectedseller
seller.blockedseller, admin
order.createdseller, admin
order.shippedcustomer
settlement.paidseller

Financial settlements

Manual mark-as-paid workflow

Balances accrue automatically. Admins review outstanding amounts and mark settlements as paid once the bank transfer clears. Full history is preserved per seller.

© visionHub — architecture snapshot