Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,17 @@ wolt cart add huuva-food-court-niittykumpu 689efcc0dbe125482d2fecb2 \

When complete option metadata is available, unknown or ambiguous names fail
closed; use the displayed group/value ID to disambiguate. Required and
minimum/maximum selection counts are validated before the mutation, and
explicitly free option values remain distinct from values whose price metadata
is missing.
minimum/maximum selection counts, and the per-value limit, are validated before
the mutation, and explicitly free option values remain distinct from values
whose price metadata is missing.

A required group you leave out gets its default value, the one the Wolt app
preselects and `venue item` marks with `default: true`; the result lists it
under `default_options`. A required group without a default needs `--option`.
Optional groups stay empty unless you choose a value, even when Wolt names a
default for them. Some groups apply only after a value of another group is
chosen (`prerequisite_value_ids` in `venue item`); such a group is skipped
until then, and choosing a value in it before that is an error.

A restaurant dish names each option group by its own item-level ID and takes
the values from a shared library group; `venue menu --include-options` lists
Expand Down
11 changes: 8 additions & 3 deletions docs/mcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,14 @@ that could not be loaded.
> official Wolt app or web UI. `wolt_checkout_preview` is a pricing preview only.

`wolt_cart_add` always revalidates the exact item before mutating the basket;
caller-supplied display metadata cannot bypass an unavailable item. The tool
does not currently accept option selections, so it fails closed when an item
requires one instead of posting an invalid empty selection.
caller-supplied display metadata cannot bypass an unavailable item. It takes
option choices as `options: [{group_id, value_id, count?}]`, with the ids from
`wolt_venue_item` (names also work when unambiguous), and validates them the
same way as `wolt cart add --option`: limits per group and per value, unknown
values and groups that apply only after another choice. A required group left
out gets its default value, as in the Wolt app, and `default_options` in the
result lists each one applied; a required group without a default fails closed.
The line price includes the chosen option prices.
`wolt_checkout_preview` revalidates every basket item before sending the
preview request. Both operations fail closed if availability or venue
currency cannot be verified.
Expand Down
22 changes: 19 additions & 3 deletions docs/output-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -454,12 +454,25 @@ availability_verified, is_available, unavailable_reason, purchasable_balance
image_url, image_urls, image_blurhash
unit_info, unit_price, sell_by_weight_config
option_groups[]: {
group_id, name, required, min, max,
values[]: { value_id, name, price? }
group_id, library_group_id?, name, required, min, max,
prerequisite_value_ids[]?,
values[]: { value_id, name, price?, default? }
}
default_price?: { amount, currency, formatted_amount }
upsell_items[]
```

`group_id` is the dish's item-level group id, the one the basket stores;
`library_group_id` is the venue's shared option-library group it takes its
values from. `min` and `max` bound how many units the group takes in total, and
`required` is true when `min` is at least 1. `default: true` marks the value
the Wolt app preselects. A group with `prerequisite_value_ids` applies only
while one of those values (from another group of the dish) is selected.
`default_price` is the price with the default values of the required groups
that apply without any other choice, which is what the Wolt app shows for a
dish whose required group is paid. It is absent when the item has no option
groups or a required group has no default.

`price.formatted_amount` is normalized from venue metadata when upstream
omits the currency and the amount is known. Unknown amounts and their formatted
values remain `null`; they are never inferred as zero. `upsell_items[].price`
Expand Down Expand Up @@ -503,7 +516,8 @@ total_items: int
total: { amount, formatted_amount }

# Per mutation
add: basket_id, venue_id, line_id, item_name, item_price, item_currency
add: basket_id, venue_id, line_id, item_name, item_price, item_currency,
default_options[]?: { group_id, group_name?, value_id, value_name?, price }
remove: basket_id, venue_id, line_id, removed_count
clear: basket_ids[], cleared_baskets
```
Expand All @@ -512,6 +526,8 @@ Before `cart add`, the CLI always fetches the exact current item and refuses
the mutation when it is disabled, has zero purchasable balance, is missing
from the current assortment, or cannot be validated. Explicit `--price`,
`--currency`, and `--name` values do not bypass this check.
A required option group left without `--option` gets its default value, as the
Wolt app preselects it, and `default_options` lists each one applied.
The complete existing basket snapshot must also be reconstructable, including
every item, selected option, count, and price, because Wolt's mutation replaces
the full item array.
Expand Down
Loading
Loading