// Code generated by ent, DO NOT EDIT.

package tree

import (
	"time"

	"entgo.io/ent/dialect/sql"
	"entgo.io/ent/dialect/sql/sqlgraph"
	"github.com/google/uuid"
	"github.com/lightsparkdev/spark/common/keys"
	"github.com/lightsparkdev/spark/so/ent/predicate"
	"github.com/lightsparkdev/spark/so/ent/schema/schematype"
)

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

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

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

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

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

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

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

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

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

// CreateTime applies equality check predicate on the "create_time" field. It's identical to CreateTimeEQ.
func CreateTime(v time.Time) predicate.Tree {
	return predicate.Tree(sql.FieldEQ(FieldCreateTime, v))
}

// UpdateTime applies equality check predicate on the "update_time" field. It's identical to UpdateTimeEQ.
func UpdateTime(v time.Time) predicate.Tree {
	return predicate.Tree(sql.FieldEQ(FieldUpdateTime, v))
}

// OwnerIdentityPubkey applies equality check predicate on the "owner_identity_pubkey" field. It's identical to OwnerIdentityPubkeyEQ.
func OwnerIdentityPubkey(v keys.Public) predicate.Tree {
	return predicate.Tree(sql.FieldEQ(FieldOwnerIdentityPubkey, v))
}

// BaseTxid applies equality check predicate on the "base_txid" field. It's identical to BaseTxidEQ.
func BaseTxid(v []byte) predicate.Tree {
	return predicate.Tree(sql.FieldEQ(FieldBaseTxid, v))
}

// Vout applies equality check predicate on the "vout" field. It's identical to VoutEQ.
func Vout(v int16) predicate.Tree {
	return predicate.Tree(sql.FieldEQ(FieldVout, v))
}

// CreateTimeEQ applies the EQ predicate on the "create_time" field.
func CreateTimeEQ(v time.Time) predicate.Tree {
	return predicate.Tree(sql.FieldEQ(FieldCreateTime, v))
}

// CreateTimeNEQ applies the NEQ predicate on the "create_time" field.
func CreateTimeNEQ(v time.Time) predicate.Tree {
	return predicate.Tree(sql.FieldNEQ(FieldCreateTime, v))
}

// CreateTimeIn applies the In predicate on the "create_time" field.
func CreateTimeIn(vs ...time.Time) predicate.Tree {
	return predicate.Tree(sql.FieldIn(FieldCreateTime, vs...))
}

// CreateTimeNotIn applies the NotIn predicate on the "create_time" field.
func CreateTimeNotIn(vs ...time.Time) predicate.Tree {
	return predicate.Tree(sql.FieldNotIn(FieldCreateTime, vs...))
}

// CreateTimeGT applies the GT predicate on the "create_time" field.
func CreateTimeGT(v time.Time) predicate.Tree {
	return predicate.Tree(sql.FieldGT(FieldCreateTime, v))
}

// CreateTimeGTE applies the GTE predicate on the "create_time" field.
func CreateTimeGTE(v time.Time) predicate.Tree {
	return predicate.Tree(sql.FieldGTE(FieldCreateTime, v))
}

// CreateTimeLT applies the LT predicate on the "create_time" field.
func CreateTimeLT(v time.Time) predicate.Tree {
	return predicate.Tree(sql.FieldLT(FieldCreateTime, v))
}

// CreateTimeLTE applies the LTE predicate on the "create_time" field.
func CreateTimeLTE(v time.Time) predicate.Tree {
	return predicate.Tree(sql.FieldLTE(FieldCreateTime, v))
}

// UpdateTimeEQ applies the EQ predicate on the "update_time" field.
func UpdateTimeEQ(v time.Time) predicate.Tree {
	return predicate.Tree(sql.FieldEQ(FieldUpdateTime, v))
}

// UpdateTimeNEQ applies the NEQ predicate on the "update_time" field.
func UpdateTimeNEQ(v time.Time) predicate.Tree {
	return predicate.Tree(sql.FieldNEQ(FieldUpdateTime, v))
}

// UpdateTimeIn applies the In predicate on the "update_time" field.
func UpdateTimeIn(vs ...time.Time) predicate.Tree {
	return predicate.Tree(sql.FieldIn(FieldUpdateTime, vs...))
}

// UpdateTimeNotIn applies the NotIn predicate on the "update_time" field.
func UpdateTimeNotIn(vs ...time.Time) predicate.Tree {
	return predicate.Tree(sql.FieldNotIn(FieldUpdateTime, vs...))
}

// UpdateTimeGT applies the GT predicate on the "update_time" field.
func UpdateTimeGT(v time.Time) predicate.Tree {
	return predicate.Tree(sql.FieldGT(FieldUpdateTime, v))
}

// UpdateTimeGTE applies the GTE predicate on the "update_time" field.
func UpdateTimeGTE(v time.Time) predicate.Tree {
	return predicate.Tree(sql.FieldGTE(FieldUpdateTime, v))
}

