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
+13 -1
View File
@@ -161,7 +161,19 @@ type CartGrain struct {
Items []*CartItem `json:"items"`
TotalPrice *Price `json:"totalPrice"`
TotalDiscount *Price `json:"totalDiscount"`
Processing bool `json:"processing"`
// EvaluatedItems is the per-line promotion breakdown — see
// EvaluatedItem for shape and semantics. Populated by the canonical
// promotion pipeline (pkg/promotions.PromotionService.EvaluateAndApply)
// after every successful mutation, alongside TotalDiscount and
// AppliedPromotions, so any consumer of the grain (UCP cart response,
// legacy /cart HTTP handler, cart-mcp, AMQP mutation feed) sees the
// per-line discount/effective totals without re-running the engine at
// response time. Mirrors the same shape /promotions/evaluate-with-cart
// has returned since the breakdown feature was introduced; deliberately
// persisted via the event-log JSON block so we don't have to re-derive
// it on every read path (same precedent as TotalPrice/TotalDiscount).
EvaluatedItems []EvaluatedItem `json:"evaluatedItems,omitempty"`
Processing bool `json:"processing"`
//PaymentInProgress uint16 `json:"paymentInProgress"`
OrderReference string `json:"orderReference,omitempty"`