parent item mutations
Build and Publish / BuildAndDeployAmd64 (push) Failing after 5s
Build and Publish / BuildAndDeployArm64 (push) Failing after 7s

This commit is contained in:
2026-07-08 11:39:42 +02:00
parent e20793a6b3
commit 9f1eca07e9
14 changed files with 784 additions and 103 deletions
+10
View File
@@ -195,6 +195,16 @@ func cartGrainToResponse(id string, g *cart.CartGrain) CartResponse {
resp.Status = string(*g.CheckoutStatus)
}
// Per-line evaluation breakdown. The canonical promotion pipeline
// (pkg/promotions.PromotionService.EvaluateAndApply) populates this
// field on the grain itself after every successful mutation, so the
// conversion just reads g.EvaluatedItems verbatim — no recompute at
// response time. Same shape /promotions/evaluate-with-cart returns
// (both reference cart.EvaluatedItem and cart.MapEvaluatedItems),
// so a line verified via GET /ucp/v1/carts/{id} byte-matches the
// preview from /promotions/evaluate-with-cart.
resp.EvaluatedItems = g.EvaluatedItems
for _, it := range g.Items {
if it == nil {
continue