models

package
v0.0.0-...-9ed8f83 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Customer

type Customer struct {
	Metadata        string            `gorm:"column:metadata;type:jsonb;null;" json:"metadata,omitempty"`
	CreatedAt       *time.Time        `gorm:"column:created_at;type:timestamptz;size:6;default:now();not null;" json:"created_at"`
	DeletedAt       *time.Time        `gorm:"column:deleted_at;type:timestamptz;size:6;null;" json:"deleted_at,omitempty"`
	CreatedBy       string            `gorm:"column:created_by;type:text;null;" json:"created_by,omitempty"`
	Email           string            `gorm:"column:email;type:text;null;" json:"email,omitempty"`
	HasAccount      bool              `gorm:"column:has_account;type:boolean;default:false;not null;" json:"has_account"`
	FirstName       string            `gorm:"column:first_name;type:text;null;" json:"first_name,omitempty"`
	LastName        string            `gorm:"column:last_name;type:text;null;" json:"last_name,omitempty"`
	Phone           string            `gorm:"column:phone;type:text;null;" json:"phone,omitempty"`
	UpdatedAt       *time.Time        `gorm:"column:updated_at;type:timestamptz;size:6;default:now();not null;" json:"updated_at"`
	Id              string            `gorm:"column:id;type:text;not null;primaryKey;index:customer_pkey,priority:1,unique" json:"id"`
	CompanyName     string            `gorm:"column:company_name;type:text;null;" json:"company_name,omitempty"`
	CustomerAddress []CustomerAddress `gorm:"column:customer_address;type:CustomerAddress;foreignKey:customer;null;" json:"customer_address,omitempty"`
	CustomerGroup   []CustomerGroup   `gorm:"column:customer_group;type:CustomerGroup;many2many:customer_group_customer;null;" json:"customer_group,omitempty"`
}

func (*Customer) Count

func (m *Customer) Count(db *gorm.DB, ctx context.Context, query *utils.Query) (*int64, error)

Count counts all records matching given conditions conds

func (*Customer) Create

func (m *Customer) Create(db *gorm.DB, ctx context.Context) error

Create inserts value, returning the inserted data's primary key in value's id

func (*Customer) Delete

func (m *Customer) Delete(db *gorm.DB, ctx context.Context) error

Delete deletes value matching given conditions. If value contains primary key it is included in the conditions. If value includes a deleted_at field, then Delete performs a soft delete instead by setting deleted_at with the current time if null.

func (*Customer) DeletePermanently

func (m *Customer) DeletePermanently(db *gorm.DB, ctx context.Context) error

DeletePermanently deletes value matching given conditions. If value contains primary key it is included in the conditions.

func (*Customer) Find

func (m *Customer) Find(db *gorm.DB, ctx context.Context, query *utils.Query) ([]Customer, error)

Find finds all records matching given conditions conds

func (*Customer) FindAndCount

func (m *Customer) FindAndCount(db *gorm.DB, ctx context.Context, query *utils.Query) ([]Customer, *int64, error)

FindAndCount finds all records matching given conditions conds and count them

func (*Customer) FindOne

func (m *Customer) FindOne(db *gorm.DB, ctx context.Context, query *utils.Query) error

FindOne finds the first record ordered by primary key, matching given conditions conds

func (*Customer) Insert

func (m *Customer) Insert(db *gorm.DB, ctx context.Context) error

Insert inserts value, returning the inserted data's primary key in value's id

func (*Customer) Recover

func (m *Customer) Recover(db *gorm.DB, ctx context.Context) error

Recover recovers given entitie in the database.

func (*Customer) Remove

func (m *Customer) Remove(db *gorm.DB, ctx context.Context) error

Remove deletes value matching given conditions. If value contains primary key it is included in the conditions. If value includes a deleted_at field, then Delete performs a soft delete instead by setting deleted_at with the current time if null.

func (*Customer) Save

func (m *Customer) Save(db *gorm.DB, ctx context.Context) error

