Refactoring

This commit is contained in:
Piotr Biernat
2024-12-06 16:44:42 +01:00
parent 2cf4d4c25d
commit 5a5f643be8
18 changed files with 62 additions and 66 deletions

20
basket/model/basket.go Normal file
View File

@@ -0,0 +1,20 @@
package basket
import (
"time"
)
type BasketModel struct {
State string `db:"state" json:"state"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at,omitempty"`
}
type BasketItemModel struct {
BasketID string `db:"basket_id" json:"basket_id"`
ProductID int `db:"product_id" json:"product_id"`
Quantity int `db:"quantity" json:"quantity"`
Price float64 `db:"price" json:"price"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at,omitempty"`
}