// Code generated by ent, DO NOT EDIT.

package admin

import (
	"time"

	"entgo.io/ent/dialect/sql"
	"entgo.io/ent/dialect/sql/sqlgraph"
	"github.com/chaitin/MonkeyCode/backend/consts"
	"github.com/chaitin/MonkeyCode/backend/db/predicate"
	"github.com/google/uuid"
)

// ID filters vertices based on their ID field.
func ID(id uuid.UUID) predicate.Admin {
	return predicate.Admin(sql.FieldEQ(FieldID, id))
}

// IDEQ applies the EQ predicate on the ID field.
func IDEQ(id uuid.UUID) predicate.Admin {
	return predicate.Admin(sql.FieldEQ(FieldID, id))
}

// IDNEQ applies the NEQ predicate on the ID field.
func IDNEQ(id uuid.UUID) predicate.Admin {
	return predicate.Admin(sql.FieldNEQ(FieldID, id))
}

// IDIn applies the In predicate on the ID field.
func IDIn(ids ...uuid.UUID) predicate.Admin {
	return predicate.Admin(sql.FieldIn(FieldID, ids...))
}

// IDNotIn applies the NotIn predicate on the ID field.
func IDNotIn(ids ...uuid.UUID) predicate.Admin {
	return predicate.Admin(sql.FieldNotIn(FieldID, ids...))
}

// IDGT applies the GT predicate on the ID field.
func IDGT(id uuid.UUID) predicate.Admin {
	return predicate.Admin(sql.FieldGT(FieldID, id))
}

// IDGTE applies the GTE predicate on the ID field.
func IDGTE(id uuid.UUID) predicate.Admin {
	return predicate.Admin(sql.FieldGTE(FieldID, id))
}

// IDLT applies the LT predicate on the ID field.
func IDLT(id uuid.UUID) predicate.Admin {
	return predicate.Admin(sql.FieldLT(FieldID, id))
}

// IDLTE applies the LTE predicate on the ID field.
func IDLTE(id uuid.UUID) predicate.Admin {
	return predicate.Admin(sql.FieldLTE(FieldID, id))
}

// Username applies equality check predicate on the "username" field. It's identical to UsernameEQ.
func Username(v string) predicate.Admin {
	return predicate.Admin(sql.FieldEQ(FieldUsername, v))
}

// Password applies equality check predicate on the "password" field. It's identical to PasswordEQ.
func Password(v string) predicate.Admin {
	return predicate.Admin(sql.FieldEQ(FieldPassword, v))
}

// Status applies equality check predicate on the "status" field. It's identical to StatusEQ.
func Status(v consts.AdminStatus) predicate.Admin {
	vc := string(v)
	return predicate.Admin(sql.FieldEQ(FieldStatus, vc))
}

// LastActiveAt applies equality check predicate on the "last_active_at" field. It's identical to LastActiveAtEQ.
func LastActiveAt(v time.Time) predicate.Admin {
	return predicate.Admin(sql.FieldEQ(FieldLastActiveAt, v))
}

// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
func CreatedAt(v time.Time) predicate.Admin {
	return predicate.Admin(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.Admin {
	return predicate.Admin(sql.FieldEQ(FieldUpdatedAt, v))
}

// UsernameEQ applies the EQ predicate on the "username" field.
func UsernameEQ(v string) predicate.Admin {
	return predicate.Admin(sql.FieldEQ(FieldUsername, v))
}

// UsernameNEQ applies the NEQ predicate on the "username" field.
func UsernameNEQ(v string) predicate.Admin {
	return predicate.Admin(sql.FieldNEQ(FieldUsername, v))
}

// UsernameIn applies the In predicate on the "username" field.
func UsernameIn(vs ...string) predicate.Admin {
	return predicate.Admin(sql.FieldIn(FieldUsername, vs...))
}

// UsernameNotIn applies the NotIn predicate on the "username" field.
func UsernameNotIn(vs ...string) predicate.Admin {
	return predicate.Admin(sql.FieldNotIn(FieldUsername, vs...))
}

// UsernameGT applies the GT predicate on the "username" field.
func UsernameGT(v string) predicate.Admin {
	return predicate.Admin(sql.FieldGT(FieldUsername, v))
}

// UsernameGTE applies the GTE predicate on the "username" field.
func UsernameGTE(v string) predicate.Admin {
	return predicate.Admin(sql.FieldGTE(FieldUsername, v))
}

// UsernameLT applies the LT predicate on the "username" field.
func UsernameLT(v string) predicate.Admin {
	return predicate.Admin(sql.FieldLT(FieldUsername, v))
}

// UsernameLTE applies the LTE predicate on the "username" field.
func UsernameLTE(v string) predicate.Admin {
	return predicate.Admin(sql.FieldLTE(FieldUsername, v))
}

// UsernameContains applies the Contains predicate on the "username" field.
func UsernameContains(v string) predicate.Admin {
	return predicate.Admin(sql.FieldContains(FieldUsername, v))
}

// UsernameHasPrefix applies the HasPrefix predicate on the "username" field.
func UsernameHasPrefix(v string) predicate.Admin {
	return predicate.Admin(sql.FieldHasPrefix(FieldUsername, v))
}

// UsernameHasSuffix applies the HasSuffix predicate on the "username" field.
func UsernameHasSuffix(v string) predicate.Admin {
	return predicate.Admin(sql.FieldHasSuffix(FieldUsername, v))
}

// UsernameEqualFold applies the EqualFold predicate on the "username" field.
func UsernameEqualFold(v string) predicate.Admin {
	return predicate.Admin(sql.FieldEqualFold(FieldUsername, v))
}

// UsernameContainsFold applies the ContainsFold predicate on the "username" field.
func UsernameContainsFold(v string) predicate.Admin {
	return predicate.Admin(sql.FieldContainsFold(FieldUsername, v))
}

// PasswordEQ applies the EQ predicate on the "password" field.
func PasswordEQ(v string) predicate.Admin {
	return predicate.Admin(sql.FieldEQ(FieldPassword, v))
}

// PasswordNEQ applies the NEQ predicate on the "password" field.
func PasswordNEQ(v string) predicate.Admin {
	return predicate.Admin(sql.FieldNEQ(FieldPassword, v))
}

// PasswordIn applies the In predicate on the "password" field.
func PasswordIn(vs ...string) predicate.Admin {
	return predicate.Admin(sql.FieldIn(FieldPassword, vs...))
}

// PasswordNotIn applies the NotIn predicate on the "password" field.
func PasswordNotIn(vs ...string) predicate.Admin {
	return predicate.Admin(sql.FieldNotIn(FieldPassword, vs...))
}

// PasswordGT applies the GT predicate on the "password" field.
func PasswordGT(v string) predicate.Admin {
	return predicate.Admin(sql.FieldGT(FieldPassword, v))
}

// PasswordGTE applies the GTE predicate on the "password" field.
func PasswordGTE(v string) predicate.Admin {
	return predicate.Admin(sql.FieldGTE(FieldPassword, v))
}

// PasswordLT applies the LT predicate on the "password" field.
func PasswordLT(v string) predicate.Admin {
	return predicate.Admin(sql.FieldLT(FieldPassword, v))
}

// PasswordLTE applies the LTE predicate on the "password" field.
func PasswordLTE(v string) predicate.Admin {
	return predicate.Admin(sql.FieldLTE(FieldPassword, v))
}

// PasswordContains applies the Contains predicate on the "password" field.
func PasswordContains(v string) predicate.Admin {
	return predicate.Admin(sql.FieldContains(FieldPassword, v))
}

// PasswordHasPrefix applies the HasPrefix predicate on the "password" field.
func PasswordHasPrefix(v string) predicate.Admin {
	return predicate.Admin(sql.FieldHasPrefix(FieldPassword, v))
}

// PasswordHasSuffix applies the HasSuffix predicate on the "password" field.
func PasswordHasSuffix(v string) predicate.Admin {
	return predicate.Admin(sql.FieldHasSuffix(FieldPassword, v))
}

// PasswordEqualFold applies the EqualFold predicate on the "password" field.
func PasswordEqualFold(v string) predicate.Admin {
	return predicate.Admin(sql.FieldEqualFold(FieldPassword, v))
}

// PasswordContainsFold applies the ContainsFold predicate on the "password" field.
func PasswordContainsFold(v string) predicate.Admin {
	return predicate.Admin(sql.FieldContainsFold(FieldPassword, v))
}

// StatusEQ applies the EQ predicate on the "status" field.
func StatusEQ(v consts.AdminStatus) predicate.Admin {
	vc := string(v)
	return predicate.Admin(sql.FieldEQ(FieldStatus, vc))
}

// StatusNEQ applies the NEQ predicate on the "status" field.
func StatusNEQ(v consts.AdminStatus) predicate.Admin {
	vc := string(v)
	return predicate.Admin(sql.FieldNEQ(FieldStatus, vc))
}

// StatusIn applies the In predicate on the "status" field.
func StatusIn(vs ...consts.AdminStatus) predicate.Admin {
	v := make([]any, len(vs))
	for i := range v {
		v[i] = string(vs[i])
	}
	return predicate.Admin(sql.FieldIn(FieldStatus, v...))
}

// StatusNotIn applies the NotIn predicate on the "status" field.
func StatusNotIn(vs ...consts.AdminStatus) predicate.Admin {
	v := make([]any, len(vs))
	for i := range v {
		v[i] = string(vs[i])
	}
	return predicate.Admin(sql.FieldNotIn(FieldStatus, v...))
}

// StatusGT applies the GT predicate on the "status" field.
func StatusGT(v consts.AdminStatus) predicate.Admin {
	vc := string(v)
	return predicate.Admin(sql.FieldGT(FieldStatus, vc))
}

// StatusGTE applies the GTE predicate on the "status" field.
func StatusGTE(v consts.AdminStatus) predicate.Admin {
	vc := string(v)
	return predicate.Admin(sql.FieldGTE(FieldStatus, vc))
}

// StatusLT applies the LT predicate on the "status" field.
func StatusLT(v consts.AdminStatus) predicate.Admin {
	vc := string(v)
	return predicate.Admin(sql.FieldLT(FieldStatus, vc))
}

// StatusLTE applies the LTE predicate on the "status" field.
func StatusLTE(v consts.AdminStatus) predicate.Admin {
	vc := string(v)
	return predicate.Admin(sql.FieldLTE(FieldStatus, vc))
}

// StatusContains applies the Contains predicate on the "status" field.
func StatusContains(v consts.AdminStatus) predicate.Admin {
	vc := string(v)
	return predicate.Admin(sql.FieldContains(FieldStatus, vc))
}

// StatusHasPrefix applies the HasPrefix predicate on the "status" field.
func StatusHasPrefix(v consts.AdminStatus) predicate.Admin {
	vc := string(v)
	return predicate.Admin(sql.FieldHasPrefix(FieldStatus, vc))
}

// StatusHasSuffix applies the HasSuffix predicate on the "status" field.
func StatusHasSuffix(v consts.AdminStatus) predicate.Admin {
	vc := string(v)
	return predicate.Admin(sql.FieldHasSuffix(FieldStatus, vc))
}

// StatusEqualFold applies the EqualFold predicate on the "status" field.
func StatusEqualFold(v consts.AdminStatus) predicate.Admin {
	vc := string(v)
	return predicate.Admin(sql.FieldEqualFold(FieldStatus, vc))
}

// StatusContainsFold applies the ContainsFold predicate on the "status" field.
func StatusContainsFold(v consts.AdminStatus) predicate.Admin {
	vc := string(v)
	return predicate.Admin(sql.FieldContainsFold(FieldStatus, vc))
}

// LastActiveAtEQ applies the EQ predicate on the "last_active_at" field.
func LastActiveAtEQ(v time.Time) predicate.Admin {
	return predicate.Admin(sql.FieldEQ(FieldLastActiveAt, v))
}

// LastActiveAtNEQ applies the NEQ predicate on the "last_active_at" field.
func LastActiveAtNEQ(v time.Time) predicate.Admin {
	return predicate.Admin(sql.FieldNEQ(FieldLastActiveAt, v))
}

// LastActiveAtIn applies the In predicate on the "last_active_at" field.
func LastActiveAtIn(vs ...time.Time) predicate.Admin {
	return predicate.Admin(sql.FieldIn(FieldLastActiveAt, vs...))
}

// LastActiveAtNotIn applies the NotIn predicate on the "last_active_at" field.
func LastActiveAtNotIn(vs ...time.Time) predicate.Admin {
	return predicate.Admin(sql.FieldNotIn(FieldLastActiveAt, vs...))
}

// LastActiveAtGT applies the GT predicate on the "last_active_at" field.
func LastActiveAtGT(v time.Time) predicate.Admin {
	return predicate.Admin(sql.FieldGT(FieldLastActiveAt, v))
}

// LastActiveAtGTE applies the GTE predicate on the "last_active_at" field.
func LastActiveAtGTE(v time.Time) predicate.Admin {
	return predicate.Admin(sql.FieldGTE(FieldLastActiveAt, v))
}

// LastActiveAtLT applies the LT predicate on the "last_active_at" field.
func LastActiveAtLT(v time.Time) predicate.Admin {
	return predicate.Admin(sql.FieldLT(FieldLastActiveAt, v))
}

// LastActiveAtLTE applies the LTE predicate on the "last_active_at" field.
func LastActiveAtLTE(v time.Time) predicate.Admin {
	return predicate.Admin(sql.FieldLTE(FieldLastActiveAt, v))
}

// CreatedAtEQ applies the EQ predicate on the "created_at" field.
func CreatedAtEQ(v time.Time) predicate.Admin {
	return predicate.Admin(sql.FieldEQ(FieldCreatedAt, v))
}

// CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
func CreatedAtNEQ(v time.Time) predicate.Admin {
	return predicate.Admin(sql.FieldNEQ(FieldCreatedAt, v))
}

// CreatedAtIn applies the In predicate on the "created_at" field.
func CreatedAtIn(vs ...time.Time) predicate.Admin {
	return predicate.Admin(sql.FieldIn(FieldCreatedAt, vs...))
}

// CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
func CreatedAtNotIn(vs ...time.Time) predicate.Admin {
	return predicate.Admin(sql.FieldNotIn(FieldCreatedAt, vs...))
}

// CreatedAtGT applies the GT predicate on the "created_at" field.
func CreatedAtGT(v time.Time) predicate.Admin {
	return predicate.Admin(sql.FieldGT(FieldCreatedAt, v))
}

// CreatedAtGTE applies the GTE predicate on the "created_at" field.
func CreatedAtGTE(v time.Time) predicate.Admin {
	return predicate.Admin(sql.FieldGTE(FieldCreatedAt, v))
}

// CreatedAtLT applies the LT predicate on the "created_at" field.
func CreatedAtLT(v time.Time) predicate.Admin {
	return predicate.Admin(sql.FieldLT(FieldCreatedAt, v))
}

// CreatedAtLTE applies the LTE predicate on the "created_at" field.
func CreatedAtLTE(v time.Time) predicate.Admin {
	return predicate.Admin(sql.FieldLTE(FieldCreatedAt, v))
}

// UpdatedAtEQ applies the EQ predicate on the "updated_at" field.
func UpdatedAtEQ(v time.Time) predicate.Admin {
	return predicate.Admin(sql.FieldEQ(FieldUpdatedAt, v))
}

// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.
func UpdatedAtNEQ(v time.Time) predicate.Admin {
	return predicate.Admin(sql.FieldNEQ(FieldUpdatedAt, v))
}

// UpdatedAtIn applies the In predicate on the "updated_at" field.
func UpdatedAtIn(vs ...time.Time) predicate.Admin {
	return predicate.Admin(sql.FieldIn(FieldUpdatedAt, vs...))
}

// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.
func UpdatedAtNotIn(vs ...time.Time) predicate.Admin {
	return predicate.Admin(sql.FieldNotIn(FieldUpdatedAt, vs...))
}

// UpdatedAtGT applies the GT predicate on the "updated_at" field.
func UpdatedAtGT(v time.Time) predicate.Admin {
	return predicate.Admin(sql.FieldGT(FieldUpdatedAt, v))
}

// UpdatedAtGTE applies the GTE predicate on the "updated_at" field.
func UpdatedAtGTE(v time.Time) predicate.Admin {
	return predicate.Admin(sql.FieldGTE(FieldUpdatedAt, v))
}

// UpdatedAtLT applies the LT predicate on the "updated_at" field.
func UpdatedAtLT(v time.Time) predicate.Admin {
	return predicate.Admin(sql.FieldLT(FieldUpdatedAt, v))
}

// UpdatedAtLTE applies the LTE predicate on the "updated_at" field.
func UpdatedAtLTE(v time.Time) predicate.Admin {
	return predicate.Admin(sql.FieldLTE(FieldUpdatedAt, v))
}

// HasLoginHistories applies the HasEdge predicate on the "login_histories" edge.
func HasLoginHistories() predicate.Admin {
	return predicate.Admin(func(s *sql.Selector) {
		step := sqlgraph.NewStep(
			sqlgraph.From(Table, FieldID),
			sqlgraph.Edge(sqlgraph.O2M, false, LoginHistoriesTable, LoginHistoriesColumn),
		)
		sqlgraph.HasNeighbors(s, step)
	})
}

// HasLoginHistoriesWith applies the HasEdge predicate on the "login_histories" edge with a given conditions (other predicates).
func HasLoginHistoriesWith(preds ...predicate.AdminLoginHistory) predicate.Admin {
	return predicate.Admin(func(s *sql.Selector) {
		step := newLoginHistoriesStep()
		sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
			for _, p := range preds {
				p(s)
			}
		})
	})
}

