type Order struct {
ID int `json:"id"`
UserID int `json:"userID"`
Total float64 `json:"total"`
Status string `json:"status"`
Address string `json:"address"`
CreatedAt time.Time `json:"createdAt"`
}
type OrderItem struct {
ID int `json:"id"`
OrderID int `json:"orderID"`
ProductID int `json:"productID"`
Quantity int `json:"quantity"`
Price float64 `json:"price"`
CreatedAt time.Time `json:"createdAt"`
}
type Product struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Image string `json:"image"`
Price float64 `json:"price"`
// note that this isn't the best way to handle quantity// because it's not atomic (in ACID), but it's good enough for this example Quantity int `json:"quantity"`
CreatedAt time.Time `json:"createdAt"`
}