2 Commits

Author SHA1 Message Date
matst80
c8cd8bc745 fix outlet and articletype
All checks were successful
Build and Publish / BuildAndDeployAmd64 (push) Successful in 28s
Build and Publish / BuildAndDeploy (push) Successful in 2m23s
2024-11-14 20:52:28 +01:00
matst80
2852ab5bb4 update http requests 2024-11-14 20:49:59 +01:00
2 changed files with 25 additions and 17 deletions

View File

@@ -28,9 +28,15 @@ Content-Type: application/json
{ {
"provider": "postnord", "provider": "postnord",
"items": [ "items": []
{
"id": 1,
}
]
} }
### Get cart
GET https://cart.tornberg.me/api/12345
### Remove delivery method
DELETE https://cart.tornberg.me/api/12345/delivery/2

View File

@@ -47,7 +47,7 @@ type CartItem struct {
Disclaimer string `json:"disclaimer,omitempty"` Disclaimer string `json:"disclaimer,omitempty"`
ArticleType string `json:"type,omitempty"` ArticleType string `json:"type,omitempty"`
Image string `json:"image,omitempty"` Image string `json:"image,omitempty"`
Outlet string `json:"outlet,omitempty"` Outlet *string `json:"outlet,omitempty"`
} }
type CartDelivery struct { type CartDelivery struct {
@@ -272,6 +272,8 @@ func (c *CartGrain) HandleMessage(message *Message, isReplay bool) (*FrameWithPa
Stock: StockStatus(msg.Stock), Stock: StockStatus(msg.Stock),
Disclaimer: msg.Disclaimer, Disclaimer: msg.Disclaimer,
OrgPrice: msg.OrgPrice, OrgPrice: msg.OrgPrice,
ArticleType: msg.ArticleType,
Outlet: msg.Outlet,
Tax: tax, Tax: tax,
}) })
c.TotalPrice += msg.Price * int64(msg.Quantity) c.TotalPrice += msg.Price * int64(msg.Quantity)