fix(order): carry item weight through the contract-to-model transformer
CreateOrderContractToModel and AddToOrderContractToModel copied every order item field except Weight, so a weight sent by the client never reached the processor and every weight-based line failed with "product ... is sold by weight and requires a weight". Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -17,6 +17,7 @@ func CreateOrderContractToModel(req *contract.CreateOrderRequest) *models.Create
|
||||
ProductID: item.ProductID,
|
||||
ProductVariantID: item.ProductVariantID,
|
||||
Quantity: item.Quantity,
|
||||
Weight: item.Weight,
|
||||
UnitPrice: item.UnitPrice, // Now optional
|
||||
Modifiers: item.Modifiers,
|
||||
Notes: item.Notes,
|
||||
@@ -58,6 +59,7 @@ func AddToOrderContractToModel(req *contract.AddToOrderRequest) *models.AddToOrd
|
||||
ProductID: item.ProductID,
|
||||
ProductVariantID: item.ProductVariantID,
|
||||
Quantity: item.Quantity,
|
||||
Weight: item.Weight,
|
||||
UnitPrice: item.UnitPrice, // Now optional
|
||||
Modifiers: item.Modifiers,
|
||||
Notes: item.Notes,
|
||||
|
||||
Reference in New Issue
Block a user