api-entities/http/basket.go

40 lines
882 B
Go
Raw Normal View History

2022-12-18 20:51:26 +01:00
package http
2022-12-22 13:31:25 +01:00
import "time"
type GetBasketRequest struct {
BasketID string `json:"basket_id"`
}
type GetBasketResponse struct {
ID string `json:"id"`
State string `json:"state"`
CreatedAt time.Duration `json:"created_at"`
UpdatedAt time.Duration `json:"updated_at"`
2022-12-22 17:31:32 +01:00
Error string `json:"error"`
2022-12-22 13:31:25 +01:00
}
type GetBasketItemsRequest struct {
}
type GetBasketItemsResponse struct {
ID string `json:"id"`
BasketID string `json:"basket_id"`
ProductID int `json:"product_id"`
Quantity int `json:"quantity"`
Price float64 `json:"price"`
CreatedAt time.Duration `json:"created_at"`
UpdatedAt time.Duration `json:"updated_at"`
2022-12-22 17:33:58 +01:00
Error string `json:"error"`
2022-12-22 13:31:25 +01:00
}
2022-12-18 20:51:26 +01:00
type BasketCheckoutRequest struct {
BasketID string `json:"basket_id"`
}
type BasketCheckoutResponse struct {
ID string `json:"order_id"`
}