Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Name the widening failure this ordering model invites
Damian Legawiec3aa6fe42341d
diff --git a/docs/plans/6.0-multi-vendor-marketplace.md b/docs/plans/6.0-multi-vendor-marketplace.mdindex 077f994af7..ed394140db 100644--- a/docs/plans/6.0-multi-vendor-marketplace.md+++ b/docs/plans/6.0-multi-vendor-marketplace.md@@ -92,6 +92,8 @@ Two specifics worth copying rather than inventing. Tiering is expressed as thres**Precedence (RESOLVED 2026-06-25; reshaped 2026-08-17 — `acts_as_list`, shipped): an ordered list, not a fixed ladder.** Rates carry `position` via `acts_as_list scope: :store_id` and are walked top-down, first match wins — so the order an operator sees in the table *is* the precedence, and reordering is dragging a row rather than reasoning about an integer. **New rates are created at the top** (`add_new_at: :top`): a rate exists to say something more specific than what is already there, and appending would file it behind the catch-all that matches everything. Seeds put a disabled marketplace-wide rate at the bottom, which makes the product-then-category-then-seller order merchants asked for fall out for free without hardcoding it. Ordering is deliberately **not** derived from how specific a rate's rules look: a rate may name a product, a category and a seller at once, so there is no single dimension to sort on, and "narrowest wins" guesses at an intent the operator can simply state.+**The failure mode this model has, and which every change near it must be checked against:** a rate that matches everything makes every rate below it unreachable, and the mistakes that produce one are all silent widenings — a rate charging *more* sales than anybody asked it to, with a 200 saying it worked. Three separate instances surfaced while building this, each needing a deliberate refusal rather than a sensible default: a rules payload naming an unreachable record used to drop that rule (leaving a narrow rate global), an unregistered rule kind used to be skipped by `assign_typed_association` (same result), and the seeded catch-all was created at the top of the list by `add_new_at: :top` (shadowing every targeted rate on a store that already had some, once enabled). `CommissionRate#global?` exists so the condition is at least visible — the admin marks such a rate — and any future work on rules, ordering or seeding should ask what happens when its input is wrong in the widening direction.+### 5. One payment, recorded as a per-seller split — adopt the explicit split-payment recordThe customer makes **one payment** (one gateway charge against the order group). Do **not** create N gateway charges. The split is bookkeeping: