{"name":"site_upsells","title":"Настроить сопутствующие предложения","section":"Каталог, заказы и оплата","mode":"write","url":"/tools/site_upsells","blurb":"Управляет правилами рекомендаций дополнительных товаров и услуг в корзине и записи.","aliases":"","kind":"Инструмент","examples":[{"label":"Рабочая задача","prompt":"Для услуги «Стрижка» подготовь предложение добавить уход. Сопоставь услуги с реальными ID и покажи условие показа.","check":"Управляет правилами рекомендаций дополнительных товаров и услуг в корзине и записи."},{"label":"Выбрать режим","prompt":"Для задачи «Настроить сопутствующие предложения» сравни режимы contract и status инструмента site_upsells. Какой подойдёт в моём случае и какие данные нужно подготовить?","check":"Сопоставить два режима и их аргументы."},{"label":"После сбоя","prompt":"При выполнении «Настроить сопутствующие предложения» связь прервалась после отправки. Для site_upsells проверь исходный ключ операции и текущее состояние объекта перед решением о повторе.","check":"Сопоставить результат с исходной операцией."}],"inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"operation":{"type":"string","const":"contract"},"siteId":{"type":"string","pattern":"^[A-Za-z0-9_~:@+.-]{1,128}$"}},"required":["operation","siteId"],"additionalProperties":false},{"type":"object","properties":{"operation":{"type":"string","const":"status"},"siteId":{"type":"string","pattern":"^[A-Za-z0-9_~:@+.-]{1,128}$"}},"required":["operation","siteId"],"additionalProperties":false},{"type":"object","properties":{"operation":{"type":"string","const":"configure"},"siteId":{"type":"string","pattern":"^[A-Za-z0-9_~:@+.-]{1,128}$"},"enabled":{"type":"boolean"},"rules":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_~:@+.-]{1,128}$"},"triggerProductIds":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_~:@+.-]{1,128}$"}},"offer":{"type":"object","properties":{"productId":{"type":"string","pattern":"^[A-Za-z0-9_~:@+.-]{1,128}$"},"quantity":{"type":"number","exclusiveMinimum":0,"maximum":10000},"customization":{"type":"object","properties":{"revision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"choices":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,39}$"},"additionalProperties":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,39}$"}},"text":{"default":{},"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,39}$"},"additionalProperties":{"type":"string","maxLength":80,"pattern":"^[^<>\\x00-\\x1f\\x7f]*$"}}},"required":["revision","choices","text"],"additionalProperties":false},"modifiers":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"optionSetId":{"type":"string","pattern":"^[A-Za-z0-9_~:@+.-]{1,128}$"},"productIds":{"maxItems":30,"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_~:@+.-]{1,128}$"}},"quantities":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z0-9_~:@+.-]{1,128}$"},"additionalProperties":{"type":"integer","minimum":1,"maximum":1000}}},"required":["optionSetId","productIds"],"additionalProperties":false}},"numericAnswers":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"optionSetId":{"type":"string","pattern":"^[A-Za-z0-9_~:@+.-]{1,128}$"},"productId":{"type":"string","pattern":"^[A-Za-z0-9_~:@+.-]{1,128}$"},"value":{"type":"number","minimum":0,"maximum":100000}},"required":["optionSetId","productId","value"],"additionalProperties":false}},"snapshot":{"default":{},"type":"object","properties":{"price":{"type":"number","minimum":0}},"additionalProperties":false}},"required":["productId","quantity","modifiers","snapshot"],"additionalProperties":false},"title":{"type":"string","minLength":1,"maxLength":120},"placements":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","enum":["product","cart","booking"]}},"enabled":{"default":true,"type":"boolean"}},"required":["id","triggerProductIds","offer","title","placements","enabled"],"additionalProperties":false}},"expectedRevision":{"type":"integer","minimum":0,"maximum":9007199254740991},"idempotencyKey":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,128}$"}},"required":["operation","siteId","enabled","rules","expectedRevision","idempotencyKey"],"additionalProperties":false},{"type":"object","properties":{"operation":{"type":"string","const":"stats"},"siteId":{"type":"string","pattern":"^[A-Za-z0-9_~:@+.-]{1,128}$"}},"required":["operation","siteId"],"additionalProperties":false}]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/$defs/__schema0"},"$defs":{"__schema0":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/$defs/__schema0"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/$defs/__schema0"}}]}}},"argumentExample":{"operation":"contract","siteId":"site_demo"}}