Add product features, Heleket crypto payments and order status icons.
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
type ProductSpec struct {
|
||||
Label string
|
||||
Value string
|
||||
}
|
||||
|
||||
func (p Product) Specs() []ProductSpec {
|
||||
var specs []ProductSpec
|
||||
if p.AttrBrand != "" {
|
||||
specs = append(specs, ProductSpec{"Бренд", p.AttrBrand})
|
||||
}
|
||||
if p.AttrSize != "" {
|
||||
specs = append(specs, ProductSpec{"Размер", p.AttrSize})
|
||||
}
|
||||
if p.AttrColor != "" {
|
||||
specs = append(specs, ProductSpec{"Цвет", p.AttrColor})
|
||||
}
|
||||
if p.AttrMaterial != "" {
|
||||
specs = append(specs, ProductSpec{"Материал", p.AttrMaterial})
|
||||
}
|
||||
if p.AttrWeight != "" {
|
||||
specs = append(specs, ProductSpec{"Вес", p.AttrWeight})
|
||||
}
|
||||
return specs
|
||||
}
|
||||
|
||||
type PriceHistoryEntry struct {
|
||||
ID int
|
||||
ProductID int
|
||||
Price float64
|
||||
SalePrice float64
|
||||
RecordedAt time.Time
|
||||
}
|
||||
|
||||
type Reservation struct {
|
||||
ID int
|
||||
ProductID int
|
||||
SessionKey string
|
||||
UserID *int
|
||||
CustomerName string
|
||||
CustomerPhone string
|
||||
ExpiresAt time.Time
|
||||
CreatedAt time.Time
|
||||
}
|
||||
Reference in New Issue
Block a user