// Code generated by ent, DO NOT EDIT.

package sparkinvoice

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"
)

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

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

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

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

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

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

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

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

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

// SparkInvoice applies equality check predicate on the "spark_invoice" field. It's identical to SparkInvoiceEQ.
func SparkInvoice(v string) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldEQ(FieldSparkInvoice, v))
}

// ExpiryTime applies equality check predicate on the "expiry_time" field. It's identical to ExpiryTimeEQ.
func ExpiryTime(v time.Time) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldEQ(FieldExpiryTime, v))
}

// ReceiverPublicKey applies equality check predicate on the "receiver_public_key" field. It's identical to ReceiverPublicKeyEQ.
func ReceiverPublicKey(v keys.Public) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldEQ(FieldReceiverPublicKey, v))
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// SparkInvoiceEQ applies the EQ predicate on the "spark_invoice" field.
func SparkInvoiceEQ(v string) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldEQ(FieldSparkInvoice, v))
}

// SparkInvoiceNEQ applies the NEQ predicate on the "spark_invoice" field.
func SparkInvoiceNEQ(v string) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldNEQ(FieldSparkInvoice, v))
}

// SparkInvoiceIn applies the In predicate on the "spark_invoice" field.
func SparkInvoiceIn(vs ...string) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldIn(FieldSparkInvoice, vs...))
}

// SparkInvoiceNotIn applies the NotIn predicate on the "spark_invoice" field.
func SparkInvoiceNotIn(vs ...string) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldNotIn(FieldSparkInvoice, vs...))
}

// SparkInvoiceGT applies the GT predicate on the "spark_invoice" field.
func SparkInvoiceGT(v string) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldGT(FieldSparkInvoice, v))
}

// SparkInvoiceGTE applies the GTE predicate on the "spark_invoice" field.
func SparkInvoiceGTE(v string) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldGTE(FieldSparkInvoice, v))
}

// SparkInvoiceLT applies the LT predicate on the "spark_invoice" field.
func SparkInvoiceLT(v string) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldLT(FieldSparkInvoice, v))
}

// SparkInvoiceLTE applies the LTE predicate on the "spark_invoice" field.
func SparkInvoiceLTE(v string) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldLTE(FieldSparkInvoice, v))
}

// SparkInvoiceContains applies the Contains predicate on the "spark_invoice" field.
func SparkInvoiceContains(v string) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldContains(FieldSparkInvoice, v))
}

// SparkInvoiceHasPrefix applies the HasPrefix predicate on the "spark_invoice" field.
func SparkInvoiceHasPrefix(v string) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldHasPrefix(FieldSparkInvoice, v))
}

// SparkInvoiceHasSuffix applies the HasSuffix predicate on the "spark_invoice" field.
func SparkInvoiceHasSuffix(v string) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldHasSuffix(FieldSparkInvoice, v))
}

// SparkInvoiceEqualFold applies the EqualFold predicate on the "spark_invoice" field.
func SparkInvoiceEqualFold(v string) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldEqualFold(FieldSparkInvoice, v))
}

// SparkInvoiceContainsFold applies the ContainsFold predicate on the "spark_invoice" field.
func SparkInvoiceContainsFold(v string) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldContainsFold(FieldSparkInvoice, v))
}

// ExpiryTimeEQ applies the EQ predicate on the "expiry_time" field.
func ExpiryTimeEQ(v time.Time) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldEQ(FieldExpiryTime, v))
}

// ExpiryTimeNEQ applies the NEQ predicate on the "expiry_time" field.
func ExpiryTimeNEQ(v time.Time) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldNEQ(FieldExpiryTime, v))
}

// ExpiryTimeIn applies the In predicate on the "expiry_time" field.
func ExpiryTimeIn(vs ...time.Time) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldIn(FieldExpiryTime, vs...))
}

// ExpiryTimeNotIn applies the NotIn predicate on the "expiry_time" field.
func ExpiryTimeNotIn(vs ...time.Time) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldNotIn(FieldExpiryTime, vs...))
}

// ExpiryTimeGT applies the GT predicate on the "expiry_time" field.
func ExpiryTimeGT(v time.Time) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldGT(FieldExpiryTime, v))
}