// HasMyusergroups applies the HasEdge predicate on the "myusergroups" edge.
func HasMyusergroups() predicate.Admin {
	return predicate.Admin(func(s *sql.Selector) {
		step := sqlgraph.NewStep(
			sqlgraph.From(Table, FieldID),
			sqlgraph.Edge(sqlgraph.O2M, false, MyusergroupsTable, MyusergroupsColumn),
		)
		sqlgraph.HasNeighbors(s, step)
	})
}

// HasMyusergroupsWith applies the HasEdge predicate on the "myusergroups" edge with a given conditions (other predicates).
func HasMyusergroupsWith(preds ...predicate.UserGroup) predicate.Admin {
	return predicate.Admin(func(s *sql.Selector) {
		step := newMyusergroupsStep()
		sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
			for _, p := range preds {
				p(s)
			}
		})
	})
}

// HasAiemployees applies the HasEdge predicate on the "aiemployees" edge.
func HasAiemployees() predicate.Admin {
	return predicate.Admin(func(s *sql.Selector) {
		step := sqlgraph.NewStep(
			sqlgraph.From(Table, FieldID),
			sqlgraph.Edge(sqlgraph.O2M, false, AiemployeesTable, AiemployeesColumn),
		)
		sqlgraph.HasNeighbors(s, step)
	})
}

