232 lines
8.6 KiB
Go
232 lines
8.6 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package user
|
|
|
|
import (
|
|
"time"
|
|
|
|
"entgo.io/ent/dialect/sql"
|
|
"entgo.io/ent/dialect/sql/sqlgraph"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the user type in the database.
|
|
Label = "user"
|
|
// FieldID holds the string denoting the id field in the database.
|
|
FieldID = "id"
|
|
// FieldEmail holds the string denoting the email field in the database.
|
|
FieldEmail = "email"
|
|
// FieldCellPhone holds the string denoting the cell_phone field in the database.
|
|
FieldCellPhone = "cell_phone"
|
|
// FieldFirstName holds the string denoting the first_name field in the database.
|
|
FieldFirstName = "first_name"
|
|
// FieldLastName holds the string denoting the last_name field in the database.
|
|
FieldLastName = "last_name"
|
|
// FieldPassword holds the string denoting the password field in the database.
|
|
FieldPassword = "password"
|
|
// FieldIsActive holds the string denoting the is_active field in the database.
|
|
FieldIsActive = "is_active"
|
|
// FieldIsAdmin holds the string denoting the is_admin field in the database.
|
|
FieldIsAdmin = "is_admin"
|
|
// FieldCreatedAt holds the string denoting the created_at field in the database.
|
|
FieldCreatedAt = "created_at"
|
|
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
|
|
FieldUpdatedAt = "updated_at"
|
|
// FieldLastAuthenticationAt holds the string denoting the last_authentication_at field in the database.
|
|
FieldLastAuthenticationAt = "last_authentication_at"
|
|
// EdgeProducts holds the string denoting the products edge name in mutations.
|
|
EdgeProducts = "products"
|
|
// EdgeDomains holds the string denoting the domains edge name in mutations.
|
|
EdgeDomains = "domains"
|
|
// EdgeBusinesses holds the string denoting the businesses edge name in mutations.
|
|
EdgeBusinesses = "businesses"
|
|
// Table holds the table name of the user in the database.
|
|
Table = "users"
|
|
// ProductsTable is the table that holds the products relation/edge.
|
|
ProductsTable = "products"
|
|
// ProductsInverseTable is the table name for the Product entity.
|
|
// It exists in this package in order to avoid circular dependency with the "product" package.
|
|
ProductsInverseTable = "products"
|
|
// ProductsColumn is the table column denoting the products relation/edge.
|
|
ProductsColumn = "user_id"
|
|
// DomainsTable is the table that holds the domains relation/edge.
|
|
DomainsTable = "domains"
|
|
// DomainsInverseTable is the table name for the Domain entity.
|
|
// It exists in this package in order to avoid circular dependency with the "domain" package.
|
|
DomainsInverseTable = "domains"
|
|
// DomainsColumn is the table column denoting the domains relation/edge.
|
|
DomainsColumn = "user_id"
|
|
// BusinessesTable is the table that holds the businesses relation/edge.
|
|
BusinessesTable = "businesses"
|
|
// BusinessesInverseTable is the table name for the Business entity.
|
|
// It exists in this package in order to avoid circular dependency with the "business" package.
|
|
BusinessesInverseTable = "businesses"
|
|
// BusinessesColumn is the table column denoting the businesses relation/edge.
|
|
BusinessesColumn = "user_id"
|
|
)
|
|
|
|
// Columns holds all SQL columns for user fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldEmail,
|
|
FieldCellPhone,
|
|
FieldFirstName,
|
|
FieldLastName,
|
|
FieldPassword,
|
|
FieldIsActive,
|
|
FieldIsAdmin,
|
|
FieldCreatedAt,
|
|
FieldUpdatedAt,
|
|
FieldLastAuthenticationAt,
|
|
}
|
|
|
|
// ValidColumn reports if the column name is valid (part of the table columns).
|
|
func ValidColumn(column string) bool {
|
|
for i := range Columns {
|
|
if column == Columns[i] {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
var (
|
|
// EmailValidator is a validator for the "email" field. It is called by the builders before save.
|
|
EmailValidator func(string) error
|
|
// FirstNameValidator is a validator for the "first_name" field. It is called by the builders before save.
|
|
FirstNameValidator func(string) error
|
|
// LastNameValidator is a validator for the "last_name" field. It is called by the builders before save.
|
|
LastNameValidator func(string) error
|
|
// DefaultIsActive holds the default value on creation for the "is_active" field.
|
|
DefaultIsActive bool
|
|
// DefaultIsAdmin holds the default value on creation for the "is_admin" field.
|
|
DefaultIsAdmin bool
|
|
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
|
|
DefaultCreatedAt func() time.Time
|
|
// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
|
|
DefaultUpdatedAt func() time.Time
|
|
// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
|
|
UpdateDefaultUpdatedAt func() time.Time
|
|
)
|
|
|
|
// OrderOption defines the ordering options for the User queries.
|
|
type OrderOption func(*sql.Selector)
|
|
|
|
// ByID orders the results by the id field.
|
|
func ByID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldID, opts...).ToFunc()
|
|
}
|
|
|
|
// ByEmail orders the results by the email field.
|
|
func ByEmail(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldEmail, opts...).ToFunc()
|
|
}
|
|
|
|
// ByCellPhone orders the results by the cell_phone field.
|
|
func ByCellPhone(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldCellPhone, opts...).ToFunc()
|
|
}
|
|
|
|
// ByFirstName orders the results by the first_name field.
|
|
func ByFirstName(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldFirstName, opts...).ToFunc()
|
|
}
|
|
|
|
// ByLastName orders the results by the last_name field.
|
|
func ByLastName(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldLastName, opts...).ToFunc()
|
|
}
|
|
|
|
// ByPassword orders the results by the password field.
|
|
func ByPassword(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldPassword, opts...).ToFunc()
|
|
}
|
|
|
|
// ByIsActive orders the results by the is_active field.
|
|
func ByIsActive(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldIsActive, opts...).ToFunc()
|
|
}
|
|
|
|
// ByIsAdmin orders the results by the is_admin field.
|
|
func ByIsAdmin(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldIsAdmin, opts...).ToFunc()
|
|
}
|
|
|
|
// ByCreatedAt orders the results by the created_at field.
|
|
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
|
|
}
|
|
|
|
// ByUpdatedAt orders the results by the updated_at field.
|
|
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
|
|
}
|
|
|
|
// ByLastAuthenticationAt orders the results by the last_authentication_at field.
|
|
func ByLastAuthenticationAt(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldLastAuthenticationAt, opts...).ToFunc()
|
|
}
|
|
|
|
// ByProductsCount orders the results by products count.
|
|
func ByProductsCount(opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborsCount(s, newProductsStep(), opts...)
|
|
}
|
|
}
|
|
|
|
// ByProducts orders the results by products terms.
|
|
func ByProducts(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newProductsStep(), append([]sql.OrderTerm{term}, terms...)...)
|
|
}
|
|
}
|
|
|
|
// ByDomainsCount orders the results by domains count.
|
|
func ByDomainsCount(opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborsCount(s, newDomainsStep(), opts...)
|
|
}
|
|
}
|
|
|
|
// ByDomains orders the results by domains terms.
|
|
func ByDomains(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newDomainsStep(), append([]sql.OrderTerm{term}, terms...)...)
|
|
}
|
|
}
|
|
|
|
// ByBusinessesCount orders the results by businesses count.
|
|
func ByBusinessesCount(opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborsCount(s, newBusinessesStep(), opts...)
|
|
}
|
|
}
|
|
|
|
// ByBusinesses orders the results by businesses terms.
|
|
func ByBusinesses(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newBusinessesStep(), append([]sql.OrderTerm{term}, terms...)...)
|
|
}
|
|
}
|
|
func newProductsStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(ProductsInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.O2M, false, ProductsTable, ProductsColumn),
|
|
)
|
|
}
|
|
func newDomainsStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(DomainsInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.O2M, false, DomainsTable, DomainsColumn),
|
|
)
|
|
}
|
|
func newBusinessesStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(BusinessesInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.O2M, false, BusinessesTable, BusinessesColumn),
|
|
)
|
|
}
|