forked from ebhomengo/niki
38 lines
635 B
Go
38 lines
635 B
Go
package entity
|
|
|
|
import (
|
|
"git.gocasts.ir/ebhomengo/niki/types"
|
|
"time"
|
|
)
|
|
|
|
type CartStatus string
|
|
|
|
type Item struct {
|
|
ID types.ID
|
|
CartID types.ID
|
|
ProductID types.ID
|
|
UserID types.ID
|
|
Quantity int
|
|
Price float64
|
|
Name string
|
|
AddedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type Cart struct {
|
|
ID types.ID
|
|
UserID types.ID
|
|
Items []Item
|
|
Status CartStatus
|
|
TotalPrice float64
|
|
ExpireAt time.Time
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
const (
|
|
CartStatusActive CartStatus = "active"
|
|
CartStatusExpired CartStatus = "expired"
|
|
CartStatusCheckedOut CartStatus = "checked_out"
|
|
)
|