// UpdateTimeLT applies the LT predicate on the "update_time" field.
func UpdateTimeLT(v time.Time) predicate.Tree {
	return predicate.Tree(sql.FieldLT(FieldUpdateTime, v))
}

// UpdateTimeLTE applies the LTE predicate on the "update_time" field.
func UpdateTimeLTE(v time.Time) predicate.Tree {
	return predicate.Tree(sql.FieldLTE(FieldUpdateTime, v))
}

// OwnerIdentityPubkeyEQ applies the EQ predicate on the "owner_identity_pubkey" field.
func OwnerIdentityPubkeyEQ(v keys.Public) predicate.Tree {
	return predicate.Tree(sql.FieldEQ(FieldOwnerIdentityPubkey, v))
}

// OwnerIdentityPubkeyNEQ applies the NEQ predicate on the "owner_identity_pubkey" field.
func OwnerIdentityPubkeyNEQ(v keys.Public) predicate.Tree {
	return predicate.Tree(sql.FieldNEQ(FieldOwnerIdentityPubkey, v))
}

// OwnerIdentityPubkeyIn applies the In predicate on the "owner_identity_pubkey" field.
func OwnerIdentityPubkeyIn(vs ...keys.Public) predicate.Tree {
	return predicate.Tree(sql.FieldIn(FieldOwnerIdentityPubkey, vs...))
}

// OwnerIdentityPubkeyNotIn applies the NotIn predicate on the "owner_identity_pubkey" field.
func OwnerIdentityPubkeyNotIn(vs ...keys.Public) predicate.Tree {
	return predicate.Tree(sql.FieldNotIn(FieldOwnerIdentityPubkey, vs...))
}

// OwnerIdentityPubkeyGT applies the GT predicate on the "owner_identity_pubkey" field.
func OwnerIdentityPubkeyGT(v keys.Public) predicate.Tree {
	return predicate.Tree(sql.FieldGT(FieldOwnerIdentityPubkey, v))
}

// OwnerIdentityPubkeyGTE applies the GTE predicate on the "owner_identity_pubkey" field.
func OwnerIdentityPubkeyGTE(v keys.Public) predicate.Tree {
	return predicate.Tree(sql.FieldGTE(FieldOwnerIdentityPubkey, v))
}

// OwnerIdentityPubkeyLT applies the LT predicate on the "owner_identity_pubkey" field.
func OwnerIdentityPubkeyLT(v keys.Public) predicate.Tree {
	return predicate.Tree(sql.FieldLT(FieldOwnerIdentityPubkey, v))
}

// OwnerIdentityPubkeyLTE applies the LTE predicate on the "owner_identity_pubkey" field.
func OwnerIdentityPubkeyLTE(v keys.Public) predicate.Tree {
	return predicate.Tree(sql.FieldLTE(FieldOwnerIdentityPubkey, v))
}

// StatusEQ applies the EQ predicate on the "status" field.
func StatusEQ(v schematype.TreeStatus) predicate.Tree {
	vc := v
	return predicate.Tree(sql.FieldEQ(FieldStatus, vc))
}

// StatusNEQ applies the NEQ predicate on the "status" field.
func StatusNEQ(v schematype.TreeStatus) predicate.Tree {
	vc := v
	return predicate.Tree(sql.FieldNEQ(FieldStatus, vc))
}

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

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

// NetworkEQ applies the EQ predicate on the "network" field.
func NetworkEQ(v schematype.Network) predicate.Tree {
	vc := v
	return predicate.Tree(sql.FieldEQ(FieldNetwork, vc))
}

// NetworkNEQ applies the NEQ predicate on the "network" field.
func NetworkNEQ(v schematype.Network) predicate.Tree {
	vc := v
	return predicate.Tree(sql.FieldNEQ(FieldNetwork, vc))
}

// NetworkIn applies the In predicate on the "network" field.
func NetworkIn(vs ...schematype.Network) predicate.Tree {
	v := make([]any, len(vs))
	for i := range v {
		v[i] = vs[i]
	}
	return predicate.Tree(sql.FieldIn(FieldNetwork, v...))
}

// NetworkNotIn applies the NotIn predicate on the "network" field.
func NetworkNotIn(vs ...schematype.Network) predicate.Tree {
	v := make([]any, len(vs))
	for i := range v {
		v[i] = vs[i]
	}
	return predicate.Tree(sql.FieldNotIn(FieldNetwork, v...))
}

// BaseTxidEQ applies the EQ predicate on the "base_txid" field.
func BaseTxidEQ(v []byte) predicate.Tree {
	return predicate.Tree(sql.FieldEQ(FieldBaseTxid, v))
}

// BaseTxidNEQ applies the NEQ predicate on the "base_txid" field.
func BaseTxidNEQ(v []byte) predicate.Tree {
	return predicate.Tree(sql.FieldNEQ(FieldBaseTxid, v))
}

// BaseTxidIn applies the In predicate on the "base_txid" field.
func BaseTxidIn(vs ...[]byte) predicate.Tree {
	return predicate.Tree(sql.FieldIn(FieldBaseTxid, vs...))
}

