models

package
v1.0.52 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SQLQueries = map[string]string{
	"registeredCategories":    "registered_categories.sql",
	"hierarchicalCategoryRel": "hierarchical_category_relationship.sql",
}

Functions

func ListEmbeddedQueries added in v1.0.50

func ListEmbeddedQueries()

func LoadSQLQuery added in v1.0.15

func LoadSQLQuery(queryKey string, params map[string]string) (string, error)

Types

type CatalogItemModel

type CatalogItemModel struct {
	Id                uuid.UUID                 `gorm:"primaryKey;column:id;type:uuid;unique;default:gen_random_uuid()"`
	ItemName          string                    `gorm:"column:item_name;type:varchar(255);not null;unique"`
	Description       string                    `gorm:"column:description;type:varchar(255);not null"`
	Reference         string                    `gorm:"column:reference;type:varchar(255);not null;unique"`
	Sku               string                    `gorm:"column:sku;type:varchar(20);not null;unique"`
	SupplierItemName  string                    `gorm:"column:supplier_item_name;type:varchar(255);not null;unique"`
	SupplierItemCode  string                    `gorm:"column:supplier_item_code;type:varchar(50);not null;unique"`
	MultiLangValues   []schemas.MultiLangSchema `gorm:"column:multi_lang_values;type:jsonb;default:'[]'"`
	MultiLangIsActive bool                      `gorm:"column:multi_lang_is_active;type:bool;not null;default:false"`
	BrandId           uuid.UUID                 `gorm:"column:brand_id;type;primaryKey"`
	CategoryId        uuid.UUID                 `gorm:"column:category_id;type;primaryKey"`
	SupplierId        uuid.UUID                 `gorm:"column:supplier_id;type;primaryKey"`
	IsActive          bool                      `gorm:"column:is_active;type:bool;not null;default:true"`
	CreatedAt         int64                     `gorm:"column:created_at;type:bigint;not null;"`
	UpdatedAt         int64                     `gorm:"column:updated_at;type:bigint;null;default:0"`
	Locations         []ItemHasLocationModel    `gorm:"foreignKey:item_id"`
	Files             []ItemHasFileModel        `gorm:"foreignKey:item_id"`
}

func (CatalogItemModel) TableName

func (CatalogItemModel) TableName() string

Establecer nombre personalizado de la tabla

type CategoryModel

type CategoryModel struct {
	Id                uuid.UUID                 `gorm:"primaryKey;column:id;type:uuid;unique;default:gen_random_uuid()"`
	CategoryName      string                    `gorm:"column:category_name;type:varchar(100);not null;unique"`
	Nomeclature       string                    `gorm:"column:nomeclature;type:varchar(10);not null;unique"`
	ParentId          sql.NullString            `gorm:"column:parent_id;type:uuid;null"`
	MultiLangValues   []schemas.MultiLangSchema `gorm:"column:multi_lang_values;type:jsonb;default:'[]'"`
	MultiLangIsActive bool                      `gorm:"column:multi_lang_is_active;type:bool;not null;default:false"`
	IsActive          bool                      `gorm:"column:is_active;type:bool;not null;default:true"`
	CreatedAt         int64                     `gorm:"column:created_at;type:bigint;not null;"`
	UpdatedAt         int64                     `gorm:"column:updated_at;type:bigint;null;default:0"`
	Items             []CatalogItemModel        `gorm:"foreignKey:category_id"`
}

func (CategoryModel) TableName

func (CategoryModel) TableName() string

Establecer nombre personalizado de la tabla

type FileModel

type FileModel struct {
	Id       uuid.UUID          `gorm:"primaryKey;column:id;type:uuid;unique;default:gen_random_uuid()"`
	FileType string             `gorm:"column:filetype;type:varchar(10);not null"`
	FileSize int32              `gorm:"column:filesize;type:bigint;not null"`
	Binary   []byte             `gorm:"column:binary;type:bytea;not null"`
	Items    []ItemHasFileModel `gorm:"foreignKey:file_id"`
}

func (FileModel) TableName

func (FileModel) TableName() string

Establecer nombre personalizado de la tabla

type ItemBrandModel

