Create or append to a plan from an AI recommendation
Converts an AI recommendation (decision vector) into a concrete plan item in a single request. The caller provides the decision domain, variantId, and shopId from GET /api/intelligence/decision-vectors. The server resolves brandId, collectionId, and sizeId from the gold layer automatically. For the restock domain, a plan is auto-created when planId is omitted. For rebalance and markdown, an existing planId is required. All business-rule hooks and audit logging fire through the existing operations layer.
Authorizations
User session token issued by NextAuth. For human users accessing Solya via the web application.
Body
Decision domain driving the recommendation. 'restock' replenishes a shop from a supplier, 'rebalance' transfers stock between shops, 'markdown' marks down an item's price.
restock, rebalance, markdown Shop identifier as returned by GET /api/intelligence/decision-vectors. For restock this is the destination shop; for rebalance the source shop.
1Product variant identifier as returned by GET /api/intelligence/decision-vectors.
1Markdown discount percentage in the range [0, 100]. Required for the markdown domain; ignored for restock and rebalance.
0 <= x <= 100Existing plan to append the item to. Required for rebalance and markdown domains. For restock: when omitted a new plan is auto-created using the brand and collection resolved from the decision vector.
Number of units to restock or rebalance. Required for the restock and rebalance domains; ignored for markdown.
x <= 9007199254740991