Save updates value in database. If value doesn't contain a matching primary key, value is inserted.

func (*Customer) SoftRemove

func (m *Customer) SoftRemove(db *gorm.DB, ctx context.Context) error

SoftRemove deletes value matching given conditions. If value contains primary key it is included in the conditions. If value includes a deleted_at field, then Delete performs a soft delete instead by setting deleted_at with the current time if null.

func (*Customer) Update

func (m *Customer) Update(db *gorm.DB, ctx context.Context) error

Update updates attributes using callbacks. values must be a struct or map. Reference: https://gorm.io/docs/update.html#Update-Changed-Fields

func (*Customer) Upsert

func (m *Customer) Upsert(db *gorm.DB, ctx context.Context) error

Upsert inserts a given entity into the database, unless a unique constraint conflicts then updates the entity Unlike save method executes a primitive operation without cascades, relations and other operations included. Executes fast and efficient INSERT ... ON CONFLICT DO UPDATE/ON DUPLICATE KEY UPDATE query.

type CustomerAddress

type CustomerAddress struct {
	Address1          string     `gorm:"column:address_1;type:text;null;" json:"address_1,omitempty"`
	Address2          string     `gorm:"column:address_2;type:text;null;" json:"address_2,omitempty"`
	Province          string     `gorm:"column:province;type:text;null;" json:"province,omitempty"`
	PostalCode        string     `gorm:"column:postal_code;type:text;null;" json:"postal_code,omitempty"`
	IsDefaultShipping bool       `gorm:"column:is_default_shipping;type:boolean;default:false;not null;" json:"is_default_shipping"`
	IsDefaultBilling  bool       `gorm:"column:is_default_billing;type:boolean;default:false;not null;" json:"is_default_billing"`
	LastName          string     `gorm:"column:last_name;type:text;null;" json:"last_name,omitempty"`
	CreatedAt         *time.Time `gorm:"column:created_at;type:timestamptz;size:6;default:now();not null;" json:"created_at"`
	UpdatedAt         *time.Time `gorm:"column:updated_at;type:timestamptz;size:6;default:now();not null;" json:"updated_at"`
	AddressName       string     `gorm:"column:address_name;type:text;null;" json:"address_name,omitempty"`
	Company           string     `gorm:"column:company;type:text;null;" json:"company,omitempty"`
	Metadata          string     `gorm:"column:metadata;type:jsonb;null;" json:"metadata,omitempty"`
	CountryCode       string     `gorm:"column:country_code;type:text;null;" json:"country_code,omitempty"`
	Phone             string     `gorm:"column:phone;type:text;null;" json:"phone,omitempty"`
	Id                string     `gorm:"column:id;type:text;not null;primaryKey;index:customer_address_pkey,priority:1,unique" json:"id"`
	CustomerId        string     `gorm:"column:customer_id;type:text;not null;index:IDX_customer_address_customer_id,priority:1" json:"customer_id"`
	FirstName         string     `gorm:"column:first_name;type:text;null;" json:"first_name,omitempty"`
	City              string     `gorm:"column:city;type:text;null;" json:"city,omitempty"`
	Customer          *Customer  `` /* 131-byte string literal not displayed */
}

func (*CustomerAddress) Count

func (m *CustomerAddress) Count(db *gorm.DB, ctx context.Context, query *utils.Query) (*int64, error)

Count counts all records matching given conditions conds

func (*CustomerAddress) Create

func (m *CustomerAddress) Create(db *gorm.DB, ctx context.Context) error

Create inserts value, returning the inserted data's primary key in value's id

func (*CustomerAddress) Delete

func (m *CustomerAddress) Delete(db *gorm.DB, ctx context.Context) error

Delete deletes value matching given conditions. If value contains primary key it is included in the conditions. If value includes a deleted_at field, then Delete performs a soft delete instead by setting deleted_at with the current time if null.

func (*CustomerAddress) DeletePermanently

func (m *CustomerAddress) DeletePermanently(db *gorm.DB, ctx context.Context) error

