warehouse-systems fleet · executive briefing

pricing

Sets what a shopper pays and locks it in a quote checkout can trust
seven capabilitys5 events out · 2 in9 recorded decisions

This project is a domain-driven design study. It is not associated with, endorsed by or affiliated with any company, and it uses no company's code, data, logos or trademarks. All names, figures and examples are illustrative or synthetic. · November 2026

the short version · read this if nothing else

Pricing owns every number a shopper pays and binds it in an expiring quote, so checkout never re-guesses

1

One owner for price, delivery charge and tax keeps the shopper's total consistent.

2

Binding, immutable quotes give checkout a total it can confirm against.

3

Its limits are deliberate: one currency, synthetic tax and no promotions yet.

The ask

Fund the promotions phase and settle how checkout learns a quote expired.

why it exists

What a shopper pays needs exactly one owner

Pricing is the Core subdomain of the storefront: it owns what a shopper pays — the list price and sale windows per catalogue item, the delivery charge per service tier, a synthetic tax table, and the binding, immutable, expiring PriceQuote a checkout session is confirmed against. One configured currency (BRL) and integer minor units keep the money exact…

Today

It holds list prices, sale windows, delivery charges and a synthetic tax table in exact integer money, and issues binding quotes.

The catch

Promotions are deferred, no event signals quote expiry, the tax table isn't real, and queue health has no metrics.

what it does

It sets prices, charges and tax, then locks them in a quote

List prices

Publishes item prices and sets list prices safely, even if the call repeats.

Sale windows

Schedules sales and publishes the new price when a window opens or closes.

Price withdrawal

Withdraws prices, automatically when a catalogue item is discontinued.

Delivery charges

Owns the delivery charge for each service tier.

Synthetic tax table

Keeps a stand-in tax table for totals; it is not a real tax engine.

Binding quotes

Issues immutable, expiring quotes with lines, delivery, tax and total.

who it talks to

One context feeds it, two build on what it publishes

LISTENS TO · 2 EVENT TYPESIS HEARD BY · 2 CONTEXTSoffer-availability2shopping-cart4product-discovery2pricingbadge = event types on that edge · derived from the CloudEvents types each repo declares
the shared language

Prices, sale windows and quotes make up the pricing language

