Documentation ¶
Index ¶
- func CategoriesListPgToEntity(c []*Category) []*entities.Category
- func ImagesListPgToEntity(images []Image) []*entities.Image
- func ManufacturersListPgToEntity(m []*Manufacturer) []*entities.Manufacturer
- func Migrate(db *gorm.DB) error
- func ProductPgToEntity(c *Product) *entities.Product
- func ProductsListPgToEntity(p []*Product) []*entities.Product
- type Base
- type Category
- type ConditionsGroup
- type Image
- type Manufacturer
- type Product
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ImagesListPgToEntity ¶
func ManufacturersListPgToEntity ¶
func ManufacturersListPgToEntity(m []*Manufacturer) []*entities.Manufacturer
func ProductPgToEntity ¶
func ProductsListPgToEntity ¶
Types ¶
type Category ¶
type Category struct { Base Name string Description string ParentID *string `gorm:"type:uuid"` Children []Category `gorm:"foreignkey:ParentID"` Products []*Product `gorm:"many2many:product_categories;"` Order int Image *Image `gorm:"polymorphic:Owner;"` }
func CategoryEntityToPg ¶
type ConditionsGroup ¶ added in v0.5.0
type ConditionsGroup struct {
// contains filtered or unexported fields
}
func NewConditionsGroup ¶ added in v0.5.0
func NewConditionsGroup(condition string, args ...any) *ConditionsGroup
func (*ConditionsGroup) AddANDCondition ¶ added in v0.5.0
func (g *ConditionsGroup) AddANDCondition(condition string, args ...any)
func (*ConditionsGroup) AddORCondition ¶ added in v0.5.0
func (g *ConditionsGroup) AddORCondition(condition string, args ...any)
func (*ConditionsGroup) GetGORMConds ¶ added in v0.5.0
func (g *ConditionsGroup) GetGORMConds() []any
type Image ¶
type Image struct { ID string `gorm:"type:uuid"` OwnerID string `gorm:"type:uuid"` OwnerType string Extension string // File extension Order int }
func ImageEntityToPg ¶
func ImagesListEntityToPg ¶
type Manufacturer ¶
type Manufacturer struct { Base Name string WebsiteURL string Image *Image `gorm:"polymorphic:Owner;"` }
func ManufacturerEntityToPg ¶
func ManufacturerEntityToPg(e *entities.Manufacturer) *Manufacturer
func (*Manufacturer) ToEntity ¶ added in v0.3.0
func (m *Manufacturer) ToEntity() *entities.Manufacturer
type Product ¶
type Product struct { Base Name string DescriptionShort string DescriptionLong string Price int Categories []Category `gorm:"many2many:product_categories;"` ManufacturerID *string `gorm:"type:uuid"` Status string StockCount int Images []Image `gorm:"polymorphic:Owner;"` }
func ProductEntityToPg ¶
Click to show internal directories.
Click to hide internal directories.