Proposed (STA-1021, batch stackra-40). It carries out STA-904 (the 3PL port), the port part of
STA-795 (EDI), owner decisions R3-SO-03 and R3-SO-07, the Commerce module catalogue’s five
integrations gaps and the restaurant catalogue’s open question on food-delivery and courier
shelves. It builds on
0355
(one Integration, five roles, connector kinds),
0356
(the provider per tenant and Market) and
0376.Context
@stackra/integrations declared the commerce connector interfaces (FulfilmentProviderConnector,
SalesChannelConnector, ProductFeedConnector) but no way for a module to reach a Connection it does not define:
ProviderResolver takes a ProviderDrivers map, and only the package that wrote the connection classes could build
one. Vendor connectors now live in the OS integrations service (0443), so no consuming module ever defines them.
Commerce reported five gaps against the package: no 3PL Connection lookup (warehouse), no gateway resolving channel
and feed connectors, a SalesChannelConnector without the delivery-app and marketplace operations, no EDI kind with
no lookup by capability (purchasing), and no fraud-scoring port (orders). The products need shelves for food
delivery, couriers, electronic shelf labels, scales and court systems, and Juristra a document-store connector.
Decision
- Shelves.
IntegrationCategorygainsedi,fraud,food_delivery,courier,document_management,esl,scalesandcourt. A shelf is where the marketplace lists a provider; the providers on it are Connection classes in OS integrations. A court-system connector is a Connection on thecourtshelf, never a framework of its own. - Lookup by capability.
connectionsOf(capability)reads the connection registry gen fills and answers the classes whose Integration declares the connector kind, or sits on the shelf, keyed by provider code (aProviderDriversmap). Two Integrations of one provider code are refused (0355 decision 1).ConnectorGatewaypasses that map toProviderResolverwith the kind’s code as the capability, so a Market’s providers per kind are pack data underproviders.<kind>and the 0356 rule (own first, then managed) is unchanged. A named provider narrows the map to it; an unregistered one isNoProviderError. - Sales channels.
SalesChannelConnectorkeeps its five required methods and gains optional ones:reject,cancel,setPrepTime,setMenu(sections, items, modifier groups),setAvailability,setListingsandreturns. A channel implements the ones it has (a delivery app a menu and prep times, a marketplace listings and returns); a caller filters withaccepts.ChannelOrdergainspaymentMethod(prepaid,cash_on_delivery,card_on_delivery). - EDI. The
ediconnector kind namesEdiConnector: send a canonical document once per idempotency key, receive the documents held for us, acknowledge each. The canonical set is order, order response, despatch advice, invoice and acknowledgement, as the network’s JSON; the network (managed: Figentra’s account named per pack; own: the chain’s) does the EDIFACT, X12 or GS1 XML codecs and AS2 (R3-SO-07). Partners and mappings are per-Connection data. - Fraud scoring. The
fraud_scoringkind namesFraudScoringConnector:score(idempotent on the reference) andoutcome(feedback). AFraudScore(score0 to 100,decision,reasons) is a fact value as it stands; the consuming module registers thefraudfact source (0331) and the tenant’s rules decide holds. Nothing in integrations thresholds on it. - Document stores. The
document_storekind namesDocumentStoreConnector(list a folder, fetch a document, file a document or a new version once per key) for iManage, NetDocuments and SharePoint. It is a connector kind, not a sixth role: 0355 keeps five.
Consequences
- OS integrations builds the vendor Connections on these contracts (stackra-45 for EDI connectors; the managed EDI
network driver is stackra-46); market packs list them under
providers.<kind>. - Commerce resolves 3PL, channel, feed, EDI and accounting Connections through
ConnectorGatewayorconnectionsOf; restaurant products filter delivery apps withaccepts. ./testingshipsMemoryFulfilmentProviderbesideMemoryPayrollConnector.
Enforcement
- Unit tests of
connectionsOf,ConnectorGateway, the enums and the memory 3PL; the barrels’ export lists. - The package’s AGENTS.md: a new kind names one interface; never import another package’s connection class.
Alternatives
- One base class per kind (
FulfilmentProviderConnection extends Connection): gen binds a connection to its Integration byextends Connection<XIntegration>and its name, so an intermediate base would break that binding. Rejected; the interface plusconnectionsOfgives the same typing. - Separate interfaces per channel feature: more names for one channel to implement and the gateway to resolve. Rejected for optional methods.
Supersedes and sources
Supersedes nothing. Sources: STA-904, STA-795, STA-1021; R3-SO-03, R3-SO-07; ADR 0218 decision 5, 0308, 0348 decision 5, 0355, 0356, 0376; Commerceapps/docs/src/docs/build/module-catalogue.mdx (integrations gaps).