// Code generated by ent, DO NOT EDIT.

package preimagerequest

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.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldEQ(FieldID, id))
}

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

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

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

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

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

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

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

// IDLTE applies the LTE predicate on the ID field.
func IDLTE(id uuid.UUID) predicate.PreimageRequest {
	return predicate.PreimageRequest(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.PreimageRequest {
	return predicate.PreimageRequest(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.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldEQ(FieldUpdateTime, v))
}

// PaymentHash applies equality check predicate on the "payment_hash" field. It's identical to PaymentHashEQ.
func PaymentHash(v []byte) predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldEQ(FieldPaymentHash, v))
}

// ReceiverIdentityPubkey applies equality check predicate on the "receiver_identity_pubkey" field. It's identical to ReceiverIdentityPubkeyEQ.
func ReceiverIdentityPubkey(v keys.Public) predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldEQ(FieldReceiverIdentityPubkey, v))
}

// Preimage applies equality check predicate on the "preimage" field. It's identical to PreimageEQ.
func Preimage(v []byte) predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldEQ(FieldPreimage, v))
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// PaymentHashEQ applies the EQ predicate on the "payment_hash" field.
func PaymentHashEQ(v []byte) predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldEQ(FieldPaymentHash, v))
}

// PaymentHashNEQ applies the NEQ predicate on the "payment_hash" field.
func PaymentHashNEQ(v []byte) predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldNEQ(FieldPaymentHash, v))
}

// PaymentHashIn applies the In predicate on the "payment_hash" field.
func PaymentHashIn(vs ...[]byte) predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldIn(FieldPaymentHash, vs...))
}

// PaymentHashNotIn applies the NotIn predicate on the "payment_hash" field.
func PaymentHashNotIn(vs ...[]byte) predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldNotIn(FieldPaymentHash, vs...))
}

// PaymentHashGT applies the GT predicate on the "payment_hash" field.
func PaymentHashGT(v []byte) predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldGT(FieldPaymentHash, v))
}

// PaymentHashGTE applies the GTE predicate on the "payment_hash" field.
func PaymentHashGTE(v []byte) predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldGTE(FieldPaymentHash, v))
}

// PaymentHashLT applies the LT predicate on the "payment_hash" field.
func PaymentHashLT(v []byte) predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldLT(FieldPaymentHash, v))
}

// PaymentHashLTE applies the LTE predicate on the "payment_hash" field.
func PaymentHashLTE(v []byte) predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldLTE(FieldPaymentHash, v))
}

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

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

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

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

// ReceiverIdentityPubkeyEQ applies the EQ predicate on the "receiver_identity_pubkey" field.
func ReceiverIdentityPubkeyEQ(v keys.Public) predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldEQ(FieldReceiverIdentityPubkey, v))
}

// ReceiverIdentityPubkeyNEQ applies the NEQ predicate on the "receiver_identity_pubkey" field.
func ReceiverIdentityPubkeyNEQ(v keys.Public) predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldNEQ(FieldReceiverIdentityPubkey, v))
}

// ReceiverIdentityPubkeyIn applies the In predicate on the "receiver_identity_pubkey" field.
func ReceiverIdentityPubkeyIn(vs ...keys.Public) predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldIn(FieldReceiverIdentityPubkey, vs...))
}

// ReceiverIdentityPubkeyNotIn applies the NotIn predicate on the "receiver_identity_pubkey" field.
func ReceiverIdentityPubkeyNotIn(vs ...keys.Public) predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldNotIn(FieldReceiverIdentityPubkey, vs...))
}

// ReceiverIdentityPubkeyGT applies the GT predicate on the "receiver_identity_pubkey" field.
func ReceiverIdentityPubkeyGT(v keys.Public) predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldGT(FieldReceiverIdentityPubkey, v))
}

// ReceiverIdentityPubkeyGTE applies the GTE predicate on the "receiver_identity_pubkey" field.
func ReceiverIdentityPubkeyGTE(v keys.Public) predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldGTE(FieldReceiverIdentityPubkey, v))
}

// ReceiverIdentityPubkeyLT applies the LT predicate on the "receiver_identity_pubkey" field.
func ReceiverIdentityPubkeyLT(v keys.Public) predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldLT(FieldReceiverIdentityPubkey, v))
}

// ReceiverIdentityPubkeyLTE applies the LTE predicate on the "receiver_identity_pubkey" field.
func ReceiverIdentityPubkeyLTE(v keys.Public) predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldLTE(FieldReceiverIdentityPubkey, v))
}

