Add product features, Heleket crypto payments and order status icons.

This commit is contained in:
shop
2026-06-27 16:29:33 +03:00
parent 361d35e6b4
commit 98a0bb01e2
31 changed files with 1673 additions and 126 deletions
+47
View File
@@ -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
}