platform
This commit is contained in:
1 parent
e706f7d907
commit
21bcb63440
42 files changed
+5903
No files matched your search
@@ -0,0 +1,41 @@
|
||||
// Package catalog defines the published, versioned catalog projection that
|
||||
// commerce modules (cart, checkout, order) consume — and the configurable
|
||||
// per-tenant Schema that maps a producer's private item JSON into that
|
||||
// projection.
|
||||
//
|
||||
// Why configurable: different tenants ship with different catalog shapes
|
||||
// (one has ArticleNumber, another has sku; one's price is inc-VAT minor units,
|
||||
// another's is a float with a separate currency; some include a Brand field,
|
||||
// others don't). A one-size-fits-all Projection field set would force every
|
||||
// tenant to field the union of all constraints; the configurable Schema keeps
|
||||
// each tenant's producer adapter small while still emitting the same
|
||||
// downstream wire shape, so commerce consumers do not change.
|
||||
//
|
||||
// What's here:
|
||||
//
|
||||
// - Projection: the published, versioned entry (struct + Encode helpers).
|
||||
// - Schema: declarative field-map for one tenant's source JSON.
|
||||
// - DefaultSchema: the consensus shape that works out of the box when no
|
||||
// tenant-specific override is supplied.
|
||||
// - Registry: per-tenant lookup with DefaultSchema fallback.
|
||||
// - Builder: applies a Schema to a generic source map; pure function.
|
||||
//
|
||||
// What is NOT here (kept out by design):
|
||||
//
|
||||
// - Numerics live in minor units (öre) and stay int64 — never float. The
|
||||
// platform-wide rate-scale convention (basis-points-of-a-percent) is
|
||||
// documented in platform/tax; TaxClass is a STRING identifier on the
|
||||
// Projection side and is resolved to a numeric rate by platform/tax, never
|
||||
// on the wire.
|
||||
// - No transport, no AMQP consumer/producer, no event-subscriber wiring —
|
||||
// callers publish / consume `Projection` JSON via the existing
|
||||
// `platform/event` + `platform/rabbit` package plumbing.
|
||||
// - No HTTP lookup. Finder remains the federation source; no commerce module
|
||||
// issues a "lookup this SKU" RPC today and resolving it here would be
|
||||
// premature.
|
||||
//
|
||||
// See docs/published-document-vocabulary-pass.md §11 for the wider vocabulary
|
||||
// context (this package implements the cart side of that contract; the full
|
||||
// vocabulary is the next pass and lives in `platform/published` once proven
|
||||
// out).
|
||||
package catalog
|
||||
Reference in new issue
Block a user