// ExpiryTimeGTE applies the GTE predicate on the "expiry_time" field.
func ExpiryTimeGTE(v time.Time) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldGTE(FieldExpiryTime, v))
}

// ExpiryTimeLT applies the LT predicate on the "expiry_time" field.
func ExpiryTimeLT(v time.Time) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldLT(FieldExpiryTime, v))
}

// ExpiryTimeLTE applies the LTE predicate on the "expiry_time" field.
func ExpiryTimeLTE(v time.Time) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldLTE(FieldExpiryTime, v))
}

// ExpiryTimeIsNil applies the IsNil predicate on the "expiry_time" field.
func ExpiryTimeIsNil() predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldIsNull(FieldExpiryTime))
}

// ExpiryTimeNotNil applies the NotNil predicate on the "expiry_time" field.
func ExpiryTimeNotNil() predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldNotNull(FieldExpiryTime))
}

// ReceiverPublicKeyEQ applies the EQ predicate on the "receiver_public_key" field.
func ReceiverPublicKeyEQ(v keys.Public) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldEQ(FieldReceiverPublicKey, v))
}

// ReceiverPublicKeyNEQ applies the NEQ predicate on the "receiver_public_key" field.
func ReceiverPublicKeyNEQ(v keys.Public) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldNEQ(FieldReceiverPublicKey, v))
}

// ReceiverPublicKeyIn applies the In predicate on the "receiver_public_key" field.
func ReceiverPublicKeyIn(vs ...keys.Public) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldIn(FieldReceiverPublicKey, vs...))
}

// ReceiverPublicKeyNotIn applies the NotIn predicate on the "receiver_public_key" field.
func ReceiverPublicKeyNotIn(vs ...keys.Public) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldNotIn(FieldReceiverPublicKey, vs...))
}

// ReceiverPublicKeyGT applies the GT predicate on the "receiver_public_key" field.
func ReceiverPublicKeyGT(v keys.Public) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldGT(FieldReceiverPublicKey, v))
}

// ReceiverPublicKeyGTE applies the GTE predicate on the "receiver_public_key" field.
func ReceiverPublicKeyGTE(v keys.Public) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldGTE(FieldReceiverPublicKey, v))
}

// ReceiverPublicKeyLT applies the LT predicate on the "receiver_public_key" field.
func ReceiverPublicKeyLT(v keys.Public) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldLT(FieldReceiverPublicKey, v))
}

// ReceiverPublicKeyLTE applies the LTE predicate on the "receiver_public_key" field.
func ReceiverPublicKeyLTE(v keys.Public) predicate.SparkInvoice {
	return predicate.SparkInvoice(sql.FieldLTE(FieldReceiverPublicKey, v))
}

// HasTokenTransaction applies the HasEdge predicate on the "token_transaction" edge.
func HasTokenTransaction() predicate.SparkInvoice {
	return predicate.SparkInvoice(func(s *sql.Selector) {
		step := sqlgraph.NewStep(
			sqlgraph.From(Table, FieldID),
			sqlgraph.Edge(sqlgraph.M2M, true, TokenTransactionTable, TokenTransactionPrimaryKey...),
		)
		sqlgraph.HasNeighbors(s, step)
	})
}

// HasTokenTransactionWith applies the HasEdge predicate on the "token_transaction" edge with a given conditions (other predicates).
func HasTokenTransactionWith(preds ...predicate.TokenTransaction) predicate.SparkInvoice {
	return predicate.SparkInvoice(func(s *sql.Selector) {
		step := newTokenTransactionStep()
		sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
			for _, p := range preds {
				p(s)
			}
		})
	})
}

// HasTransfer applies the HasEdge predicate on the "transfer" edge.
func HasTransfer() predicate.SparkInvoice {
	return predicate.SparkInvoice(func(s *sql.Selector) {
		step := sqlgraph.NewStep(
			sqlgraph.From(Table, FieldID),
			sqlgraph.Edge(sqlgraph.O2M, true, TransferTable, TransferColumn),
		)
		sqlgraph.HasNeighbors(s, step)
	})
}

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

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

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