DeletePermanently deletes value matching given conditions. If value contains primary key it is included in the conditions.

func (*CustomerAddress) Find

func (m *CustomerAddress) Find(db *gorm.DB, ctx context.Context, query *utils.Query) ([]CustomerAddress, error)

Find finds all records matching given conditions conds

func (*CustomerAddress) FindAndCount

func (m *CustomerAddress) FindAndCount(db *gorm.DB, ctx context.Context, query *utils.Query) ([]CustomerAddress, *int64, error)

FindAndCount finds all records matching given conditions conds and count them

func (*CustomerAddress) FindOne

func (m *CustomerAddress) FindOne(db *gorm.DB, ctx context.Context, query *utils.Query) error

FindOne finds the first record ordered by primary key, matching given conditions conds

func (*CustomerAddress) Insert

func (m *CustomerAddress) Insert(db *gorm.DB, ctx context.Context) error

Insert inserts value, returning the inserted data's primary key in value's id

func (*CustomerAddress) Recover

func (m *CustomerAddress) Recover(db *gorm.DB, ctx context.Context) error

Recover recovers given entitie in the database.

func (*CustomerAddress) Remove

func (m *CustomerAddress) Remove(db *gorm.DB, ctx context.Context) error

Remove deletes value matching given conditions. If value contains primary key it is included in the conditions. If value includes a deleted_at field, then Delete performs a soft delete instead by setting deleted_at with the current time if null.

func (*CustomerAddress) Save

func (m *CustomerAddress) Save(db *gorm.DB, ctx context.Context) error

Save updates value in database. If value doesn't contain a matching primary key, value is inserted.

func (*CustomerAddress) SoftRemove

func (m *CustomerAddress) SoftRemove(db *gorm.DB, ctx context.Context) error

SoftRemove deletes value matching given conditions. If value contains primary key it is included in the conditions. If value includes a deleted_at field, then Delete performs a soft delete instead by setting deleted_at with the current time if null.

func (*CustomerAddress) Update

func (m *CustomerAddress) Update(db *gorm.DB, ctx context.Context) error

Update updates attributes using callbacks. values must be a struct or map. Reference: https://gorm.io/docs/update.html#Update-Changed-Fields

func (*CustomerAddress) Upsert

func (m *CustomerAddress) Upsert(db *gorm.DB, ctx context.Context) error

Upsert inserts a given entity into the database, unless a unique constraint conflicts then updates the entity Unlike save method executes a primitive operation without cascades, relations and other operations included. Executes fast and efficient INSERT ... ON CONFLICT DO UPDATE/ON DUPLICATE KEY UPDATE query.

type CustomerGroup

type CustomerGroup struct {
	CreatedBy string     `gorm:"column:created_by;type:text;null;" json:"created_by,omitempty"`
	CreatedAt *time.Time `gorm:"column:created_at;type:timestamptz;size:6;default:now();not null;" json:"created_at"`
	UpdatedAt *time.Time `gorm:"column:updated_at;type:timestamptz;size:6;default:now();not null;" json:"updated_at"`
	DeletedAt *time.Time `gorm:"column:deleted_at;type:timestamptz;size:6;null;" json:"deleted_at,omitempty"`
	Id        string     `gorm:"column:id;type:text;not null;primaryKey;index:customer_group_pkey,priority:1,unique" json:"id"`
	Name      string     `gorm:"column:name;type:text;null;" json:"name,omitempty"`
	Metadata  string     `gorm:"column:metadata;type:jsonb;null;" json:"metadata,omitempty"`
	Customer  []Customer `gorm:"column:customer;type:Customer;many2many:customer_group_customer;null;" json:"customer,omitempty"`
}

func (*CustomerGroup) Count

func (m *CustomerGroup) Count(db *gorm.DB, ctx context.Context, query *utils.Query) (*int64, error)

Count counts all records matching given conditions conds

func (*CustomerGroup) Create

func (m *CustomerGroup) Create(db *gorm.DB, ctx context.Context) error

