Skip to main content

Ubiquitous language

Every term of the context with the code identifier that implements it. Use these exact names in code, tests, ADRs and conversation. Terms marked (contract) are fixed by apis/openapi.yaml or an ADR rather than by a Go identifier.

TermMeaningCode or contract
EdgeThe one HTTP surface of the storefront, /api/storefront.http.BasePath, inbound.Server
UpstreamOne of the six services the BFF calls.composition.Service (ProductDiscovery, DeliveryPromise, ShoppingCart, Checkout, CustomerOrdering, Pricing)
CallOne outbound request to an upstream: service, method, path, query, body, key.composition.Call
ReplyAn upstream answer kept raw (status, content type, body), so problem+json passes through.composition.Reply, Reply.OK
AllowlistThe closed list of METHOD /path templates the storefront may call; anything else is refused before a request is built.composition.Allowed, AllowedRoutes, allowed
Restricted routeA network route the storefront never calls (ship-to, promise create/confirm/cancel, inventory feeds, policy).TestNoInOrgNetworkRoute
GatewayThe set of composition use cases over the upstream port.usecases.Gateway, NewGateway
Use caseOne method of Gateway, one per public route.Use cases
RelayForward one upstream answer untouched.Gateway.relay, Server.respond
CompositionA route that joins more than one upstream call, with a required leg and optional legs.DeliveryDates, GetOrder
OutcomeA use case result: the reply to relay and the cookie state to store, if it changed.usecases.Outcome
ActorWho a request acts for: the cookie state plus the page's action id.usecases.Actor
PortThe one outbound interface of the application layer.ports.Upstream
BudgetThe whole-request time limit of a route class; expiry is a 504, never retried.composition.Budgets, DefaultBudgets
Class (of a route)Query (2 s), Command (5 s) or Confirm (15 s).composition.Class, Query, Command, Confirm
Idempotency-KeyThe header the BFF mints for every non-GET upstream call.composition.MintKey, Call.IdempotencyKey
Page keyThe Idempotency-Key the page sends on every POST and PATCH (fresh per user submit, reused on retry); the upstream key is minted from it.Actor.IdempotencyKey, Idempotency-Key (contract)
SubjectThe stable owner part of a key: the cookie's shopper, else cart, else anonymous.Actor.subject
State (cookie)The shopper's browsing state: open cart, shopper and last checkout session ids. State, not authentication.composition.State, CookieName (sf_state)
Valid id1 to 128 characters of [A-Za-z0-9._-] starting with an alphanumeric; it cannot alter an upstream path.composition.ValidID
ShopperThe customer-ordering record the cookie points to; created by registering, found by e-mail.State.ShopperID, RegisterShopper, Login
Session (route)POST /sessions: an e-mail lookup that stores the shopper id. There is no password and no authentication.usecases.Login, createSession (contract)
CartThe shopping-cart resource; its id rides in the cookie as c.State.CartID
Checkout sessionThe checkout resource; its id rides as k and lets order detail join totals.State.CheckoutID
Delivery datesThe product-page answer: one tier per quoted offer with its window, charge and time zone.usecases.DeliveryDates, composeDates, dateTier
TierA delivery speed tier of the network (for example NEXT_DAY).quotedOffer.Tier, tierCharge
Postal prefix1 to 10 letters, digits, spaces or dashes: a prefix, never an address.validPostalPrefix
Payment method tokenThe PSP token the page sends on confirm; the only payment datum the BFF accepts.confirmRequest.PaymentMethodToken
Card guardRefusal of card-shaped JSON keys and Luhn-valid tokens.IsCardFieldName, LooksLikeCardNumber
ProblemAn RFC 9457 application/problem+json answer the edge itself produces, type under /problems/.problems.go, problemKind
Pass-throughA body the BFF forwards byte for byte without storing or logging it (cart, shopper and address bodies).ADR 0002 A10
DegradeAn optional leg fails and is left out of the reply: tracking, order totals, the delivery charge.GetOrder, chargesByTier
Prefix stripRoutes answer with or without /api/storefront.stripBase

Words not to use​

Do not saySayWhy
log in, authenticate, auth tokenlook up a shopper by e-mail, state cookieNothing is authenticated fleet-wide; sf_state grants no access.
session (for the cookie)state cookie"session" names the POST /sessions lookup and the checkout session; the cookie holds ids only.
cacherelayThe BFF caches nothing (ADR 0004 defers caching to a fleet-wide decision).
order service, cart service (as the BFF's own code)upstreamThe BFF owns no cart, order or price.
retry (a budget)re-send with the same action idA budget expiry is never retried by the BFF; a client retry is safe because the key repeats.
card number, PAN, CVCpayment method tokenThe BFF refuses card data by design.