Documentation ¶
Index ¶
Constants ¶
View Source
const IngredientTable = "ingredients"
View Source
const ProductIngredientTable = "products_ingredients"
View Source
const ProductSourcingValueTable = "products_sourcing_values"
View Source
const ProductTable = "products"
View Source
const SourcingValueTable = "sourcing_values"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ingredient ¶
type Ingredient struct { ID int `gorm:"primary_key" json:"ingredient_id"` Name string `gorm:"not null" json:"name"` }
func (Ingredient) TableName ¶
func (Ingredient) TableName() string
type Product ¶
type Product struct { ID string `gorm:"primary_key" json:"product_id"` Name string `gorm:"not null" json:"name"` ImageOpen string `json:"image_open"` ImageClosed string `json:"image_closed"` Description string `json:"description"` Story string `gorm:"not null" json:"story"` AllergyInfo string `json:"allergy_info"` DietaryCertifications string `json:"dietary_certifications"` SourcingValues []SourcingValue `gorm:"many2many:products_sourcing_values" json:"sourcing_values"` Ingredients []Ingredient `gorm:"many2many:products_ingredients" json:"ingredients"` }
func (Product) ToModel ¶
func (p Product) ToModel() view_models.ProductModel
type ProductIngredient ¶
type ProductIngredient struct { ProductID string `gorm:"primary_key" json:"product_id"` IngredientID int `gorm:"primary_key" json:"ingredient_id"` }
func (ProductIngredient) TableName ¶
func (ProductIngredient) TableName() string
type ProductSourcingValue ¶
type ProductSourcingValue struct { ProductID string `gorm:"primary_key" json:"product_id"` SourcingValueID int `gorm:"primary_key" json:"sourcing_value_id"` }
func (ProductSourcingValue) TableName ¶
func (ProductSourcingValue) TableName() string
type SourcingValue ¶
type SourcingValue struct { ID int `gorm:"primary_key" json:"id"` Name string `gorm:"not null" json:"name"` }
func (SourcingValue) TableName ¶
func (SourcingValue) TableName() string
Click to show internal directories.
Click to hide internal directories.