ent seteup

This commit is contained in:
2024-11-10 14:52:33 +05:30
parent 45c318b897
commit b0db98452a
78 changed files with 21469 additions and 36 deletions

279
db/ent/user/user.go Normal file
View File

@@ -0,0 +1,279 @@
// Code generated by ent, DO NOT EDIT.
package user
import (
"fmt"
"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"
// 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"
// FieldEmail holds the string denoting the email field in the database.
FieldEmail = "email"
// FieldEmailVerified holds the string denoting the email_verified field in the database.
FieldEmailVerified = "email_verified"
// FieldPhone holds the string denoting the phone field in the database.
FieldPhone = "phone"
// FieldPhoneVerified holds the string denoting the phone_verified field in the database.
FieldPhoneVerified = "phone_verified"
// FieldPwdSalt holds the string denoting the pwd_salt field in the database.
FieldPwdSalt = "pwd_salt"
// FieldPwdHash holds the string denoting the pwd_hash field in the database.
FieldPwdHash = "pwd_hash"
// FieldLoginFailedCount holds the string denoting the login_failed_count field in the database.
FieldLoginFailedCount = "login_failed_count"
// FieldLoginAttemptOn holds the string denoting the login_attempt_on field in the database.
FieldLoginAttemptOn = "login_attempt_on"
// FieldLoginLockedUntil holds the string denoting the login_locked_until field in the database.
FieldLoginLockedUntil = "login_locked_until"
// FieldFirstName holds the string denoting the first_name field in the database.
FieldFirstName = "first_name"
// FieldMiddleName holds the string denoting the middle_name field in the database.
FieldMiddleName = "middle_name"
// FieldLastName holds the string denoting the last_name field in the database.
FieldLastName = "last_name"
// FieldStatus holds the string denoting the status field in the database.
FieldStatus = "status"
// EdgeSessions holds the string denoting the sessions edge name in mutations.
EdgeSessions = "sessions"
// EdgeAuditLogs holds the string denoting the audit_logs edge name in mutations.
EdgeAuditLogs = "audit_logs"
// Table holds the table name of the user in the database.
Table = "users"
// SessionsTable is the table that holds the sessions relation/edge.
SessionsTable = "user_sessions"
// SessionsInverseTable is the table name for the UserSession entity.
// It exists in this package in order to avoid circular dependency with the "usersession" package.
SessionsInverseTable = "user_sessions"
// SessionsColumn is the table column denoting the sessions relation/edge.
SessionsColumn = "user_id"
// AuditLogsTable is the table that holds the audit_logs relation/edge.
AuditLogsTable = "audits"
// AuditLogsInverseTable is the table name for the Audit entity.
// It exists in this package in order to avoid circular dependency with the "audit" package.
AuditLogsInverseTable = "audits"
// AuditLogsColumn is the table column denoting the audit_logs relation/edge.
AuditLogsColumn = "user_id"
)
// Columns holds all SQL columns for user fields.
var Columns = []string{
FieldID,
FieldCreatedAt,
FieldUpdatedAt,
FieldEmail,
FieldEmailVerified,
FieldPhone,
FieldPhoneVerified,
FieldPwdSalt,
FieldPwdHash,
FieldLoginFailedCount,
FieldLoginAttemptOn,
FieldLoginLockedUntil,
FieldFirstName,
FieldMiddleName,
FieldLastName,
FieldStatus,
}
// 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 (
// 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
// EmailValidator is a validator for the "email" field. It is called by the builders before save.
EmailValidator func(string) error
// DefaultEmailVerified holds the default value on creation for the "email_verified" field.
DefaultEmailVerified bool
// PhoneValidator is a validator for the "phone" field. It is called by the builders before save.
PhoneValidator func(string) error
// DefaultPhoneVerified holds the default value on creation for the "phone_verified" field.
DefaultPhoneVerified bool
// PwdSaltValidator is a validator for the "pwd_salt" field. It is called by the builders before save.
PwdSaltValidator func(string) error
// PwdHashValidator is a validator for the "pwd_hash" field. It is called by the builders before save.
PwdHashValidator func(string) error
// DefaultLoginFailedCount holds the default value on creation for the "login_failed_count" field.
DefaultLoginFailedCount uint8
// FirstNameValidator is a validator for the "first_name" field. It is called by the builders before save.
FirstNameValidator func(string) error
// MiddleNameValidator is a validator for the "middle_name" field. It is called by the builders before save.
MiddleNameValidator func(string) error
// LastNameValidator is a validator for the "last_name" field. It is called by the builders before save.
LastNameValidator func(string) error
)
// Status defines the type for the "status" enum field.
type Status string
// StatusPending is the default value of the Status enum.
const DefaultStatus = StatusPending
// Status values.
const (
StatusPending Status = "Pending"
StatusActive Status = "Active"
StatusInActive Status = "InActive"
)
func (s Status) String() string {
return string(s)
}
// StatusValidator is a validator for the "status" field enum values. It is called by the builders before save.
func StatusValidator(s Status) error {
switch s {
case StatusPending, StatusActive, StatusInActive:
return nil
default:
return fmt.Errorf("user: invalid enum value for status field: %q", s)
}
}
// 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()
}
// 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()
}
// ByEmail orders the results by the email field.
func ByEmail(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldEmail, opts...).ToFunc()
}
// ByEmailVerified orders the results by the email_verified field.
func ByEmailVerified(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldEmailVerified, opts...).ToFunc()
}
// ByPhone orders the results by the phone field.
func ByPhone(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldPhone, opts...).ToFunc()
}
// ByPhoneVerified orders the results by the phone_verified field.
func ByPhoneVerified(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldPhoneVerified, opts...).ToFunc()
}
// ByPwdSalt orders the results by the pwd_salt field.
func ByPwdSalt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldPwdSalt, opts...).ToFunc()
}
// ByPwdHash orders the results by the pwd_hash field.
func ByPwdHash(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldPwdHash, opts...).ToFunc()
}
// ByLoginFailedCount orders the results by the login_failed_count field.
func ByLoginFailedCount(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldLoginFailedCount, opts...).ToFunc()
}
// ByLoginAttemptOn orders the results by the login_attempt_on field.
func ByLoginAttemptOn(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldLoginAttemptOn, opts...).ToFunc()
}
// ByLoginLockedUntil orders the results by the login_locked_until field.
func ByLoginLockedUntil(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldLoginLockedUntil, opts...).ToFunc()
}
// ByFirstName orders the results by the first_name field.
func ByFirstName(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldFirstName, opts...).ToFunc()
}
// ByMiddleName orders the results by the middle_name field.
func ByMiddleName(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldMiddleName, opts...).ToFunc()
}
// ByLastName orders the results by the last_name field.
func ByLastName(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldLastName, opts...).ToFunc()
}
// ByStatus orders the results by the status field.
func ByStatus(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldStatus, opts...).ToFunc()
}
// BySessionsCount orders the results by sessions count.
func BySessionsCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newSessionsStep(), opts...)
}
}
// BySessions orders the results by sessions terms.
func BySessions(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newSessionsStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// ByAuditLogsCount orders the results by audit_logs count.
func ByAuditLogsCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newAuditLogsStep(), opts...)
}
}
// ByAuditLogs orders the results by audit_logs terms.
func ByAuditLogs(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newAuditLogsStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
func newSessionsStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(SessionsInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, SessionsTable, SessionsColumn),
)
}
func newAuditLogsStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(AuditLogsInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, AuditLogsTable, AuditLogsColumn),
)
}

