Documentation
¶
Index ¶
- type Customer
- func (m *Customer) Count(db *gorm.DB, ctx context.Context, query *utils.Query) (*int64, error)
- func (m *Customer) Create(db *gorm.DB, ctx context.Context) error
- func (m *Customer) Delete(db *gorm.DB, ctx context.Context) error
- func (m *Customer) DeletePermanently(db *gorm.DB, ctx context.Context) error
- func (m *Customer) Find(db *gorm.DB, ctx context.Context, query *utils.Query) ([]Customer, error)
- func (m *Customer) FindAndCount(db *gorm.DB, ctx context.Context, query *utils.Query) ([]Customer, *int64, error)
- func (m *Customer) FindOne(db *gorm.DB, ctx context.Context, query *utils.Query) error
- func (m *Customer) Insert(db *gorm.DB, ctx context.Context) error
- func (m *Customer) Recover(db *gorm.DB, ctx context.Context) error
- func (m *Customer) Remove(db *gorm.DB, ctx context.Context) error
- func (m *Customer) Save(db *gorm.DB, ctx context.Context) error
- func (m *Customer) SoftRemove(db *gorm.DB, ctx context.Context) error
- func (m *Customer) Update(db *gorm.DB, ctx context.Context) error
- func (m *Customer) Upsert(db *gorm.DB, ctx context.Context) error
- type CustomerAddress
- func (m *CustomerAddress) Count(db *gorm.DB, ctx context.Context, query *utils.Query) (*int64, error)
- func (m *CustomerAddress) Create(db *gorm.DB, ctx context.Context) error
- func (m *CustomerAddress) Delete(db *gorm.DB, ctx context.Context) error
- func (m *CustomerAddress) DeletePermanently(db *gorm.DB, ctx context.Context) error
- func (m *CustomerAddress) Find(db *gorm.DB, ctx context.Context, query *utils.Query) ([]CustomerAddress, error)
- func (m *CustomerAddress) FindAndCount(db *gorm.DB, ctx context.Context, query *utils.Query) ([]CustomerAddress, *int64, error)
- func (m *CustomerAddress) FindOne(db *gorm.DB, ctx context.Context, query *utils.Query) error
- func (m *CustomerAddress) Insert(db *gorm.DB, ctx context.Context) error
- func (m *CustomerAddress) Recover(db *gorm.DB, ctx context.Context) error
- func (m *CustomerAddress) Remove(db *gorm.DB, ctx context.Context) error
- func (m *CustomerAddress) Save(db *gorm.DB, ctx context.Context) error
- func (m *CustomerAddress) SoftRemove(db *gorm.DB, ctx context.Context) error
- func (m *CustomerAddress) Update(db *gorm.DB, ctx context.Context) error
- func (m *CustomerAddress) Upsert(db *gorm.DB, ctx context.Context) error
- type CustomerGroup
- func (m *CustomerGroup) Count(db *gorm.DB, ctx context.Context, query *utils.Query) (*int64, error)
- func (m *CustomerGroup) Create(db *gorm.DB, ctx context.Context) error
- func (m *CustomerGroup) Delete(db *gorm.DB, ctx context.Context) error
- func (m *CustomerGroup) DeletePermanently(db *gorm.DB, ctx context.Context) error
- func (m *CustomerGroup) Find(db *gorm.DB, ctx context.Context, query *utils.Query) ([]CustomerGroup, error)
- func (m *CustomerGroup) FindAndCount(db *gorm.DB, ctx context.Context, query *utils.Query) ([]CustomerGroup, *int64, error)
- func (m *CustomerGroup) FindOne(db *gorm.DB, ctx context.Context, query *utils.Query) error
- func (m *CustomerGroup) Insert(db *gorm.DB, ctx context.Context) error
- func (m *CustomerGroup) Recover(db *gorm.DB, ctx context.Context) error
- func (m *CustomerGroup) Remove(db *gorm.DB, ctx context.Context) error
- func (m *CustomerGroup) Save(db *gorm.DB, ctx context.Context) error
- func (m *CustomerGroup) SoftRemove(db *gorm.DB, ctx context.Context) error
- func (m *CustomerGroup) Update(db *gorm.DB, ctx context.Context) error
- func (m *CustomerGroup) Upsert(db *gorm.DB, ctx context.Context) error
- type CustomerGroupCustomer
- func (m *CustomerGroupCustomer) Count(db *gorm.DB, ctx context.Context, query *utils.Query) (*int64, error)
- func (m *CustomerGroupCustomer) Create(db *gorm.DB, ctx context.Context) error
- func (m *CustomerGroupCustomer) Delete(db *gorm.DB, ctx context.Context) error
- func (m *CustomerGroupCustomer) DeletePermanently(db *gorm.DB, ctx context.Context) error
- func (m *CustomerGroupCustomer) Find(db *gorm.DB, ctx context.Context, query *utils.Query) ([]CustomerGroupCustomer, error)
- func (m *CustomerGroupCustomer) FindAndCount(db *gorm.DB, ctx context.Context, query *utils.Query) ([]CustomerGroupCustomer, *int64, error)
- func (m *CustomerGroupCustomer) FindOne(db *gorm.DB, ctx context.Context, query *utils.Query) error
- func (m *CustomerGroupCustomer) Insert(db *gorm.DB, ctx context.Context) error
- func (m *CustomerGroupCustomer) Recover(db *gorm.DB, ctx context.Context) error
- func (m *CustomerGroupCustomer) Remove(db *gorm.DB, ctx context.Context) error
- func (m *CustomerGroupCustomer) Save(db *gorm.DB, ctx context.Context) error
- func (m *CustomerGroupCustomer) SoftRemove(db *gorm.DB, ctx context.Context) error
- func (m *CustomerGroupCustomer) Update(db *gorm.DB, ctx context.Context) error
- func (m *CustomerGroupCustomer) Upsert(db *gorm.DB, ctx context.Context) error
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) Create ¶
Create inserts value, returning the inserted data's primary key in value's id
func (*Customer) Delete ¶
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 ¶
DeletePermanently deletes value matching given conditions. If value contains primary key it is included in the conditions.
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 ¶
FindOne finds the first record ordered by primary key, matching given conditions conds
func (*Customer) Insert ¶
Insert inserts value, returning the inserted data's primary key in value's id
func (*Customer) Remove ¶
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 ¶
Save updates value in database. If value doesn't contain a matching primary key, value is inserted.
func (*Customer) SoftRemove ¶
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 ¶
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 ¶
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 ¶
Create inserts value, returning the inserted data's primary key in value's id
func (*CustomerAddress) Delete ¶
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 ¶
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 ¶
FindOne finds the first record ordered by primary key, matching given conditions conds
func (*CustomerAddress) Insert ¶
Insert inserts value, returning the inserted data's primary key in value's id
func (*CustomerAddress) Remove ¶
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 ¶
Save updates value in database. If value doesn't contain a matching primary key, value is inserted.
func (*CustomerAddress) SoftRemove ¶
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 ¶
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 ¶
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) Create ¶
Create inserts value, returning the inserted data's primary key in value's id
func (*CustomerGroup) Delete ¶
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 ¶
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 ¶
FindOne finds the first record ordered by primary key, matching given conditions conds
func (*CustomerGroup) Insert ¶
Insert inserts value, returning the inserted data's primary key in value's id
func (*CustomerGroup) Remove ¶
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 ¶
Save updates value in database. If value doesn't contain a matching primary key, value is inserted.
func (*CustomerGroup) SoftRemove ¶
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 ¶
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 ¶
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 ¶
Create inserts value, returning the inserted data's primary key in value's id
func (*CustomerGroupCustomer) Delete ¶
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 ¶
DeletePermanently deletes value matching given conditions. If value contains primary key it is included in the conditions.
func (*CustomerGroupCustomer) Find ¶
func (m *CustomerGroupCustomer) Find(db *gorm.DB, ctx context.Context, query *utils.Query) ([]CustomerGroupCustomer, error)
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 ¶
FindOne finds the first record ordered by primary key, matching given conditions conds
func (*CustomerGroupCustomer) Insert ¶
Insert inserts value, returning the inserted data's primary key in value's id
func (*CustomerGroupCustomer) Remove ¶
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 ¶
Save updates value in database. If value doesn't contain a matching primary key, value is inserted.
func (*CustomerGroupCustomer) SoftRemove ¶
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 ¶
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 ¶
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.