51 lines
733 B
Go
51 lines
733 B
Go
package models
|
|
|
|
import "time"
|
|
|
|
type User struct {
|
|
ID int
|
|
Email string
|
|
Name string
|
|
Phone string
|
|
Address string
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
type Cart struct {
|
|
ID int
|
|
UserID *int
|
|
SessionKey string
|
|
Items []CartItem
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type CartItem struct {
|
|
ID int
|
|
CartID int
|
|
ProductID int
|
|
Quantity int
|
|
Product Product
|
|
}
|
|
|
|
type Order struct {
|
|
ID int
|
|
UserID *int
|
|
GuestName string
|
|
GuestEmail string
|
|
GuestPhone string
|
|
Address string
|
|
Total float64
|
|
Status string
|
|
CreatedAt time.Time
|
|
Items []OrderItem
|
|
}
|
|
|
|
type OrderItem struct {
|
|
ID int
|
|
OrderID int
|
|
ProductID int
|
|
ProductName string
|
|
Price float64
|
|
Quantity int
|
|
}
|