// HasAiemployeesWith applies the HasEdge predicate on the "aiemployees" edge with a given conditions (other predicates).
func HasAiemployeesWith(preds ...predicate.AIEmployee) predicate.Admin {
	return predicate.Admin(func(s *sql.Selector) {
		step := newAiemployeesStep()
		sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
			for _, p := range preds {
				p(s)
			}
		})
	})
}

// HasUsergroups applies the HasEdge predicate on the "usergroups" edge.
func HasUsergroups() predicate.Admin {
	return predicate.Admin(func(s *sql.Selector) {
		step := sqlgraph.NewStep(
			sqlgraph.From(Table, FieldID),
			sqlgraph.Edge(sqlgraph.M2M, true, UsergroupsTable, UsergroupsPrimaryKey...),
		)
		sqlgraph.HasNeighbors(s, step)
	})
}

// HasUsergroupsWith applies the HasEdge predicate on the "usergroups" edge with a given conditions (other predicates).
func HasUsergroupsWith(preds ...predicate.UserGroup) predicate.Admin {
	return predicate.Admin(func(s *sql.Selector) {
		step := newUsergroupsStep()
		sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
			for _, p := range preds {
				p(s)
			}
		})
	})
}

// HasRoles applies the HasEdge predicate on the "roles" edge.
func HasRoles() predicate.Admin {
	return predicate.Admin(func(s *sql.Selector) {
		step := sqlgraph.NewStep(
			sqlgraph.From(Table, FieldID),
			sqlgraph.Edge(sqlgraph.M2M, true, RolesTable, RolesPrimaryKey...),
		)
		sqlgraph.HasNeighbors(s, step)
	})
}

