feat: add negotiated fulfillment location context - #671
Conversation
Store-scoped Catalog results had no advertised way to preserve the Business location through Cart and into Checkout. Defining the field on base Context would make every Shopping implementation accept an opaque Business-scoped identifier without advertising the behavior that produces or consumes it. Have Fulfillment contribute `context.location` to Catalog requests, Cart, and Checkout through explicit parent composition. Cart receives only the location context, and implementations supporting both Catalog and Cart should extend both to preserve continuity. For example, `loc_123` can scope Catalog availability, continue through Cart, and become explicit only when selected as a Checkout destination. Introduce a shared Location Identifier and reuse it for Fulfillment context, Catalog method locations, destination filters, and retail locations. This preserves one identity across surfaces while each containing field defines its role. Keep `selected_destination_id` generic because it may also reference non-location destinations.
|
Thanks @igrigorik! Adding a general thought for further discussion here: While I agree that we should have a unified way of representing the explicit Location identifier when it comes to binding-contracts with respect to fulfillment (examples 2, 3, 4 in the table above), I'm wondering if grouping An example:
|
|
Thanks @igrigorik — this answers the concern I raised on #642, where I'd pushed on On @jingyli's point about So the narrow question: does an opaque location ID add provisional value beyond the coarse |
This PR supersedes #642, which identified the need to preserve the Business location behind store-scoped Catalog results through Cart and Checkout. Instead of adding #642's raw
locationfield to base Context, this PR makes support explicit through Fulfillment.context.locationto Fulfillment's Catalog, Cart, and Checkout projections;Adding a Business-defined location ID to base Context would define its syntax without advertising which Businesses recognize it, which operations consume it, or what behavior it affects. Fulfillment owns the relevant surfaces: Catalog methods report resolved locations, Catalog filters name destinations, and Checkout exposes destinations and selections. Contributing
context.locationthrough Fulfillment lets parties negotiate each parent capability withextends.Contract
The same Location Identifier can appear in several fields without giving them the same meaning:
context.locationfilters.fulfills_tovariants[].fulfillment.methods[].locationcontext.location.Journey example...
The new
common/types/location_id.jsonreuses the existing string wire type across Fulfillment context, Catalog method locations, destination filters, and retail locations. Within one Business, the same value identifies the same location; its containing field determines its role.selected_destination_idstays generic because it can select other destination types.Checklist
!for breaking changes).