// BaseTxidNotIn applies the NotIn predicate on the "base_txid" field.
func BaseTxidNotIn(vs ...[]byte) predicate.Tree {
	return predicate.Tree(sql.FieldNotIn(FieldBaseTxid, vs...))
}

// BaseTxidGT applies the GT predicate on the "base_txid" field.
func BaseTxidGT(v []byte) predicate.Tree {
	return predicate.Tree(sql.FieldGT(FieldBaseTxid, v))
}

// BaseTxidGTE applies the GTE predicate on the "base_txid" field.
func BaseTxidGTE(v []byte) predicate.Tree {
	return predicate.Tree(sql.FieldGTE(FieldBaseTxid, v))
}

// BaseTxidLT applies the LT predicate on the "base_txid" field.
func BaseTxidLT(v []byte) predicate.Tree {
	return predicate.Tree(sql.FieldLT(FieldBaseTxid, v))
}

// BaseTxidLTE applies the LTE predicate on the "base_txid" field.
func BaseTxidLTE(v []byte) predicate.Tree {
	return predicate.Tree(sql.FieldLTE(FieldBaseTxid, v))
}

// VoutEQ applies the EQ predicate on the "vout" field.
func VoutEQ(v int16) predicate.Tree {
	return predicate.Tree(sql.FieldEQ(FieldVout, v))
}

// VoutNEQ applies the NEQ predicate on the "vout" field.
func VoutNEQ(v int16) predicate.Tree {
	return predicate.Tree(sql.FieldNEQ(FieldVout, v))
}

// VoutIn applies the In predicate on the "vout" field.
func VoutIn(vs ...int16) predicate.Tree {
	return predicate.Tree(sql.FieldIn(FieldVout, vs...))
}

// VoutNotIn applies the NotIn predicate on the "vout" field.
func VoutNotIn(vs ...int16) predicate.Tree {
	return predicate.Tree(sql.FieldNotIn(FieldVout, vs...))
}

// VoutGT applies the GT predicate on the "vout" field.
func VoutGT(v int16) predicate.Tree {
	return predicate.Tree(sql.FieldGT(FieldVout, v))
}

// VoutGTE applies the GTE predicate on the "vout" field.
func VoutGTE(v int16) predicate.Tree {
	return predicate.Tree(sql.FieldGTE(FieldVout, v))
}

// VoutLT applies the LT predicate on the "vout" field.
func VoutLT(v int16) predicate.Tree {
	return predicate.Tree(sql.FieldLT(FieldVout, v))
}

// VoutLTE applies the LTE predicate on the "vout" field.
func VoutLTE(v int16) predicate.Tree {
	return predicate.Tree(sql.FieldLTE(FieldVout, v))
}

// HasRoot applies the HasEdge predicate on the "root" edge.
func HasRoot() predicate.Tree {
	return predicate.Tree(func(s *sql.Selector) {
		step := sqlgraph.NewStep(
			sqlgraph.From(Table, FieldID),
			sqlgraph.Edge(sqlgraph.M2O, false, RootTable, RootColumn),
		)
		sqlgraph.HasNeighbors(s, step)
	})
}

// HasRootWith applies the HasEdge predicate on the "root" edge with a given conditions (other predicates).
func HasRootWith(preds ...predicate.TreeNode) predicate.Tree {
	return predicate.Tree(func(s *sql.Selector) {
		step := newRootStep()
		sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
			for _, p := range preds {
				p(s)
			}
		})
	})
}

// HasNodes applies the HasEdge predicate on the "nodes" edge.
func HasNodes() predicate.Tree {
	return predicate.Tree(func(s *sql.Selector) {
		step := sqlgraph.NewStep(
			sqlgraph.From(Table, FieldID),
			sqlgraph.Edge(sqlgraph.O2M, true, NodesTable, NodesColumn),
		)
		sqlgraph.HasNeighbors(s, step)
	})
}

// HasNodesWith applies the HasEdge predicate on the "nodes" edge with a given conditions (other predicates).
func HasNodesWith(preds ...predicate.TreeNode) predicate.Tree {
	return predicate.Tree(func(s *sql.Selector) {
		step := newNodesStep()
		sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
			for _, p := range preds {
				p(s)
			}
		})
	})
}

// HasDepositAddress applies the HasEdge predicate on the "deposit_address" edge.
func HasDepositAddress() predicate.Tree {
	return predicate.Tree(func(s *sql.Selector) {
		step := sqlgraph.NewStep(
			sqlgraph.From(Table, FieldID),
			sqlgraph.Edge(sqlgraph.O2O, true, DepositAddressTable, DepositAddressColumn),
		)
		sqlgraph.HasNeighbors(s, step)
	})
}

// HasDepositAddressWith applies the HasEdge predicate on the "deposit_address" edge with a given conditions (other predicates).
func HasDepositAddressWith(preds ...predicate.DepositAddress) predicate.Tree {
	return predicate.Tree(func(s *sql.Selector) {
		step := newDepositAddressStep()
		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.Tree) predicate.Tree {
	return predicate.Tree(sql.AndPredicates(predicates...))
}

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

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