// HasRolesWith applies the HasEdge predicate on the "roles" edge with a given conditions (other predicates).
func HasRolesWith(preds ...predicate.Role) predicate.Admin {
	return predicate.Admin(func(s *sql.Selector) {
		step := newRolesStep()
		sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
			for _, p := range preds {
				p(s)
			}
		})
	})
}

// HasUserGroupAdmins applies the HasEdge predicate on the "user_group_admins" edge.
func HasUserGroupAdmins() predicate.Admin {
	return predicate.Admin(func(s *sql.Selector) {
		step := sqlgraph.NewStep(
			sqlgraph.From(Table, FieldID),
			sqlgraph.Edge(sqlgraph.O2M, true, UserGroupAdminsTable, UserGroupAdminsColumn),
		)
		sqlgraph.HasNeighbors(s, step)
	})
}

// HasUserGroupAdminsWith applies the HasEdge predicate on the "user_group_admins" edge with a given conditions (other predicates).
func HasUserGroupAdminsWith(preds ...predicate.UserGroupAdmin) predicate.Admin {
	return predicate.Admin(func(s *sql.Selector) {
		step := newUserGroupAdminsStep()
		sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
			for _, p := range preds {
				p(s)
			}
		})
	})
}

// HasAdminRoles applies the HasEdge predicate on the "admin_roles" edge.
func HasAdminRoles() predicate.Admin {
	return predicate.Admin(func(s *sql.Selector) {
		step := sqlgraph.NewStep(
			sqlgraph.From(Table, FieldID),
			sqlgraph.Edge(sqlgraph.O2M, true, AdminRolesTable, AdminRolesColumn),
		)
		sqlgraph.HasNeighbors(s, step)
	})
}

// HasAdminRolesWith applies the HasEdge predicate on the "admin_roles" edge with a given conditions (other predicates).
func HasAdminRolesWith(preds ...predicate.AdminRole) predicate.Admin {
	return predicate.Admin(func(s *sql.Selector) {
		step := newAdminRolesStep()
		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.Admin) predicate.Admin {
	return predicate.Admin(sql.AndPredicates(predicates...))
}

// Or groups predicates with the OR operator between them.
func Or(predicates ...predicate.Admin) predicate.Admin {
	return predicate.Admin(sql.OrPredicates(predicates...))
}

// Not applies the not operator on the given predicate.
func Not(p predicate.Admin) predicate.Admin {
	return predicate.Admin(sql.NotPredicates(p))
}
