models

package
v0.0.0-...-993f9dd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2024 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Product

type Product struct {
	core.BaseModel
	Title         string            `gorm:"column:title;type:text;not null" json:"title"`
	Handle        string            `gorm:"column:handle;type:text;not null;uniqueIndex:IDX_product_handle_unique,priority:1" json:"handle"`
	Subtitle      string            `gorm:"column:subtitle;type:text" json:"subtitle"`
	Description   string            `gorm:"column:description;type:text" json:"description"`
	IsGiftcard    bool              `gorm:"column:is_giftcard;type:boolean;not null" json:"is_giftcard"`
	Status        string            `gorm:"column:status;type:text;not null" json:"status"`
	Thumbnail     string            `gorm:"column:thumbnail;type:text" json:"thumbnail"`
	Options       []ProductOption   `gorm:"foreignKey:ProductID" json:"options"`
	Variants      []ProductVariant  `gorm:"foreignKey:ProductID" json:"variants"`
	Weight        string            `gorm:"column:weight;type:text" json:"weight"`
	Length        string            `gorm:"column:length;type:text" json:"length"`
	Height        string            `gorm:"column:height;type:text" json:"height"`
	Width         string            `gorm:"column:width;type:text" json:"width"`
	OriginCountry string            `gorm:"column:origin_country;type:text" json:"origin_country"`
	HsCode        string            `gorm:"column:hs_code;type:text" json:"hs_code"`
	MidCode       string            `gorm:"column:mid_code;type:text" json:"mid_code"`
	Material      string            `gorm:"column:material;type:text" json:"material"`
	CollectionId  string            `gorm:"column:collection_id;type:text" json:"collection_id"`
	Collection    ProductCollection `gorm:"foreignKey:CollectionId" json:"collection"`
	TypeId        string            `gorm:"column:type_id;type:text;index:IDX_product_type_id,priority:1" json:"type_id"`
	Type          ProductType       `gorm:"foreignKey:TypeId" json:"type"`
	Tags          []ProductTag      `gorm:"many2many:product_tags;" json:"tags"`
	Images        []ProductImage    `gorm:"many2many:product_images;" json:"images"`
	Categories    []ProductCategory `gorm:"many2many:product_category_product;" json:"categories"`
	Discountable  bool              `gorm:"column:discountable;type:boolean;not null;default:true" json:"discountable"`
	ExternalId    string            `gorm:"column:external_id;type:text" json:"external_id"`
	DeletedAt     gorm.DeletedAt    `gorm:"column:deleted_at;type:timestamp with time zone;index:IDX_product_deleted_at,priority:1" json:"deleted_at"`
}

func (*Product) TableName

func (*Product) TableName() string

type ProductCategory

type ProductCategory struct {
	core.BaseModel

	Name             string            `gorm:"column:name;type:text;not null" json:"name"`
	Description      string            `gorm:"column:description;type:text;not null" json:"description"`
	Handle           string            `gorm:"column:handle;type:text;not null;uniqueIndex:IDX_product_category_handle,priority:1" json:"handle"`
	Mpath            string            `gorm:"column:mpath;type:text;not null;index:IDX_product_category_path,priority:1" json:"mpath"`
	IsActive         bool              `gorm:"column:is_active;type:boolean;not null" json:"is_active"`
	IsInternal       bool              `gorm:"column:is_internal;type:boolean;not null" json:"is_internal"`
	Rank             float64           `gorm:"column:rank;type:numeric;not null" json:"rank"`
	ParentCategoryId string            `gorm:"column:parent_category_id;type:text" json:"parent_category_id"`
	ParentCategory   *ProductCategory  `gorm:"foreignKey:ParentCategoryId" json:"parent_category"`
	CategoryChildren []ProductCategory `gorm:"foreignKey:ParentCategoryId" json:"category_children"`
	Products         []Product         `gorm:"many2many:product_categories;" json:"products"`
}

func (*ProductCategory) TableName

func (*ProductCategory) TableName() string

type ProductCollection

type ProductCollection struct {
	core.BaseModel

	Title     string         `gorm:"column:title;type:text;not null" json:"title"`
	Handle    string         `gorm:"column:handle;type:text;not null;uniqueIndex:IDX_product_collection_handle_unique,priority:1" json:"handle"`
	Products  []Product      `gorm:"foreignKey:CollectionId" json:"products"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:timestamp with time zone;index:IDX_product_collection_deleted_at,priority:1" json:"deleted_at"`
}

func (*ProductCollection) TableName

func (*ProductCollection) TableName() string

type ProductImage

type ProductImage struct {
	core.BaseModel

	ID        string         `gorm:"column:id;type:text;primaryKey" json:"id"`
	URL       string         `gorm:"column:url;type:text;not null;index:IDX_product_image_url,priority:1" json:"url"`
	Products  []Product      `gorm:"many2many:product_images;" json:"products"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:timestamp with time zone;index:IDX_product_image_deleted_at,priority:1" json:"deleted_at"`
}