type ItemBrandModel struct {
	Id        uuid.UUID          `gorm:"primaryKey;column:id;type:uuid;unique;default:gen_random_uuid()"`
	BrandName string             `gorm:"column:brand_name;type:varchar(100);not null;unique"`
	IsActive  bool               `gorm:"column:is_active;type:bool;not null;default:true"`
	CreatedAt int64              `gorm:"column:created_at;type:bigint;not null;"`
	UpdatedAt int64              `gorm:"column:updated_at;type:bigint;null;default:0"`
	Items     []CatalogItemModel `gorm:"foreignKey:brand_id"`
}

func (ItemBrandModel) TableName

func (ItemBrandModel) TableName() string

Establecer nombre personalizado de la tabla

type ItemHasFileModel

type ItemHasFileModel struct {
	ItemId     uuid.UUID `gorm:"column:item_id;type;primaryKey"`
	LocationId uuid.UUID `gorm:"column:file_id;type;primaryKey"`
}

func (ItemHasFileModel) TableName

func (ItemHasFileModel) TableName() string

Establecer nombre personalizado de la tabla

type ItemHasLocationModel

type ItemHasLocationModel struct {
	ItemId     uuid.UUID `gorm:"column:item_id;type;primaryKey"`
	LocationId uuid.UUID `gorm:"column:location_id;type;primaryKey"`
}

func (ItemHasLocationModel) TableName

func (ItemHasLocationModel) TableName() string

Establecer nombre personalizado de la tabla

type LocationTypeModel

type LocationTypeModel struct {
	Id              uuid.UUID                 `gorm:"primaryKey;column:id;type:varchar(36);unique"`
	Name            string                    `gorm:"column:name;type:varchar(255);not null;unique"`
	SupplierCode    string                    `gorm:"column:supplier_code;type:varchar(10);not null;unique"`
	MultiLangValues []schemas.MultiLangSchema `gorm:"column:multi_lang_values;type:jsonb;default:'[]'"`
	Rules           pgtype.JSONB              `gorm:"column:rules;type:jsonb;default:'[]'"`
	Locations       []StorageLocationModel    `gorm:"foreignKey:location_type_id"`
}

func (LocationTypeModel) TableName

func (LocationTypeModel) TableName() string

Establecer nombre personalizado de la tabla

type StorageLocationModel

type StorageLocationModel struct {
	Id             uuid.UUID              `gorm:"primaryKey;column:id;type:uuid;unique;default:gen_random_uuid()"`
	LocatioName    string                 `gorm:"column:location_name;type:varchar(100);not null;unique"`
	Nomeclature    string                 `gorm:"column:nomeclature;type:varchar(10);not null;unique"`
	ParentId       sql.NullString         `gorm:"column:parent_id;type:uuid;null"`
	HasAccounting  bool                   `gorm:"column:has_accounting;type:bool;not null;default:true"`
	IsActive       bool                   `gorm:"column:is_active;type:bool;not null;default:true"`
	CreatedAt      int64                  `gorm:"column:created_at;type:bigint;not null;"`
	UpdatedAt      int64                  `gorm:"column:updated_at;type:bigint;null;default:0"`
	LocationTypeId uuid.UUID              `gorm:"column:location_type_id;type;primaryKey"`
	Items          []ItemHasLocationModel `gorm:"foreignKey:location_id"`
}

func (StorageLocationModel) TableName

func (StorageLocationModel) TableName() string

Establecer nombre personalizado de la tabla

type SupplierModel

type SupplierModel struct {
	Id           uuid.UUID          `gorm:"primaryKey;column:id;type:uuid;unique;default:gen_random_uuid()"`
	SupplierName string             `gorm:"column:supplier_name;type:varchar(255);not null;unique"`
	SupplierCode string             `gorm:"column:supplier_code;type:varchar(10);not null;unique"`
	IsActive     bool               `gorm:"column:is_active;type:bool;not null;default:true"`
	CreatedAt    int64              `gorm:"column:created_at;type:bigint;not null;"`
	UpdatedAt    int64              `gorm:"column:updated_at;type:bigint;null;default:0"`
	Items        []CatalogItemModel `gorm:"foreignKey:supplier_id"`
}

func (SupplierModel) TableName

func (SupplierModel) TableName() string

Establecer nombre personalizado de la tabla

Jump to

Keyboard shortcuts

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