Compare commits

...

4 Commits

Author SHA1 Message Date
edd980f4c1 basket update 2022-12-22 23:01:11 +01:00
2e64d106aa basket update 2022-12-22 20:59:47 +01:00
cb2e0ac34e models update 2022-12-22 20:49:12 +01:00
735f2d668c basket update 2022-12-22 17:38:52 +01:00
4 changed files with 8 additions and 12 deletions

View File

@@ -10,9 +10,7 @@ type GetBasketResponse struct {
ID string `json:"id"` ID string `json:"id"`
State string `json:"state"` State string `json:"state"`
CreatedAt time.Duration `json:"created_at"` CreatedAt time.Duration `json:"created_at"`
UpdatedAt time.Duration `json:"updated_at"` UpdatedAt time.Duration `json:"updated_at,omitempty"`
Error string `json:"error"`
} }
type GetBasketItemsRequest struct { type GetBasketItemsRequest struct {
@@ -25,9 +23,7 @@ type GetBasketItemsResponse struct {
Quantity int `json:"quantity"` Quantity int `json:"quantity"`
Price float64 `json:"price"` Price float64 `json:"price"`
CreatedAt time.Duration `json:"created_at"` CreatedAt time.Duration `json:"created_at"`
UpdatedAt time.Duration `json:"updated_at"` UpdatedAt time.Duration `json:"updated_at,omitempty"`
Error string `json:"error"`
} }
type BasketCheckoutRequest struct { type BasketCheckoutRequest struct {
@@ -35,5 +31,5 @@ type BasketCheckoutRequest struct {
} }
type BasketCheckoutResponse struct { type BasketCheckoutResponse struct {
ID string `json:"order_id"` ID string `json:"basket_id"`
} }

View File

@@ -8,7 +8,7 @@ type BasketModel struct {
ID string `db:"id" json:"id"` ID string `db:"id" json:"id"`
State string `db:"state" json:"state"` State string `db:"state" json:"state"`
CreatedAt pgtype.Timestamp `db:"created_at" json:"created_at"` CreatedAt pgtype.Timestamp `db:"created_at" json:"created_at"`
UpdatedAt pgtype.Timestamp `db:"updated_at" json:"updated_at"` UpdatedAt pgtype.Timestamp `db:"updated_at" json:"updated_at,omitempty"`
} }
type BasketItemModel struct { type BasketItemModel struct {
@@ -18,5 +18,5 @@ type BasketItemModel struct {
Quantity int `db:"quantity" json:"quantity"` Quantity int `db:"quantity" json:"quantity"`
Price float64 `db:"price" json:"price"` Price float64 `db:"price" json:"price"`
CreatedAt pgtype.Timestamp `db:"created_at" json:"created_at"` CreatedAt pgtype.Timestamp `db:"created_at" json:"created_at"`
UpdatedAt pgtype.Timestamp `db:"updated_at" json:"updated_at"` UpdatedAt pgtype.Timestamp `db:"updated_at" json:"updated_at,omitempty"`
} }

View File

@@ -8,5 +8,5 @@ type ProductModel struct {
Name string `db:"name"` Name string `db:"name"`
Price float64 `db:"price"` Price float64 `db:"price"`
CreatedAt pgtype.Timestamp `db:"created_at"` CreatedAt pgtype.Timestamp `db:"created_at"`
UpdatedAt pgtype.Timestamp `db:"updated_at"` UpdatedAt pgtype.Timestamp `db:"updated_at,omitempty"`
} }

View File

@@ -6,7 +6,7 @@ type OrderModel struct {
ID string `db:"id" json:"id"` ID string `db:"id" json:"id"`
State string `db:"state" json:"state"` State string `db:"state" json:"state"`
CreatedAt pgtype.Timestamp `db:"created_at" json:"created_at"` CreatedAt pgtype.Timestamp `db:"created_at" json:"created_at"`
UpdatedAt pgtype.Timestamp `db:"updated_at" json:"updated_at"` UpdatedAt pgtype.Timestamp `db:"updated_at" json:"updated_at,omitempty"`
} }
type OrderItemModel struct { type OrderItemModel struct {
@@ -16,5 +16,5 @@ type OrderItemModel struct {
Quantity int `db:"quantity" json:"quantity"` Quantity int `db:"quantity" json:"quantity"`
Price float64 `db:"price" json:"price"` Price float64 `db:"price" json:"price"`
CreatedAt pgtype.Timestamp `db:"created_at" json:"created_at"` CreatedAt pgtype.Timestamp `db:"created_at" json:"created_at"`
UpdatedAt pgtype.Timestamp `db:"updated_at" json:"updated_at"` UpdatedAt pgtype.Timestamp `db:"updated_at" json:"updated_at,omitempty"`
} }