THE LANGUAGEOF THE DOMAINItemPriceListPriceEffectivePriceSaleWindowDeliveryChargeScheduleTaxTablePriceQuoteCatalogItemView
REST13 operations over 12 paths on :8080
MCPRead-only MCP server (cmd/mcp, :8090…
A2ARead-only A2A agent (cmd/a2a, :8093): skills item_price and…
how it is built

A hexagonal core with REST plus read-only MCP and A2A agents

DRIVERS · INBOUNDOUTBOUND · ADAPTERSREST API :808013 operations over 12 pathsMCP tools :8090Read-only MCP server…Kafka consumer · 2 eventsCatalogItemCreatedCatalogItemDiscontinuedDOMAIN COREItemPriceListPriceEffectivePriceSaleWindowPostgreSQLPostgreSQL onlyKafka producer · 5 eventsitemprice.ItemPriceChangeditemprice.ItemPriceWithdrawnTransactional outboxrelay · DLQ on x-dlq-*commands inevents inevents outstorage / infra
event traffic · CloudEvents 1.0 on Kafka

Two event types in, five out, from price changes to issued quotes

CONSUMED · BY SOURCE · 2PUBLISHED · BY ENTITY · 5offer-availability 22 itemprice1 deliverychargeschedule1 pricequote1 taxtableCatalogItemCreatedCatalogItemDiscontinuedItemPriceChangedItemPriceWithdrawnDeliveryChargeScheduleChangedTaxTableChangedPriceQuoteIssued
how we know it is healthy

Fleet-standard traces and fitness tests keep the money rules exact

Fleet observability standard (ADR 0005): OpenTelemetry OTLP/gRPC export to the in-cluster Collector, never blocking; JSON logs on stdout carrying trace_id/span_id and request_id

What we watch

  • Trace continues across Kafka in the traceparent header of each published event and is picked up by the consumer
  • Business counter pricing.quotes.issued with outcome/reason attributes
  • HTTP request duration histogram plus one server span and request-log line per call sharing a trace id

What stops a bad change

  • make check (pre-push) / check-fast / check-all: fmt, vet, build, lint, test, coverage, arch-test, BDD
  • Coverage gate >= 90% over domain + application (CI test job)
  • golangci-lint and complexity gates
  • Spectral lint of apis/openapi.yaml (api-lint) and AsyncAPI lint (guide-lint)
by the numbers

Nine decisions and 15 BDD features back the money rules

9
Architecture decisions
#34 of 45 in the fleet
1
DB migrations
#32 of 45 in the fleet
15
BDD feature files
#19 of 45 in the fleet
5
Events published
#21 of 45 in the fleet

Ranked against all 45 briefed repositories (dot = one repository, highest on the left).

One-command workflows (make)

arch-testbddbuildcheckcheck-allcheck-fastcoveragefmtfmt-checkguide-lintharness-testhelpintegrationlint
what comes next

Next, ship promotions and settle how quotes expire

NOW1Deliver thedeferredpromotions phaseDeliver the deferredpromotions phase (D10):sale windows arecurrently the onlyprice-mover besides thelist priceNEXT2Settle thequote-expirycontract forSettle the quote-expirycontract fordownstreams: there is noPriceQuoteExpired event,so checkout must pollGET/price-quotes/{quoteId}NEXT3Plan and test thefirst schemaupgradePlan schema evolution: asingle migration step(0001) carries theentire pricing store, sothe first changeexercises an untestedupgrade pathLATER4Raise mutationgate from efficacy85 toward 99/99Raise the mutation gatefrom efficacy 85 /mutant-coverage 95toward the 99/99 fleetstandard(.gremlins.yaml:33-34)LATER5Add outbox-lag,consumer-lag anddead-letterAdd queue-healthmetrics:observability.md statesthere is no outbox-laggauge, consumer-lagmetric or dead-lettercounter
what could go wrong · and what we do about it

Our biggest risk is money rules built on hard assumptions

One currency and integer minor units are baked in

Core storefront domain whose money math rests on hard assumptions: one configured currency (BRL) and integer minor units are baked in

→

No mitigation on the roadmap yet: this one needs an owner.

The tax table is synthetic, not fiscal compliance

The tax table is synthetic, not a tax engine — it must not be treated as real fiscal compliance

→

No mitigation on the roadmap yet: this one needs an owner.

A lagging policy pass publishes sale changes late

The effective price depends on the clock-driven policy pass (POLICY_INTERVAL…

→

The policy interval can be tightened if boundary lag shows up.

Unauthenticated endpoints, by fleet decision

Every REST, A2A and MCP endpoint is unauthenticated by decision (fleet-wide auth revert, TestNoAuthMiddlewareReintroduced…

→

A decision, not a gap: fleet-wide.

the decision we need

Fund the promotions phase and settle how checkout learns a quote expired.

WHAT ISIt holds list prices, sale windows,delivery charges and a synthetic taxtable in exact integer money, andissues binding quotes.THE CATCHPromotions are deferred, no eventsignals quote expiry, the tax tableisn't real, and queue health has nometrics.WHAT COULD BEPromotions join sale windows as aprice lever, and checkout hearsabout expiry instead of polling forit.
Why it matters

Pricing owns every number a shopper pays and binds it in an expiring quote, so checkout never re-guesses

appendix · for the engineers in the room

The fine print: how it is put together

StyleHexagonal / ports & adapters, DDD bounded context; layering enforced as an executable fitness test (arch-go), not a convention
Layoutcmd/{api,a2a,mcp} (api is the composition root with REST + outbox relay + offer-availability consumer + clock-driven policies in one process)…
StoragePostgreSQL only (pgxpool, embedded golang-migrate at boot, idempotency-key pool, transactional outbox, CatalogItemView local read model); Kafka…
Testinggo test -race unit suites; godog/Gherkin BDD (15 feature files) over the real HTTP API; testcontainers Postgres+Kafka integration…
REST13 operations over 12 paths on :8080: /item-prices, /item-prices/{catalogItemId}, /item-prices/{catalogItemId}/list-price…
Go 1.27chipgx/pgxpoolMCP Go SDKa2a-goKafkaCloudEvents 1.0golang-migrateOpenTelemetryHelmgodoggremlins