912
db/ent/user/where.go Normal file
View File

@@ -0,0 +1,912 @@
// Code generated by ent, DO NOT EDIT.
package user
import (
"time"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"gitserver.in/patialtech/rano/db/ent/predicate"
)
// ID filters vertices based on their ID field.
func ID(id int64) predicate.User {
return predicate.User(sql.FieldEQ(FieldID, id))
}
// IDEQ applies the EQ predicate on the ID field.
func IDEQ(id int64) predicate.User {
return predicate.User(sql.FieldEQ(FieldID, id))
}
// IDNEQ applies the NEQ predicate on the ID field.
func IDNEQ(id int64) predicate.User {
return predicate.User(sql.FieldNEQ(FieldID, id))
}
// IDIn applies the In predicate on the ID field.
func IDIn(ids ...int64) predicate.User {
return predicate.User(sql.FieldIn(FieldID, ids...))
}
// IDNotIn applies the NotIn predicate on the ID field.
func IDNotIn(ids ...int64) predicate.User {
return predicate.User(sql.FieldNotIn(FieldID, ids...))
}
// IDGT applies the GT predicate on the ID field.
func IDGT(id int64) predicate.User {
return predicate.User(sql.FieldGT(FieldID, id))
}
// IDGTE applies the GTE predicate on the ID field.
func IDGTE(id int64) predicate.User {
return predicate.User(sql.FieldGTE(FieldID, id))
}
// IDLT applies the LT predicate on the ID field.
func IDLT(id int64) predicate.User {
return predicate.User(sql.FieldLT(FieldID, id))
}
// IDLTE applies the LTE predicate on the ID field.
func IDLTE(id int64) predicate.User {
return predicate.User(sql.FieldLTE(FieldID, id))
}
// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
func CreatedAt(v time.Time) predicate.User {
return predicate.User(sql.FieldEQ(FieldCreatedAt, v))
}
// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.
func UpdatedAt(v time.Time) predicate.User {
return predicate.User(sql.FieldEQ(FieldUpdatedAt, v))
}
// Email applies equality check predicate on the "email" field. It's identical to EmailEQ.
func Email(v string) predicate.User {
return predicate.User(sql.FieldEQ(FieldEmail, v))
}
// EmailVerified applies equality check predicate on the "email_verified" field. It's identical to EmailVerifiedEQ.
func EmailVerified(v bool) predicate.User {
return predicate.User(sql.FieldEQ(FieldEmailVerified, v))
}
// Phone applies equality check predicate on the "phone" field. It's identical to PhoneEQ.
func Phone(v string) predicate.User {
return predicate.User(sql.FieldEQ(FieldPhone, v))
}
// PhoneVerified applies equality check predicate on the "phone_verified" field. It's identical to PhoneVerifiedEQ.
func PhoneVerified(v bool) predicate.User {
return predicate.User(sql.FieldEQ(FieldPhoneVerified, v))
}
// PwdSalt applies equality check predicate on the "pwd_salt" field. It's identical to PwdSaltEQ.
func PwdSalt(v string) predicate.User {
return predicate.User(sql.FieldEQ(FieldPwdSalt, v))
}
// PwdHash applies equality check predicate on the "pwd_hash" field. It's identical to PwdHashEQ.
func PwdHash(v string) predicate.User {
return predicate.User(sql.FieldEQ(FieldPwdHash, v))
}
// LoginFailedCount applies equality check predicate on the "login_failed_count" field. It's identical to LoginFailedCountEQ.
func LoginFailedCount(v uint8) predicate.User {
return predicate.User(sql.FieldEQ(FieldLoginFailedCount, v))
}
// LoginAttemptOn applies equality check predicate on the "login_attempt_on" field. It's identical to LoginAttemptOnEQ.
func LoginAttemptOn(v time.Time) predicate.User {
return predicate.User(sql.FieldEQ(FieldLoginAttemptOn, v))
}
// LoginLockedUntil applies equality check predicate on the "login_locked_until" field. It's identical to LoginLockedUntilEQ.
func LoginLockedUntil(v time.Time) predicate.User {
return predicate.User(sql.FieldEQ(FieldLoginLockedUntil, v))
}
// FirstName applies equality check predicate on the "first_name" field. It's identical to FirstNameEQ.
func FirstName(v string) predicate.User {
return predicate.User(sql.FieldEQ(FieldFirstName, v))
}
// MiddleName applies equality check predicate on the "middle_name" field. It's identical to MiddleNameEQ.
func MiddleName(v string) predicate.User {
return predicate.User(sql.FieldEQ(FieldMiddleName, v))
}
// LastName applies equality check predicate on the "last_name" field. It's identical to LastNameEQ.
func LastName(v string) predicate.User {
return predicate.User(sql.FieldEQ(FieldLastName, v))
}
// CreatedAtEQ applies the EQ predicate on the "created_at" field.
func CreatedAtEQ(v time.Time) predicate.User {
return predicate.User(sql.FieldEQ(FieldCreatedAt, v))
}
// CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
func CreatedAtNEQ(v time.Time) predicate.User {
return predicate.User(sql.FieldNEQ(FieldCreatedAt, v))
}
// CreatedAtIn applies the In predicate on the "created_at" field.
func CreatedAtIn(vs ...time.Time) predicate.User {
return predicate.User(sql.FieldIn(FieldCreatedAt, vs...))
}
// CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
func CreatedAtNotIn(vs ...time.Time) predicate.User {
return predicate.User(sql.FieldNotIn(FieldCreatedAt, vs...))
}
// CreatedAtGT applies the GT predicate on the "created_at" field.
func CreatedAtGT(v time.Time) predicate.User {
return predicate.User(sql.FieldGT(FieldCreatedAt, v))
}
// CreatedAtGTE applies the GTE predicate on the "created_at" field.
func CreatedAtGTE(v time.Time) predicate.User {
return predicate.User(sql.FieldGTE(FieldCreatedAt, v))
}
// CreatedAtLT applies the LT predicate on the "created_at" field.
func CreatedAtLT(v time.Time) predicate.User {
return predicate.User(sql.FieldLT(FieldCreatedAt, v))
}
// CreatedAtLTE applies the LTE predicate on the "created_at" field.
func CreatedAtLTE(v time.Time) predicate.User {
return predicate.User(sql.FieldLTE(FieldCreatedAt, v))
}
// UpdatedAtEQ applies the EQ predicate on the "updated_at" field.
func UpdatedAtEQ(v time.Time) predicate.User {
return predicate.User(sql.FieldEQ(FieldUpdatedAt, v))
}
// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.
func UpdatedAtNEQ(v time.Time) predicate.User {
return predicate.User(sql.FieldNEQ(FieldUpdatedAt, v))
}
// UpdatedAtIn applies the In predicate on the "updated_at" field.
func UpdatedAtIn(vs ...time.Time) predicate.User {
return predicate.User(sql.FieldIn(FieldUpdatedAt, vs...))
}
// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.
func UpdatedAtNotIn(vs ...time.Time) predicate.User {
return predicate.User(sql.FieldNotIn(FieldUpdatedAt, vs...))
}
// UpdatedAtGT applies the GT predicate on the "updated_at" field.
func UpdatedAtGT(v time.Time) predicate.User {
return predicate.User(sql.FieldGT(FieldUpdatedAt, v))
}
// UpdatedAtGTE applies the GTE predicate on the "updated_at" field.
func UpdatedAtGTE(v time.Time) predicate.User {
return predicate.User(sql.FieldGTE(FieldUpdatedAt, v))
}
// UpdatedAtLT applies the LT predicate on the "updated_at" field.
func UpdatedAtLT(v time.Time) predicate.User {
return predicate.User(sql.FieldLT(FieldUpdatedAt, v))
}
// UpdatedAtLTE applies the LTE predicate on the "updated_at" field.
func UpdatedAtLTE(v time.Time) predicate.User {
return predicate.User(sql.FieldLTE(FieldUpdatedAt, v))
}
// EmailEQ applies the EQ predicate on the "email" field.
func EmailEQ(v string) predicate.User {
return predicate.User(sql.FieldEQ(FieldEmail, v))
}
// EmailNEQ applies the NEQ predicate on the "email" field.
func EmailNEQ(v string) predicate.User {
return predicate.User(sql.FieldNEQ(FieldEmail, v))
}
// EmailIn applies the In predicate on the "email" field.
func EmailIn(vs ...string) predicate.User {
return predicate.User(sql.FieldIn(FieldEmail, vs...))
}
// EmailNotIn applies the NotIn predicate on the "email" field.
func EmailNotIn(vs ...string) predicate.User {
return predicate.User(sql.FieldNotIn(FieldEmail, vs...))
}
// EmailGT applies the GT predicate on the "email" field.
func EmailGT(v string) predicate.User {
return predicate.User(sql.FieldGT(FieldEmail, v))
}
// EmailGTE applies the GTE predicate on the "email" field.
func EmailGTE(v string) predicate.User {
return predicate.User(sql.FieldGTE(FieldEmail, v))
}
// EmailLT applies the LT predicate on the "email" field.
func EmailLT(v string) predicate.User {
return predicate.User(sql.FieldLT(FieldEmail, v))
}
// EmailLTE applies the LTE predicate on the "email" field.
func EmailLTE(v string) predicate.User {
return predicate.User(sql.FieldLTE(FieldEmail, v))
}
// EmailContains applies the Contains predicate on the "email" field.
func EmailContains(v string) predicate.User {
return predicate.User(sql.FieldContains(FieldEmail, v))
}
// EmailHasPrefix applies the HasPrefix predicate on the "email" field.
func EmailHasPrefix(v string) predicate.User {
return predicate.User(sql.FieldHasPrefix(FieldEmail, v))
}
// EmailHasSuffix applies the HasSuffix predicate on the "email" field.
func EmailHasSuffix(v string) predicate.User {
return predicate.User(sql.FieldHasSuffix(FieldEmail, v))
}
// EmailEqualFold applies the EqualFold predicate on the "email" field.
func EmailEqualFold(v string) predicate.User {
return predicate.User(sql.FieldEqualFold(FieldEmail, v))
}
// EmailContainsFold applies the ContainsFold predicate on the "email" field.
func EmailContainsFold(v string) predicate.User {
return predicate.User(sql.FieldContainsFold(FieldEmail, v))
}
// EmailVerifiedEQ applies the EQ predicate on the "email_verified" field.
func EmailVerifiedEQ(v bool) predicate.User {
return predicate.User(sql.FieldEQ(FieldEmailVerified, v))
}
// EmailVerifiedNEQ applies the NEQ predicate on the "email_verified" field.
func EmailVerifiedNEQ(v bool) predicate.User {
return predicate.User(sql.FieldNEQ(FieldEmailVerified, v))
}
// PhoneEQ applies the EQ predicate on the "phone" field.
func PhoneEQ(v string) predicate.User {
return predicate.User(sql.FieldEQ(FieldPhone, v))
}
// PhoneNEQ applies the NEQ predicate on the "phone" field.
func PhoneNEQ(v string) predicate.User {
return predicate.User(sql.FieldNEQ(FieldPhone, v))
}
// PhoneIn applies the In predicate on the "phone" field.
func PhoneIn(vs ...string) predicate.User {
return predicate.User(sql.FieldIn(FieldPhone, vs...))
}
// PhoneNotIn applies the NotIn predicate on the "phone" field.
func PhoneNotIn(vs ...string) predicate.User {
return predicate.User(sql.FieldNotIn(FieldPhone, vs...))
}
// PhoneGT applies the GT predicate on the "phone" field.
func PhoneGT(v string) predicate.User {
return predicate.User(sql.FieldGT(FieldPhone, v))
}
// PhoneGTE applies the GTE predicate on the "phone" field.
func PhoneGTE(v string) predicate.User {
return predicate.User(sql.FieldGTE(FieldPhone, v))
}
// PhoneLT applies the LT predicate on the "phone" field.
func PhoneLT(v string) predicate.User {
return predicate.User(sql.FieldLT(FieldPhone, v))
}
// PhoneLTE applies the LTE predicate on the "phone" field.
func PhoneLTE(v string) predicate.User {
return predicate.User(sql.FieldLTE(FieldPhone, v))
}
// PhoneContains applies the Contains predicate on the "phone" field.
func PhoneContains(v string) predicate.User {
return predicate.User(sql.FieldContains(FieldPhone, v))
}
// PhoneHasPrefix applies the HasPrefix predicate on the "phone" field.
func PhoneHasPrefix(v string) predicate.User {
return predicate.User(sql.FieldHasPrefix(FieldPhone, v))
}
// PhoneHasSuffix applies the HasSuffix predicate on the "phone" field.
func PhoneHasSuffix(v string) predicate.User {
return predicate.User(sql.FieldHasSuffix(FieldPhone, v))
}
// PhoneEqualFold applies the EqualFold predicate on the "phone" field.
func PhoneEqualFold(v string) predicate.User {
return predicate.User(sql.FieldEqualFold(FieldPhone, v))
}
// PhoneContainsFold applies the ContainsFold predicate on the "phone" field.
func PhoneContainsFold(v string) predicate.User {
return predicate.User(sql.FieldContainsFold(FieldPhone, v))
}
// PhoneVerifiedEQ applies the EQ predicate on the "phone_verified" field.
func PhoneVerifiedEQ(v bool) predicate.User {
return predicate.User(sql.FieldEQ(FieldPhoneVerified, v))
}
// PhoneVerifiedNEQ applies the NEQ predicate on the "phone_verified" field.
func PhoneVerifiedNEQ(v bool) predicate.User {
return predicate.User(sql.FieldNEQ(FieldPhoneVerified, v))
}
// PwdSaltEQ applies the EQ predicate on the "pwd_salt" field.
func PwdSaltEQ(v string) predicate.User {
return predicate.User(sql.FieldEQ(FieldPwdSalt, v))
}
// PwdSaltNEQ applies the NEQ predicate on the "pwd_salt" field.
func PwdSaltNEQ(v string) predicate.User {
return predicate.User(sql.FieldNEQ(FieldPwdSalt, v))
}
// PwdSaltIn applies the In predicate on the "pwd_salt" field.
func PwdSaltIn(vs ...string) predicate.User {
return predicate.User(sql.FieldIn(FieldPwdSalt, vs...))
}
// PwdSaltNotIn applies the NotIn predicate on the "pwd_salt" field.
func PwdSaltNotIn(vs ...string) predicate.User {
return predicate.User(sql.FieldNotIn(FieldPwdSalt, vs...))
}
// PwdSaltGT applies the GT predicate on the "pwd_salt" field.
func PwdSaltGT(v string) predicate.User {
return predicate.User(sql.FieldGT(FieldPwdSalt, v))
}
// PwdSaltGTE applies the GTE predicate on the "pwd_salt" field.
func PwdSaltGTE(v string) predicate.User {
return predicate.User(sql.FieldGTE(FieldPwdSalt, v))
}
// PwdSaltLT applies the LT predicate on the "pwd_salt" field.
func PwdSaltLT(v string) predicate.User {
return predicate.User(sql.FieldLT(FieldPwdSalt, v))
}
// PwdSaltLTE applies the LTE predicate on the "pwd_salt" field.
func PwdSaltLTE(v string) predicate.User {
return predicate.User(sql.FieldLTE(FieldPwdSalt, v))
}
// PwdSaltContains applies the Contains predicate on the "pwd_salt" field.
func PwdSaltContains(v string) predicate.User {
return predicate.User(sql.FieldContains(FieldPwdSalt, v))
}
// PwdSaltHasPrefix applies the HasPrefix predicate on the "pwd_salt" field.
func PwdSaltHasPrefix(v string) predicate.User {
return predicate.User(sql.FieldHasPrefix(FieldPwdSalt, v))
}
// PwdSaltHasSuffix applies the HasSuffix predicate on the "pwd_salt" field.
func PwdSaltHasSuffix(v string) predicate.User {
return predicate.User(sql.FieldHasSuffix(FieldPwdSalt, v))
}
// PwdSaltEqualFold applies the EqualFold predicate on the "pwd_salt" field.
func PwdSaltEqualFold(v string) predicate.User {
return predicate.User(sql.FieldEqualFold(FieldPwdSalt, v))
}
// PwdSaltContainsFold applies the ContainsFold predicate on the "pwd_salt" field.
func PwdSaltContainsFold(v string) predicate.User {
return predicate.User(sql.FieldContainsFold(FieldPwdSalt, v))
}
// PwdHashEQ applies the EQ predicate on the "pwd_hash" field.
func PwdHashEQ(v string) predicate.User {
return predicate.User(sql.FieldEQ(FieldPwdHash, v))
}
// PwdHashNEQ applies the NEQ predicate on the "pwd_hash" field.
func PwdHashNEQ(v string) predicate.User {
return predicate.User(sql.FieldNEQ(FieldPwdHash, v))
}
// PwdHashIn applies the In predicate on the "pwd_hash" field.
func PwdHashIn(vs ...string) predicate.User {
return predicate.User(sql.FieldIn(FieldPwdHash, vs...))
}
// PwdHashNotIn applies the NotIn predicate on the "pwd_hash" field.
func PwdHashNotIn(vs ...string) predicate.User {
return predicate.User(sql.FieldNotIn(FieldPwdHash, vs...))
}
// PwdHashGT applies the GT predicate on the "pwd_hash" field.
func PwdHashGT(v string) predicate.User {
return predicate.User(sql.FieldGT(FieldPwdHash, v))
}
// PwdHashGTE applies the GTE predicate on the "pwd_hash" field.
func PwdHashGTE(v string) predicate.User {
return predicate.User(sql.FieldGTE(FieldPwdHash, v))
}
// PwdHashLT applies the LT predicate on the "pwd_hash" field.
func PwdHashLT(v string) predicate.User {
return predicate.User(sql.FieldLT(FieldPwdHash, v))
}
// PwdHashLTE applies the LTE predicate on the "pwd_hash" field.
func PwdHashLTE(v string) predicate.User {
return predicate.User(sql.FieldLTE(FieldPwdHash, v))
}
// PwdHashContains applies the Contains predicate on the "pwd_hash" field.
func PwdHashContains(v string) predicate.User {
return predicate.User(sql.FieldContains(FieldPwdHash, v))
}
// PwdHashHasPrefix applies the HasPrefix predicate on the "pwd_hash" field.
func PwdHashHasPrefix(v string) predicate.User {
return predicate.User(sql.FieldHasPrefix(FieldPwdHash, v))
}
// PwdHashHasSuffix applies the HasSuffix predicate on the "pwd_hash" field.
func PwdHashHasSuffix(v string) predicate.User {
return predicate.User(sql.FieldHasSuffix(FieldPwdHash, v))
}
// PwdHashEqualFold applies the EqualFold predicate on the "pwd_hash" field.
func PwdHashEqualFold(v string) predicate.User {
return predicate.User(sql.FieldEqualFold(FieldPwdHash, v))
}
// PwdHashContainsFold applies the ContainsFold predicate on the "pwd_hash" field.
func PwdHashContainsFold(v string) predicate.User {
return predicate.User(sql.FieldContainsFold(FieldPwdHash, v))
}
// LoginFailedCountEQ applies the EQ predicate on the "login_failed_count" field.
func LoginFailedCountEQ(v uint8) predicate.User {
return predicate.User(sql.FieldEQ(FieldLoginFailedCount, v))
}
// LoginFailedCountNEQ applies the NEQ predicate on the "login_failed_count" field.
func LoginFailedCountNEQ(v uint8) predicate.User {
return predicate.User(sql.FieldNEQ(FieldLoginFailedCount, v))
}
// LoginFailedCountIn applies the In predicate on the "login_failed_count" field.
func LoginFailedCountIn(vs ...uint8) predicate.User {
return predicate.User(sql.FieldIn(FieldLoginFailedCount, vs...))
}
// LoginFailedCountNotIn applies the NotIn predicate on the "login_failed_count" field.
func LoginFailedCountNotIn(vs ...uint8) predicate.User {
return predicate.User(sql.FieldNotIn(FieldLoginFailedCount, vs...))
}
// LoginFailedCountGT applies the GT predicate on the "login_failed_count" field.
func LoginFailedCountGT(v uint8) predicate.User {
return predicate.User(sql.FieldGT(FieldLoginFailedCount, v))
}
// LoginFailedCountGTE applies the GTE predicate on the "login_failed_count" field.
func LoginFailedCountGTE(v uint8) predicate.User {
return predicate.User(sql.FieldGTE(FieldLoginFailedCount, v))
}
// LoginFailedCountLT applies the LT predicate on the "login_failed_count" field.
func LoginFailedCountLT(v uint8) predicate.User {
return predicate.User(sql.FieldLT(FieldLoginFailedCount, v))
}
// LoginFailedCountLTE applies the LTE predicate on the "login_failed_count" field.
func LoginFailedCountLTE(v uint8) predicate.User {
return predicate.User(sql.FieldLTE(FieldLoginFailedCount, v))
}
// LoginFailedCountIsNil applies the IsNil predicate on the "login_failed_count" field.
func LoginFailedCountIsNil() predicate.User {
return predicate.User(sql.FieldIsNull(FieldLoginFailedCount))
}
// LoginFailedCountNotNil applies the NotNil predicate on the "login_failed_count" field.
func LoginFailedCountNotNil() predicate.User {
return predicate.User(sql.FieldNotNull(FieldLoginFailedCount))
}
// LoginAttemptOnEQ applies the EQ predicate on the "login_attempt_on" field.
func LoginAttemptOnEQ(v time.Time) predicate.User {
return predicate.User(sql.FieldEQ(FieldLoginAttemptOn, v))
}
// LoginAttemptOnNEQ applies the NEQ predicate on the "login_attempt_on" field.
func LoginAttemptOnNEQ(v time.Time) predicate.User {
return predicate.User(sql.FieldNEQ(FieldLoginAttemptOn, v))
}
// LoginAttemptOnIn applies the In predicate on the "login_attempt_on" field.
func LoginAttemptOnIn(vs ...time.Time) predicate.User {
return predicate.User(sql.FieldIn(FieldLoginAttemptOn, vs...))
}
// LoginAttemptOnNotIn applies the NotIn predicate on the "login_attempt_on" field.
func LoginAttemptOnNotIn(vs ...time.Time) predicate.User {
return predicate.User(sql.FieldNotIn(FieldLoginAttemptOn, vs...))
}
// LoginAttemptOnGT applies the GT predicate on the "login_attempt_on" field.
func LoginAttemptOnGT(v time.Time) predicate.User {
return predicate.User(sql.FieldGT(FieldLoginAttemptOn, v))
}
// LoginAttemptOnGTE applies the GTE predicate on the "login_attempt_on" field.
func LoginAttemptOnGTE(v time.Time) predicate.User {
return predicate.User(sql.FieldGTE(FieldLoginAttemptOn, v))
}
// LoginAttemptOnLT applies the LT predicate on the "login_attempt_on" field.
func LoginAttemptOnLT(v time.Time) predicate.User {
return predicate.User(sql.FieldLT(FieldLoginAttemptOn, v))
}
// LoginAttemptOnLTE applies the LTE predicate on the "login_attempt_on" field.
func LoginAttemptOnLTE(v time.Time) predicate.User {
return predicate.User(sql.FieldLTE(FieldLoginAttemptOn, v))
}
// LoginAttemptOnIsNil applies the IsNil predicate on the "login_attempt_on" field.
func LoginAttemptOnIsNil() predicate.User {
return predicate.User(sql.FieldIsNull(FieldLoginAttemptOn))
}
// LoginAttemptOnNotNil applies the NotNil predicate on the "login_attempt_on" field.
func LoginAttemptOnNotNil() predicate.User {
return predicate.User(sql.FieldNotNull(FieldLoginAttemptOn))
}
// LoginLockedUntilEQ applies the EQ predicate on the "login_locked_until" field.
func LoginLockedUntilEQ(v time.Time) predicate.User {
return predicate.User(sql.FieldEQ(FieldLoginLockedUntil, v))
}
// LoginLockedUntilNEQ applies the NEQ predicate on the "login_locked_until" field.
func LoginLockedUntilNEQ(v time.Time) predicate.User {
return predicate.User(sql.FieldNEQ(FieldLoginLockedUntil, v))
}
// LoginLockedUntilIn applies the In predicate on the "login_locked_until" field.
func LoginLockedUntilIn(vs ...time.Time) predicate.User {
return predicate.User(sql.FieldIn(FieldLoginLockedUntil, vs...))
}
// LoginLockedUntilNotIn applies the NotIn predicate on the "login_locked_until" field.
func LoginLockedUntilNotIn(vs ...time.Time) predicate.User {
return predicate.User(sql.FieldNotIn(FieldLoginLockedUntil, vs...))
}
// LoginLockedUntilGT applies the GT predicate on the "login_locked_until" field.
func LoginLockedUntilGT(v time.Time) predicate.User {
return predicate.User(sql.FieldGT(FieldLoginLockedUntil, v))
}
// LoginLockedUntilGTE applies the GTE predicate on the "login_locked_until" field.
func LoginLockedUntilGTE(v time.Time) predicate.User {
return predicate.User(sql.FieldGTE(FieldLoginLockedUntil, v))
}
// LoginLockedUntilLT applies the LT predicate on the "login_locked_until" field.
func LoginLockedUntilLT(v time.Time) predicate.User {
return predicate.User(sql.FieldLT(FieldLoginLockedUntil, v))
}
// LoginLockedUntilLTE applies the LTE predicate on the "login_locked_until" field.
func LoginLockedUntilLTE(v time.Time) predicate.User {
return predicate.User(sql.FieldLTE(FieldLoginLockedUntil, v))
}
// LoginLockedUntilIsNil applies the IsNil predicate on the "login_locked_until" field.
func LoginLockedUntilIsNil() predicate.User {
return predicate.User(sql.FieldIsNull(FieldLoginLockedUntil))
}
// LoginLockedUntilNotNil applies the NotNil predicate on the "login_locked_until" field.
func LoginLockedUntilNotNil() predicate.User {
return predicate.User(sql.FieldNotNull(FieldLoginLockedUntil))
}
// FirstNameEQ applies the EQ predicate on the "first_name" field.
func FirstNameEQ(v string) predicate.User {
return predicate.User(sql.FieldEQ(FieldFirstName, v))
}
// FirstNameNEQ applies the NEQ predicate on the "first_name" field.
func FirstNameNEQ(v string) predicate.User {
return predicate.User(sql.FieldNEQ(FieldFirstName, v))
}
// FirstNameIn applies the In predicate on the "first_name" field.
func FirstNameIn(vs ...string) predicate.User {
return predicate.User(sql.FieldIn(FieldFirstName, vs...))
}
// FirstNameNotIn applies the NotIn predicate on the "first_name" field.
func FirstNameNotIn(vs ...string) predicate.User {
return predicate.User(sql.FieldNotIn(FieldFirstName, vs...))
}
// FirstNameGT applies the GT predicate on the "first_name" field.
func FirstNameGT(v string) predicate.User {
return predicate.User(sql.FieldGT(FieldFirstName, v))
}
// FirstNameGTE applies the GTE predicate on the "first_name" field.
func FirstNameGTE(v string) predicate.User {
return predicate.User(sql.FieldGTE(FieldFirstName, v))
}
// FirstNameLT applies the LT predicate on the "first_name" field.
func FirstNameLT(v string) predicate.User {
return predicate.User(sql.FieldLT(FieldFirstName, v))
}
// FirstNameLTE applies the LTE predicate on the "first_name" field.
func FirstNameLTE(v string) predicate.User {
return predicate.User(sql.FieldLTE(FieldFirstName, v))
}
// FirstNameContains applies the Contains predicate on the "first_name" field.
func FirstNameContains(v string) predicate.User {
return predicate.User(sql.FieldContains(FieldFirstName, v))
}
// FirstNameHasPrefix applies the HasPrefix predicate on the "first_name" field.
func FirstNameHasPrefix(v string) predicate.User {
return predicate.User(sql.FieldHasPrefix(FieldFirstName, v))
}
// FirstNameHasSuffix applies the HasSuffix predicate on the "first_name" field.
func FirstNameHasSuffix(v string) predicate.User {
return predicate.User(sql.FieldHasSuffix(FieldFirstName, v))
}
// FirstNameEqualFold applies the EqualFold predicate on the "first_name" field.
func FirstNameEqualFold(v string) predicate.User {
return predicate.User(sql.FieldEqualFold(FieldFirstName, v))
}
// FirstNameContainsFold applies the ContainsFold predicate on the "first_name" field.
func FirstNameContainsFold(v string) predicate.User {
return predicate.User(sql.FieldContainsFold(FieldFirstName, v))
}
// MiddleNameEQ applies the EQ predicate on the "middle_name" field.
func MiddleNameEQ(v string) predicate.User {
return predicate.User(sql.FieldEQ(FieldMiddleName, v))
}
// MiddleNameNEQ applies the NEQ predicate on the "middle_name" field.
func MiddleNameNEQ(v string) predicate.User {
return predicate.User(sql.FieldNEQ(FieldMiddleName, v))
}
// MiddleNameIn applies the In predicate on the "middle_name" field.
func MiddleNameIn(vs ...string) predicate.User {
return predicate.User(sql.FieldIn(FieldMiddleName, vs...))
}
// MiddleNameNotIn applies the NotIn predicate on the "middle_name" field.
func MiddleNameNotIn(vs ...string) predicate.User {
return predicate.User(sql.FieldNotIn(FieldMiddleName, vs...))
}
// MiddleNameGT applies the GT predicate on the "middle_name" field.
func MiddleNameGT(v string) predicate.User {
return predicate.User(sql.FieldGT(FieldMiddleName, v))
}
// MiddleNameGTE applies the GTE predicate on the "middle_name" field.
func MiddleNameGTE(v string) predicate.User {
return predicate.User(sql.FieldGTE(FieldMiddleName, v))
}
// MiddleNameLT applies the LT predicate on the "middle_name" field.
func MiddleNameLT(v string) predicate.User {
return predicate.User(sql.FieldLT(FieldMiddleName, v))
}
// MiddleNameLTE applies the LTE predicate on the "middle_name" field.
func MiddleNameLTE(v string) predicate.User {
return predicate.User(sql.FieldLTE(FieldMiddleName, v))
}
// MiddleNameContains applies the Contains predicate on the "middle_name" field.
func MiddleNameContains(v string) predicate.User {
return predicate.User(sql.FieldContains(FieldMiddleName, v))
}
// MiddleNameHasPrefix applies the HasPrefix predicate on the "middle_name" field.
func MiddleNameHasPrefix(v string) predicate.User {
return predicate.User(sql.FieldHasPrefix(FieldMiddleName, v))
}
// MiddleNameHasSuffix applies the HasSuffix predicate on the "middle_name" field.
func MiddleNameHasSuffix(v string) predicate.User {
return predicate.User(sql.FieldHasSuffix(FieldMiddleName, v))
}
// MiddleNameEqualFold applies the EqualFold predicate on the "middle_name" field.
func MiddleNameEqualFold(v string) predicate.User {
return predicate.User(sql.FieldEqualFold(FieldMiddleName, v))
}
// MiddleNameContainsFold applies the ContainsFold predicate on the "middle_name" field.
func MiddleNameContainsFold(v string) predicate.User {
return predicate.User(sql.FieldContainsFold(FieldMiddleName, v))
}
// LastNameEQ applies the EQ predicate on the "last_name" field.
func LastNameEQ(v string) predicate.User {
return predicate.User(sql.FieldEQ(FieldLastName, v))
}
// LastNameNEQ applies the NEQ predicate on the "last_name" field.
func LastNameNEQ(v string) predicate.User {
return predicate.User(sql.FieldNEQ(FieldLastName, v))
}
// LastNameIn applies the In predicate on the "last_name" field.
func LastNameIn(vs ...string) predicate.User {
return predicate.User(sql.FieldIn(FieldLastName, vs...))
}
// LastNameNotIn applies the NotIn predicate on the "last_name" field.
func LastNameNotIn(vs ...string) predicate.User {
return predicate.User(sql.FieldNotIn(FieldLastName, vs...))
}
// LastNameGT applies the GT predicate on the "last_name" field.
func LastNameGT(v string) predicate.User {
return predicate.User(sql.FieldGT(FieldLastName, v))
}
// LastNameGTE applies the GTE predicate on the "last_name" field.
func LastNameGTE(v string) predicate.User {
return predicate.User(sql.FieldGTE(FieldLastName, v))
}
// LastNameLT applies the LT predicate on the "last_name" field.
func LastNameLT(v string) predicate.User {
return predicate.User(sql.FieldLT(FieldLastName, v))
}
// LastNameLTE applies the LTE predicate on the "last_name" field.
func LastNameLTE(v string) predicate.User {
return predicate.User(sql.FieldLTE(FieldLastName, v))
}
// LastNameContains applies the Contains predicate on the "last_name" field.
func LastNameContains(v string) predicate.User {
return predicate.User(sql.FieldContains(FieldLastName, v))
}
// LastNameHasPrefix applies the HasPrefix predicate on the "last_name" field.
func LastNameHasPrefix(v string) predicate.User {
return predicate.User(sql.FieldHasPrefix(FieldLastName, v))
}
// LastNameHasSuffix applies the HasSuffix predicate on the "last_name" field.
func LastNameHasSuffix(v string) predicate.User {
return predicate.User(sql.FieldHasSuffix(FieldLastName, v))
}
// LastNameEqualFold applies the EqualFold predicate on the "last_name" field.
func LastNameEqualFold(v string) predicate.User {
return predicate.User(sql.FieldEqualFold(FieldLastName, v))
}
// LastNameContainsFold applies the ContainsFold predicate on the "last_name" field.
func LastNameContainsFold(v string) predicate.User {
return predicate.User(sql.FieldContainsFold(FieldLastName, v))
}
// StatusEQ applies the EQ predicate on the "status" field.
func StatusEQ(v Status) predicate.User {
return predicate.User(sql.FieldEQ(FieldStatus, v))
}
// StatusNEQ applies the NEQ predicate on the "status" field.
func StatusNEQ(v Status) predicate.User {
return predicate.User(sql.FieldNEQ(FieldStatus, v))
}
// StatusIn applies the In predicate on the "status" field.
func StatusIn(vs ...Status) predicate.User {
return predicate.User(sql.FieldIn(FieldStatus, vs...))
}
// StatusNotIn applies the NotIn predicate on the "status" field.
func StatusNotIn(vs ...Status) predicate.User {
return predicate.User(sql.FieldNotIn(FieldStatus, vs...))
}
// HasSessions applies the HasEdge predicate on the "sessions" edge.
func HasSessions() predicate.User {
return predicate.User(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, SessionsTable, SessionsColumn),
)
sqlgraph.HasNeighbors(s, step)
})
}
// HasSessionsWith applies the HasEdge predicate on the "sessions" edge with a given conditions (other predicates).
func HasSessionsWith(preds ...predicate.UserSession) predicate.User {
return predicate.User(func(s *sql.Selector) {
step := newSessionsStep()
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
for _, p := range preds {
p(s)
}
})
})
}
// HasAuditLogs applies the HasEdge predicate on the "audit_logs" edge.
func HasAuditLogs() predicate.User {
return predicate.User(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, AuditLogsTable, AuditLogsColumn),
)
sqlgraph.HasNeighbors(s, step)
})
}
// HasAuditLogsWith applies the HasEdge predicate on the "audit_logs" edge with a given conditions (other predicates).
func HasAuditLogsWith(preds ...predicate.Audit) predicate.User {
return predicate.User(func(s *sql.Selector) {
step := newAuditLogsStep()
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
for _, p := range preds {
p(s)
}
})
})
}
// And groups predicates with the AND operator between them.
func And(predicates ...predicate.User) predicate.User {
return predicate.User(sql.AndPredicates(predicates...))
}
// Or groups predicates with the OR operator between them.
func Or(predicates ...predicate.User) predicate.User {
return predicate.User(sql.OrPredicates(predicates...))
}
// Not applies the not operator on the given predicate.
func Not(p predicate.User) predicate.User {
return predicate.User(sql.NotPredicates(p))
}