Create inserts value, returning the inserted data's primary key in value's id

func (*CustomerGroup) Delete

func (m *CustomerGroup) Delete(db *gorm.DB, ctx context.Context) error

Delete deletes value matching given conditions. If value contains primary key it is included in the conditions. If value includes a deleted_at field, then Delete performs a soft delete instead by setting deleted_at with the current time if null.

func (*CustomerGroup) DeletePermanently

func (m *CustomerGroup) DeletePermanently(db *gorm.DB, ctx context.Context) error

DeletePermanently deletes value matching given conditions. If value contains primary key it is included in the conditions.

func (*CustomerGroup) Find

func (m *CustomerGroup) Find(db *gorm.DB, ctx context.Context, query *utils.Query) ([]CustomerGroup, error)

Find finds all records matching given conditions conds

func (*CustomerGroup) FindAndCount

func (m *CustomerGroup) FindAndCount(db *gorm.DB, ctx context.Context, query *utils.Query) ([]CustomerGroup, *int64, error)

FindAndCount finds all records matching given conditions conds and count them

func (*CustomerGroup) FindOne

func (m *CustomerGroup) FindOne(db *gorm.DB, ctx context.Context, query *utils.Query) error

FindOne finds the first record ordered by primary key, matching given conditions conds

func (*CustomerGroup) Insert

func (m *CustomerGroup) Insert(db *gorm.DB, ctx context.Context) error

Insert inserts value, returning the inserted data's primary key in value's id

func (*CustomerGroup) Recover

func (m *CustomerGroup) Recover(db *gorm.DB, ctx context.Context) error

Recover recovers given entitie in the database.

func (*CustomerGroup) Remove

func (m *CustomerGroup) Remove(db *gorm.DB, ctx context.Context) error

Remove deletes value matching given conditions. If value contains primary key it is included in the conditions. If value includes a deleted_at field, then Delete performs a soft delete instead by setting deleted_at with the current time if null.

func (*CustomerGroup) Save

func (m *CustomerGroup) Save(db *gorm.DB, ctx context.Context) error

Save updates value in database. If value doesn't contain a matching primary key, value is inserted.

func (*CustomerGroup) SoftRemove

func (m *CustomerGroup) SoftRemove(db *gorm.DB, ctx context.Context) error

SoftRemove deletes value matching given conditions. If value contains primary key it is included in the conditions. If value includes a deleted_at field, then Delete performs a soft delete instead by setting deleted_at with the current time if null.

func (*CustomerGroup) Update

func (m *CustomerGroup) Update(db *gorm.DB, ctx context.Context) error

Update updates attributes using callbacks. values must be a struct or map. Reference: https://gorm.io/docs/update.html#Update-Changed-Fields

func (*CustomerGroup) Upsert

func (m *CustomerGroup) Upsert(db *gorm.DB, ctx context.Context) error

Upsert inserts a given entity into the database, unless a unique constraint conflicts then updates the entity Unlike save method executes a primitive operation without cascades, relations and other operations included. Executes fast and efficient INSERT ... ON CONFLICT DO UPDATE/ON DUPLICATE KEY UPDATE query.

type CustomerGroupCustomer

type CustomerGroupCustomer struct {
	CreatedBy       string         `gorm:"column:created_by;type:text;null;" json:"created_by,omitempty"`
	Id              string         `gorm:"column:id;type:text;not null;primaryKey;index:customer_group_customer_pkey,priority:1,unique" json:"id"`
	CustomerId      string         `gorm:"column:customer_id;type:text;not null;index:IDX_customer_group_customer_customer_id,priority:1" json:"customer_id"`
	CustomerGroupId string         `` /* 129-byte string literal not displayed */
	Metadata        string         `gorm:"column:metadata;type:jsonb;null;" json:"metadata,omitempty"`
	CreatedAt       *time.Time     `gorm:"column:created_at;type:timestamptz;size:6;default:now();not null;" json:"created_at"`
	UpdatedAt       *time.Time     `gorm:"column:updated_at;type:timestamptz;size:6;default:now();not null;" json:"updated_at"`
	CustomerGroup   *CustomerGroup `` /* 131-byte string literal not displayed */
	Customer        *Customer      `gorm:"column:customer;type:Customer;constraint:OnDelete:cascade;polymorphic:Owner;null;" json:"customer,omitempty"`
}

