Reorderly platform standard
One business model for Selva, Derwent, and the next customer.
A canonical data model and implementation plan that keeps raw source evidence, normalized business facts, calculated projections, and workflow actions separate.
Proposed · 19 Aug 2026
The decision: Selva becomes the reference implementation, but Grist does not become the permanent schema. Reorderly owns a shared core; Selva and Derwent add modules; tenant-specific metadata uses typed custom fields.
The data flow
External systems
Source adapters
Raw evidence
Canonical facts
Projections & workflows
R2 stores immutable raw JSON or CSV artifacts. D1 stores identities, facts, provenance, projections, and workflow records. The dashboard reads explicit projections, not provider payloads.
Shared core
OrganizationThe Reorderly customer boundary. Every business-owned row is tenant-scoped.
Source connectionAn external Xero tenant, Zoho organization, MYOB file, or future connector account.
CatalogProducts, identifiers, aliases, suppliers, and product-to-material components.
PartiesCustomers, suppliers, locations, and markets. The canonical label is country, not territory.
FactsSales lines, inventory snapshots, supply events, receipts, and user adjustments.
PlanningPolicies, demand snapshots, replenishment runs, decision traces, and order lines.
Lineage & qualityRaw artifacts, source IDs, hashes, run counts, rejected rows, and durable issues.
Custom fieldsTyped tenant metadata without changing the canonical schema for every customer.
Selva and Derwent
| Shared | Selva module | Derwent module |
|---|---|---|
| Organizations, source connections, catalog, suppliers, facts, demand, policies, replenishment, provenance | Xero SG, Zoho MY/TH, country/market, customers and AR, product-to-material consumption, transit and spoilage, kg/carton | MYOB item identity, supplier acknowledgement, purchase orders, order baskets, exports, receipts, supplier lead times |
| Both use the same canonical product identity and source mapping contracts. | Grist fields such as territory, helper columns, and QC columns stay at the adapter/quality boundary. | vendors becomes the compatibility alias for the shared suppliers entity. |
What belongs where
Raw layerImmutable source payloads, content hashes, object keys, and retention metadata. Used for replay and audit.
Fact layerStable business records such as sales lines, stock snapshots, customers, and supply events.
Projection layerCustomer monthly sales, burn rates, run-out dates, stock positions, and replenishment queues.
Workflow layerReviews, overrides, replenishment runs, purchase orders, acknowledgements, and receipts.
Important rules
- A green workflow run is not enough. The run must report fetched, accepted, rejected, duplicate, and unresolved counts.
- Country comes from the source connection or an explicit mapping. It is not inferred from currency or a product name.
- Raw SKU, source item code, canonical SKU, and review state remain separate.
- Missing SKU is a visible data-quality issue until the source item master and line payload have been checked.
- Credit freeze is a local business control. A source sync may update a nominal credit limit but must not erase the freeze.
- Three-month and six-month demand calculations store their window, policy version, freshness, and inputs.
- Incoming and spoiled stock are typed supply events, not ambiguous free-text status values.
Implementation sequence
| Phase | Outcome |
|---|---|
| 1. Contract | Freeze vocabulary and Zod contracts for the shared model. |
| 2. Storage | Add additive D1 tables, indexes, lineage, raw-artifact metadata, and typed quality issues. |
| 3. Adapters | Normalize Xero, Zoho, Grist migration data, and MYOB into the same envelope. |
| 4. Facts | Backfill catalog, customers, sales, inventory, supply events, and provenance. |
| 5. Projections | Rebuild customer, stock, demand, run-out, and replenishment read models. |
| 6. Extensions | Add custom fields, Selva materials/spoilage, and Derwent purchasing workflows. |
| 7. Cutover | Dual-read and reconcile by source, country, account, month, quantity, and value before switching production reads. |
| 8. Starter extraction | Extract stable contracts, domain primitives, policy engine, adapter SDK, provenance helpers, and UI primitives into a versioned Reorderly starter. |
Vocabulary in plain language
| Term | Plain meaning |
|---|---|
| Entity | A business thing we care about, such as a Customer or Product. |
| Record | One instance of an entity, such as one customer row. |
| Field | One property of a record, such as country or credit limit. |
| Schema | The formal shape and constraints of stored data. |
| Data model | The conceptual map of business things, relationships, and rules. A schema is its technical encoding. |
| Fact | A recorded observation or transaction, such as an invoice line or stock snapshot. |
| Projection | A calculated view built from facts for fast reading. |
| Adapter | The translator between a provider’s fields and Reorderly’s canonical meaning. |
| Custom field | A tenant-defined typed property that is not yet part of the shared core. |