// ReceiverIdentityPubkeyIsNil applies the IsNil predicate on the "receiver_identity_pubkey" field.
func ReceiverIdentityPubkeyIsNil() predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldIsNull(FieldReceiverIdentityPubkey))
}

// ReceiverIdentityPubkeyNotNil applies the NotNil predicate on the "receiver_identity_pubkey" field.
func ReceiverIdentityPubkeyNotNil() predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldNotNull(FieldReceiverIdentityPubkey))
}

// PreimageEQ applies the EQ predicate on the "preimage" field.
func PreimageEQ(v []byte) predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldEQ(FieldPreimage, v))
}

// PreimageNEQ applies the NEQ predicate on the "preimage" field.
func PreimageNEQ(v []byte) predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldNEQ(FieldPreimage, v))
}

// PreimageIn applies the In predicate on the "preimage" field.
func PreimageIn(vs ...[]byte) predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldIn(FieldPreimage, vs...))
}

// PreimageNotIn applies the NotIn predicate on the "preimage" field.
func PreimageNotIn(vs ...[]byte) predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldNotIn(FieldPreimage, vs...))
}

// PreimageGT applies the GT predicate on the "preimage" field.
func PreimageGT(v []byte) predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldGT(FieldPreimage, v))
}

// PreimageGTE applies the GTE predicate on the "preimage" field.
func PreimageGTE(v []byte) predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldGTE(FieldPreimage, v))
}

// PreimageLT applies the LT predicate on the "preimage" field.
func PreimageLT(v []byte) predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldLT(FieldPreimage, v))
}

// PreimageLTE applies the LTE predicate on the "preimage" field.
func PreimageLTE(v []byte) predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldLTE(FieldPreimage, v))
}

// PreimageIsNil applies the IsNil predicate on the "preimage" field.
func PreimageIsNil() predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldIsNull(FieldPreimage))
}

// PreimageNotNil applies the NotNil predicate on the "preimage" field.
func PreimageNotNil() predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.FieldNotNull(FieldPreimage))
}

// HasTransactions applies the HasEdge predicate on the "transactions" edge.
func HasTransactions() predicate.PreimageRequest {
	return predicate.PreimageRequest(func(s *sql.Selector) {
		step := sqlgraph.NewStep(
			sqlgraph.From(Table, FieldID),
			sqlgraph.Edge(sqlgraph.O2M, true, TransactionsTable, TransactionsColumn),
		)
		sqlgraph.HasNeighbors(s, step)
	})
}

// HasTransactionsWith applies the HasEdge predicate on the "transactions" edge with a given conditions (other predicates).
func HasTransactionsWith(preds ...predicate.UserSignedTransaction) predicate.PreimageRequest {
	return predicate.PreimageRequest(func(s *sql.Selector) {
		step := newTransactionsStep()
		sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
			for _, p := range preds {
				p(s)
			}
		})
	})
}

// HasPreimageShares applies the HasEdge predicate on the "preimage_shares" edge.
func HasPreimageShares() predicate.PreimageRequest {
	return predicate.PreimageRequest(func(s *sql.Selector) {
		step := sqlgraph.NewStep(
			sqlgraph.From(Table, FieldID),
			sqlgraph.Edge(sqlgraph.O2O, false, PreimageSharesTable, PreimageSharesColumn),
		)
		sqlgraph.HasNeighbors(s, step)
	})
}

// HasPreimageSharesWith applies the HasEdge predicate on the "preimage_shares" edge with a given conditions (other predicates).
func HasPreimageSharesWith(preds ...predicate.PreimageShare) predicate.PreimageRequest {
	return predicate.PreimageRequest(func(s *sql.Selector) {
		step := newPreimageSharesStep()
		sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
			for _, p := range preds {
				p(s)
			}
		})
	})
}

// HasTransfers applies the HasEdge predicate on the "transfers" edge.
func HasTransfers() predicate.PreimageRequest {
	return predicate.PreimageRequest(func(s *sql.Selector) {
		step := sqlgraph.NewStep(
			sqlgraph.From(Table, FieldID),
			sqlgraph.Edge(sqlgraph.M2O, false, TransfersTable, TransfersColumn),
		)
		sqlgraph.HasNeighbors(s, step)
	})
}

// HasTransfersWith applies the HasEdge predicate on the "transfers" edge with a given conditions (other predicates).
func HasTransfersWith(preds ...predicate.Transfer) predicate.PreimageRequest {
	return predicate.PreimageRequest(func(s *sql.Selector) {
		step := newTransfersStep()
		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.PreimageRequest) predicate.PreimageRequest {
	return predicate.PreimageRequest(sql.AndPredicates(predicates...))
}

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

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