func (*ProductImage) TableName

func (*ProductImage) TableName() string

type ProductOption

type ProductOption struct {
	core.BaseModel

	Title     string               `gorm:"column:title;type:text;not null" json:"title"`
	ProductId string               `gorm:"column:product_id;type:text;not null;index:IDX_product_option_product_id,priority:1" json:"product_id"`
	Product   *Product             `gorm:"foreignKey:ProductId" json:"product"`
	Values    []ProductOptionValue `gorm:"foreignKey:OptionId" json:"values"`
	DeletedAt gorm.DeletedAt       `gorm:"column:deleted_at;type:timestamp with time zone;index:IDX_product_option_deleted_at,priority:1" json:"deleted_at"`
}

func (*ProductOption) TableName

func (*ProductOption) TableName() string

type ProductOptionValue

type ProductOptionValue struct {
	core.BaseModel

	Value     string          `gorm:"column:value;type:text;not null" json:"value"`
	OptionId  string          `gorm:"column:option_id;type:text;not null;index:IDX_product_option_value_option_id,priority:1" json:"option_id"`
	Option    *ProductOption  `gorm:"foreignKey:OptionId" json:"option"`
	VariantId string          `gorm:"column:variant_id;type:text;not null;index:IDX_product_option_value_variant_id,priority:1" json:"variant_id"`
	Variant   *ProductVariant `gorm:"foreignKey:VariantId" json:"variant"`
	DeletedAt gorm.DeletedAt  `gorm:"column:deleted_at;type:timestamp with time zone;index:IDX_product_option_value_deleted_at,priority:1" json:"deleted_at"`
}

func (*ProductOptionValue) TableName

func (*ProductOptionValue) TableName() string

type ProductTag

type ProductTag struct {
	core.BaseModel

	Value     string         `gorm:"column:value;type:text;not null" json:"value"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:timestamp with time zone;index:IDX_product_tag_deleted_at,priority:1" json:"deleted_at"`
	Products  []Product      `gorm:"many2many:product_tags;" json:"products"`
}

func (*ProductTag) TableName

func (*ProductTag) TableName() string

type ProductType

type ProductType struct {
	core.BaseModel

	Value     string         `gorm:"column:value;type:text;not null" json:"value"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:timestamp with time zone;index:IDX_product_type_deleted_at,priority:1" json:"deleted_at"`
}

func (*ProductType) TableName

func (*ProductType) TableName() string

type ProductVariant

type ProductVariant struct {
	core.BaseModel

	Title             string               `gorm:"column:title;type:text;not null" json:"title"`
	Sku               string               `gorm:"column:sku;type:text;uniqueIndex:IDX_product_variant_sku_unique,priority:1" json:"sku"`
	Barcode           string               `gorm:"column:barcode;type:text;uniqueIndex:IDX_product_variant_barcode_unique,priority:1" json:"barcode"`
	Ean               string               `gorm:"column:ean;type:text;uniqueIndex:IDX_product_variant_ean_unique,priority:1" json:"ean"`
	Upc               string               `gorm:"column:upc;type:text;uniqueIndex:IDX_product_variant_upc_unique,priority:1" json:"upc"`
	InventoryQuantity float64              `gorm:"column:inventory_quantity;type:numeric;not null;default:100" json:"inventory_quantity"`
	AllowBackorder    bool                 `gorm:"column:allow_backorder;type:boolean;not null" json:"allow_backorder"`
	ManageInventory   bool                 `gorm:"column:manage_inventory;type:boolean;not null;default:true" json:"manage_inventory"`
	HsCode            string               `gorm:"column:hs_code;type:text" json:"hs_code"`
	OriginCountry     string               `gorm:"column:origin_country;type:text" json:"origin_country"`
	MidCode           string               `gorm:"column:mid_code;type:text" json:"mid_code"`
	Material          string               `gorm:"column:material;type:text" json:"material"`
	Weight            float64              `gorm:"column:weight;type:numeric" json:"weight"`
	Length            float64              `gorm:"column:length;type:numeric" json:"length"`
	Height            float64              `gorm:"column:height;type:numeric" json:"height"`
	Width             float64              `gorm:"column:width;type:numeric" json:"width"`
	VariantRank       float64              `gorm:"column:variant_rank;type:numeric" json:"variant_rank"`
	ProductId         string               `gorm:"column:product_id;type:text;not null;index:IDX_product_variant_product_id,priority:1" json:"product_id"`
	Product           *Product             `gorm:"foreignKey:ProductId;constraint:OnDelete:CASCADE"`
	Options           []ProductOptionValue `gorm:"foreignKey:VariantId;constraint:OnDelete:CASCADE;"`
	DeletedAt         gorm.DeletedAt       `gorm:"column:deleted_at;type:timestamp with time zone;index:IDX_product_variant_deleted_at,priority:1" json:"deleted_at"`
}

func (*ProductVariant) TableName

func (*ProductVariant) TableName() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL