feat!: Support fractional quantities and location context for grocery shopping use cases #597
feat!: Support fractional quantities and location context for grocery shopping use cases #597jingyli wants to merge 1 commit into
Conversation
…rovide location hints in request context.
jamesandersen
left a comment
There was a problem hiding this comment.
Thanks @jingyli for introducing a formal measurement type to reuse across UCP. I left a couple comments inline for some things I've encountered working in this domain in the past.
| "value": { "type": "number", "description": "Package quantity." }, | ||
| "unit": { "type": "string", "description": "Unit of measurement." } | ||
| } | ||
| "$ref": "../../common/types/measure.json", |
There was a problem hiding this comment.
Do we need to make this an array of saleable units to support the grocery use case? e.g. with a wide variety of units a business may offer multiple units e.g. "bags" and "ounces" of black beans?
| "items": { | ||
| "type": "string" | ||
| }, | ||
| "description": "Variant tags for categorization and search." |
There was a problem hiding this comment.
With the grocery use case in mind there are some key product/variant metadata that users need to be aware of during consideration because they have implications for payment and/or fulfillment e.g.
- SNAP EBT eligibility - the item qualifies for use of an EBT payment method
- Firearm Owners ID verification required, etc. - The ID must be shown to pickup items. (NOTE: while it seems strange to mention this in the context of grocery, many large grocery stores in the US at least have large sporting goods sections as well)
This may be belong in a separate PR but - in the interest of platforms / businesses mutually understanding some of these concepts I'm wondering if a schema of domain specific standard tags for these types of consequential concepts makes sense.
Minimally, if we intend for either tags or metadata to be use to carry these types of attributes would we want to tweak the descriptions?
| "type": "object", | ||
| "additionalProperties": true, | ||
| "properties": { | ||
| "location": { |
There was a problem hiding this comment.
Should we call this retail_location to match the fulfillment extension? (and avoid confusion with "locality")
| "quantity", | ||
| "totals" | ||
| ], | ||
| "properties": { |
There was a problem hiding this comment.
For the grocery use case I think we'll need a line-item level note field. Some examples:
Simple Guidance
- "Make sure the bananas are green"
- "Find the ripest mango - I'll need it next week"
Substitution guidance that, during fulfillment, could be captured in the order adjustments:
- "Substitute with non-organic if organic isn't available" ... or "Don't substitute"
- "Substitute with the store brand if this brand isn't available"
- "Get two dozen medium eggs if large aren't available"
Description
Addressing 2 gaps that would extend existing UCP shopping service schema/capabilities to support hyper-local goods (i.e. grocery) use cases:
quantityrepresentation is rigid and can only express countable goods.Key Design Decisions
1. Unified
anyOfUnion forquantity1.5 lbs) while maintaining integer support for standard items.quantityproperty to be ananyOfunion of a standard integer and a$refto a new sharedcommon/types/measure.jsonobject. An example of the modification inline_item.json:2. Standardized
locationField incontext.jsonlocationstring property directly tocontext.json. This also allows the hint to be overwritten by more authoritative data constructs likefilters.fulfills_toincatalog_searchandfulfillmentextension's pickup location ID.Category (Required)
Please select one or more categories that apply to this change.
ucp-schematool (resolver, linter, validator). (Requires Maintainer approval)Checklist
!for breaking changes).Screenshots / Logs (if applicable)