79 lines
3.6 KiB
Go
79 lines
3.6 KiB
Go
|
|
package model
|
||
|
|
|
||
|
|
type Product struct {
|
||
|
|
Brand string `json:"brand"`
|
||
|
|
GroupName string `json:"group_name"`
|
||
|
|
SKU string `json:"sku"`
|
||
|
|
SeriesName string `json:"series_name"`
|
||
|
|
StyleName string `json:"style_name"`
|
||
|
|
Category string `json:"category"`
|
||
|
|
Material string `json:"material"`
|
||
|
|
ColorTone string `json:"color_tone"`
|
||
|
|
Finish string `json:"finish"`
|
||
|
|
PricePerSqft float64 `json:"price_per_sqft"`
|
||
|
|
PriceTier string `json:"price_tier"`
|
||
|
|
PriceSource string `json:"price_source"`
|
||
|
|
IsOfficialPrice bool `json:"is_official_price"`
|
||
|
|
MainImageURL string `json:"main_image_url"`
|
||
|
|
RoomImageURL string `json:"room_image_url"`
|
||
|
|
SourceURL string `json:"source_url"`
|
||
|
|
Description string `json:"description"`
|
||
|
|
Status string `json:"status"`
|
||
|
|
CoverageSqftPerBox float64 `json:"coverage_sqft_per_box"`
|
||
|
|
WoodSpecies string `json:"wood_species"`
|
||
|
|
SizeLabel string `json:"size_label"`
|
||
|
|
WidthIn float64 `json:"width_in"`
|
||
|
|
LengthIn float64 `json:"length_in"`
|
||
|
|
AllImages []string `json:"all_images,omitempty"`
|
||
|
|
Variants []Product `json:"variants,omitempty"`
|
||
|
|
Specs []ProductSpec `json:"specs,omitempty"`
|
||
|
|
}
|
||
|
|
|
||
|
|
type ProductSpec struct {
|
||
|
|
SKU string `json:"sku"`
|
||
|
|
SizeLabel string `json:"size_label"`
|
||
|
|
WidthIn float64 `json:"width_in"`
|
||
|
|
LengthIn float64 `json:"length_in"`
|
||
|
|
Finish string `json:"finish"`
|
||
|
|
PricePerSqft float64 `json:"price_per_sqft"`
|
||
|
|
PriceTier string `json:"price_tier"`
|
||
|
|
CoverageSqftPerBox float64 `json:"coverage_sqft_per_box"`
|
||
|
|
MainImageURL string `json:"main_image_url"`
|
||
|
|
}
|
||
|
|
|
||
|
|
type ProductSnapshot struct {
|
||
|
|
Brand string `json:"brand"`
|
||
|
|
GroupName string `json:"group_name,omitempty"`
|
||
|
|
SKU string `json:"sku"`
|
||
|
|
SeriesName string `json:"series_name,omitempty"`
|
||
|
|
StyleName string `json:"style_name,omitempty"`
|
||
|
|
Category string `json:"category,omitempty"`
|
||
|
|
Material string `json:"material,omitempty"`
|
||
|
|
ColorTone string `json:"color_tone,omitempty"`
|
||
|
|
Finish string `json:"finish,omitempty"`
|
||
|
|
PricePerSqft float64 `json:"price_per_sqft,omitempty"`
|
||
|
|
PriceTier string `json:"price_tier,omitempty"`
|
||
|
|
MainImageURL string `json:"main_image_url,omitempty"`
|
||
|
|
RoomImageURL string `json:"room_image_url,omitempty"`
|
||
|
|
SourceURL string `json:"source_url,omitempty"`
|
||
|
|
Description string `json:"description,omitempty"`
|
||
|
|
CoverageSqftPerBox float64 `json:"coverage_sqft_per_box,omitempty"`
|
||
|
|
WoodSpecies string `json:"wood_species,omitempty"`
|
||
|
|
SizeLabel string `json:"size_label,omitempty"`
|
||
|
|
WidthIn float64 `json:"width_in,omitempty"`
|
||
|
|
LengthIn float64 `json:"length_in,omitempty"`
|
||
|
|
}
|
||
|
|
|
||
|
|
func NewProductSnapshot(p Product) ProductSnapshot {
|
||
|
|
return ProductSnapshot{
|
||
|
|
Brand: p.Brand, GroupName: p.GroupName, SKU: p.SKU,
|
||
|
|
SeriesName: p.SeriesName, StyleName: p.StyleName,
|
||
|
|
Category: p.Category, Material: p.Material, ColorTone: p.ColorTone,
|
||
|
|
Finish: p.Finish, PricePerSqft: p.PricePerSqft, PriceTier: p.PriceTier,
|
||
|
|
MainImageURL: p.MainImageURL, RoomImageURL: p.RoomImageURL,
|
||
|
|
SourceURL: p.SourceURL, Description: p.Description,
|
||
|
|
CoverageSqftPerBox: p.CoverageSqftPerBox, WoodSpecies: p.WoodSpecies,
|
||
|
|
SizeLabel: p.SizeLabel, WidthIn: p.WidthIn, LengthIn: p.LengthIn,
|
||
|
|
}
|
||
|
|
}
|