func (*CustomerGroupCustomer) Count

func (m *CustomerGroupCustomer) Count(db *gorm.DB, ctx context.Context, query *utils.Query) (*int64, error)

Count counts all records matching given conditions conds

func (*CustomerGroupCustomer) Create

func (m *CustomerGroupCustomer) Create(db *gorm.DB, ctx context.Context) error

Create inserts value, returning the inserted data's primary key in value's id

func (*CustomerGroupCustomer) Delete

func (m *CustomerGroupCustomer) Delete(db *gorm.DB, ctx context.Context) error

Delete deletes value matching given conditions. If value contains primary key it is included in the conditions. If value includes a deleted_at field, then Delete performs a soft delete instead by setting deleted_at with the current time if null.

func (*CustomerGroupCustomer) DeletePermanently

func (m *CustomerGroupCustomer) DeletePermanently(db *gorm.DB, ctx context.Context) error

DeletePermanently deletes value matching given conditions. If value contains primary key it is included in the conditions.

func (*CustomerGroupCustomer) Find

Find finds all records matching given conditions conds

func (*CustomerGroupCustomer) FindAndCount

func (m *CustomerGroupCustomer) FindAndCount(db *gorm.DB, ctx context.Context, query *utils.Query) ([]CustomerGroupCustomer, *int64, error)

FindAndCount finds all records matching given conditions conds and count them

func (*CustomerGroupCustomer) FindOne

func (m *CustomerGroupCustomer) FindOne(db *gorm.DB, ctx context.Context, query *utils.Query) error

FindOne finds the first record ordered by primary key, matching given conditions conds

func (*CustomerGroupCustomer) Insert

func (m *CustomerGroupCustomer) Insert(db *gorm.DB, ctx context.Context) error

Insert inserts value, returning the inserted data's primary key in value's id

func (*CustomerGroupCustomer) Recover

func (m *CustomerGroupCustomer) Recover(db *gorm.DB, ctx context.Context) error

Recover recovers given entitie in the database.

func (*CustomerGroupCustomer) Remove

func (m *CustomerGroupCustomer) Remove(db *gorm.DB, ctx context.Context) error

Remove deletes value matching given conditions. If value contains primary key it is included in the conditions. If value includes a deleted_at field, then Delete performs a soft delete instead by setting deleted_at with the current time if null.

func (*CustomerGroupCustomer) Save

func (m *CustomerGroupCustomer) Save(db *gorm.DB, ctx context.Context) error

Save updates value in database. If value doesn't contain a matching primary key, value is inserted.

func (*CustomerGroupCustomer) SoftRemove

func (m *CustomerGroupCustomer) SoftRemove(db *gorm.DB, ctx context.Context) error

SoftRemove deletes value matching given conditions. If value contains primary key it is included in the conditions. If value includes a deleted_at field, then Delete performs a soft delete instead by setting deleted_at with the current time if null.

func (*CustomerGroupCustomer) Update

func (m *CustomerGroupCustomer) Update(db *gorm.DB, ctx context.Context) error

Update updates attributes using callbacks. values must be a struct or map. Reference: https://gorm.io/docs/update.html#Update-Changed-Fields

func (*CustomerGroupCustomer) Upsert

func (m *CustomerGroupCustomer) Upsert(db *gorm.DB, ctx context.Context) error

Upsert inserts a given entity into the database, unless a unique constraint conflicts then updates the entity Unlike save method executes a primitive operation without cascades, relations and other operations included. Executes fast and efficient INSERT ... ON CONFLICT DO UPDATE/ON DUPLICATE KEY UPDATE query.

Jump to

Keyboard shortcuts

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