Files
shop-go/internal/models/user.go
T

60 lines
1.0 KiB
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
PaymentMethod string
HeleketUUID string
HeleketOrderID string
HeleketPaymentURL string
HeleketPaymentStatus string
CreatedAt time.Time
Items []OrderItem
}
func (o Order) IsHeleket() bool {
return o.PaymentMethod == "heleket"
}
type OrderItem struct {
ID int
OrderID int
ProductID int
ProductName string
Price float64
Quantity int
}