From cb2e0ac34e76b1ce6c0b2323faebf0740e2651c7 Mon Sep 17 00:00:00 2001 From: Piotr Biernat Date: Thu, 22 Dec 2022 20:49:12 +0100 Subject: [PATCH] models update --- model/basket.go | 4 ++-- model/catalog.go | 2 +- model/order.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/model/basket.go b/model/basket.go index 3161c4e..766b646 100644 --- a/model/basket.go +++ b/model/basket.go @@ -8,7 +8,7 @@ type BasketModel struct { ID string `db:"id" json:"id"` State string `db:"state" json:"state"` 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 { @@ -18,5 +18,5 @@ type BasketItemModel struct { Quantity int `db:"quantity" json:"quantity"` Price float64 `db:"price" json:"price"` 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"` } diff --git a/model/catalog.go b/model/catalog.go index ce74a43..cc8f4b9 100644 --- a/model/catalog.go +++ b/model/catalog.go @@ -8,5 +8,5 @@ type ProductModel struct { Name string `db:"name"` Price float64 `db:"price"` CreatedAt pgtype.Timestamp `db:"created_at"` - UpdatedAt pgtype.Timestamp `db:"updated_at"` + UpdatedAt pgtype.Timestamp `db:"updated_at,omitempty"` } diff --git a/model/order.go b/model/order.go index 73dab4b..042ea97 100644 --- a/model/order.go +++ b/model/order.go @@ -6,7 +6,7 @@ type OrderModel struct { ID string `db:"id" json:"id"` State string `db:"state" json:"state"` 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 { @@ -16,5 +16,5 @@ type OrderItemModel struct { Quantity int `db:"quantity" json:"quantity"` Price float64 `db:"price" json:"price"` 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"` }