// Code generated by ent, DO NOT EDIT.

package redeemcode

import (
	"time"

	"entgo.io/ent/dialect/sql"
	"entgo.io/ent/dialect/sql/sqlgraph"
	"github.com/Wei-Shaw/sub2api/ent/predicate"
)

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

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

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

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

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

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

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

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

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

// Code applies equality check predicate on the "code" field. It's identical to CodeEQ.
func Code(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldEQ(FieldCode, v))
}

// Type applies equality check predicate on the "type" field. It's identical to TypeEQ.
func Type(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldEQ(FieldType, v))
}

// Value applies equality check predicate on the "value" field. It's identical to ValueEQ.
func Value(v float64) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldEQ(FieldValue, v))
}

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

// UsedBy applies equality check predicate on the "used_by" field. It's identical to UsedByEQ.
func UsedBy(v int64) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldEQ(FieldUsedBy, v))
}

// UsedAt applies equality check predicate on the "used_at" field. It's identical to UsedAtEQ.
func UsedAt(v time.Time) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldEQ(FieldUsedAt, v))
}

// Notes applies equality check predicate on the "notes" field. It's identical to NotesEQ.
func Notes(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldEQ(FieldNotes, v))
}

// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
func CreatedAt(v time.Time) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldEQ(FieldCreatedAt, v))
}

// GroupID applies equality check predicate on the "group_id" field. It's identical to GroupIDEQ.
func GroupID(v int64) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldEQ(FieldGroupID, v))
}

// ValidityDays applies equality check predicate on the "validity_days" field. It's identical to ValidityDaysEQ.
func ValidityDays(v int) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldEQ(FieldValidityDays, v))
}

// CodeEQ applies the EQ predicate on the "code" field.
func CodeEQ(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldEQ(FieldCode, v))
}

// CodeNEQ applies the NEQ predicate on the "code" field.
func CodeNEQ(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldNEQ(FieldCode, v))
}

// CodeIn applies the In predicate on the "code" field.
func CodeIn(vs ...string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldIn(FieldCode, vs...))
}

// CodeNotIn applies the NotIn predicate on the "code" field.
func CodeNotIn(vs ...string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldNotIn(FieldCode, vs...))
}

// CodeGT applies the GT predicate on the "code" field.
func CodeGT(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldGT(FieldCode, v))
}

// CodeGTE applies the GTE predicate on the "code" field.
func CodeGTE(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldGTE(FieldCode, v))
}

// CodeLT applies the LT predicate on the "code" field.
func CodeLT(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldLT(FieldCode, v))
}

// CodeLTE applies the LTE predicate on the "code" field.
func CodeLTE(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldLTE(FieldCode, v))
}

// CodeContains applies the Contains predicate on the "code" field.
func CodeContains(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldContains(FieldCode, v))
}

// CodeHasPrefix applies the HasPrefix predicate on the "code" field.
func CodeHasPrefix(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldHasPrefix(FieldCode, v))
}

// CodeHasSuffix applies the HasSuffix predicate on the "code" field.
func CodeHasSuffix(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldHasSuffix(FieldCode, v))
}

// CodeEqualFold applies the EqualFold predicate on the "code" field.
func CodeEqualFold(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldEqualFold(FieldCode, v))
}

// CodeContainsFold applies the ContainsFold predicate on the "code" field.
func CodeContainsFold(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldContainsFold(FieldCode, v))
}

// TypeEQ applies the EQ predicate on the "type" field.
func TypeEQ(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldEQ(FieldType, v))
}

// TypeNEQ applies the NEQ predicate on the "type" field.
func TypeNEQ(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldNEQ(FieldType, v))
}

// TypeIn applies the In predicate on the "type" field.
func TypeIn(vs ...string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldIn(FieldType, vs...))
}

// TypeNotIn applies the NotIn predicate on the "type" field.
func TypeNotIn(vs ...string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldNotIn(FieldType, vs...))
}

// TypeGT applies the GT predicate on the "type" field.
func TypeGT(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldGT(FieldType, v))
}

// TypeGTE applies the GTE predicate on the "type" field.
func TypeGTE(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldGTE(FieldType, v))
}

// TypeLT applies the LT predicate on the "type" field.
func TypeLT(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldLT(FieldType, v))
}

// TypeLTE applies the LTE predicate on the "type" field.
func TypeLTE(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldLTE(FieldType, v))
}

// TypeContains applies the Contains predicate on the "type" field.
func TypeContains(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldContains(FieldType, v))
}

// TypeHasPrefix applies the HasPrefix predicate on the "type" field.
func TypeHasPrefix(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldHasPrefix(FieldType, v))
}

// TypeHasSuffix applies the HasSuffix predicate on the "type" field.
func TypeHasSuffix(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldHasSuffix(FieldType, v))
}

// TypeEqualFold applies the EqualFold predicate on the "type" field.
func TypeEqualFold(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldEqualFold(FieldType, v))
}

// TypeContainsFold applies the ContainsFold predicate on the "type" field.
func TypeContainsFold(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldContainsFold(FieldType, v))
}

// ValueEQ applies the EQ predicate on the "value" field.
func ValueEQ(v float64) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldEQ(FieldValue, v))
}

// ValueNEQ applies the NEQ predicate on the "value" field.
func ValueNEQ(v float64) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldNEQ(FieldValue, v))
}

// ValueIn applies the In predicate on the "value" field.
func ValueIn(vs ...float64) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldIn(FieldValue, vs...))
}

// ValueNotIn applies the NotIn predicate on the "value" field.
func ValueNotIn(vs ...float64) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldNotIn(FieldValue, vs...))
}

// ValueGT applies the GT predicate on the "value" field.
func ValueGT(v float64) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldGT(FieldValue, v))
}

// ValueGTE applies the GTE predicate on the "value" field.
func ValueGTE(v float64) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldGTE(FieldValue, v))
}

// ValueLT applies the LT predicate on the "value" field.
func ValueLT(v float64) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldLT(FieldValue, v))
}

// ValueLTE applies the LTE predicate on the "value" field.
func ValueLTE(v float64) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldLTE(FieldValue, v))
}

// StatusEQ applies the EQ predicate on the "status" field.
func StatusEQ(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldEQ(FieldStatus, v))
}

// StatusNEQ applies the NEQ predicate on the "status" field.
func StatusNEQ(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldNEQ(FieldStatus, v))
}

// StatusIn applies the In predicate on the "status" field.
func StatusIn(vs ...string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldIn(FieldStatus, vs...))
}

// StatusNotIn applies the NotIn predicate on the "status" field.
func StatusNotIn(vs ...string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldNotIn(FieldStatus, vs...))
}

// StatusGT applies the GT predicate on the "status" field.
func StatusGT(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldGT(FieldStatus, v))
}

// StatusGTE applies the GTE predicate on the "status" field.
func StatusGTE(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldGTE(FieldStatus, v))
}

// StatusLT applies the LT predicate on the "status" field.
func StatusLT(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldLT(FieldStatus, v))
}

// StatusLTE applies the LTE predicate on the "status" field.
func StatusLTE(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldLTE(FieldStatus, v))
}

// StatusContains applies the Contains predicate on the "status" field.
func StatusContains(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldContains(FieldStatus, v))
}

// StatusHasPrefix applies the HasPrefix predicate on the "status" field.
func StatusHasPrefix(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldHasPrefix(FieldStatus, v))
}

// StatusHasSuffix applies the HasSuffix predicate on the "status" field.
func StatusHasSuffix(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldHasSuffix(FieldStatus, v))
}

// StatusEqualFold applies the EqualFold predicate on the "status" field.
func StatusEqualFold(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldEqualFold(FieldStatus, v))
}

// StatusContainsFold applies the ContainsFold predicate on the "status" field.
func StatusContainsFold(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldContainsFold(FieldStatus, v))
}

// UsedByEQ applies the EQ predicate on the "used_by" field.
func UsedByEQ(v int64) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldEQ(FieldUsedBy, v))
}

// UsedByNEQ applies the NEQ predicate on the "used_by" field.
func UsedByNEQ(v int64) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldNEQ(FieldUsedBy, v))
}

// UsedByIn applies the In predicate on the "used_by" field.
func UsedByIn(vs ...int64) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldIn(FieldUsedBy, vs...))
}

// UsedByNotIn applies the NotIn predicate on the "used_by" field.
func UsedByNotIn(vs ...int64) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldNotIn(FieldUsedBy, vs...))
}

// UsedByIsNil applies the IsNil predicate on the "used_by" field.
func UsedByIsNil() predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldIsNull(FieldUsedBy))
}

// UsedByNotNil applies the NotNil predicate on the "used_by" field.
func UsedByNotNil() predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldNotNull(FieldUsedBy))
}

// UsedAtEQ applies the EQ predicate on the "used_at" field.
func UsedAtEQ(v time.Time) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldEQ(FieldUsedAt, v))
}

// UsedAtNEQ applies the NEQ predicate on the "used_at" field.
func UsedAtNEQ(v time.Time) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldNEQ(FieldUsedAt, v))
}

// UsedAtIn applies the In predicate on the "used_at" field.
func UsedAtIn(vs ...time.Time) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldIn(FieldUsedAt, vs...))
}

// UsedAtNotIn applies the NotIn predicate on the "used_at" field.
func UsedAtNotIn(vs ...time.Time) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldNotIn(FieldUsedAt, vs...))
}

// UsedAtGT applies the GT predicate on the "used_at" field.
func UsedAtGT(v time.Time) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldGT(FieldUsedAt, v))
}

// UsedAtGTE applies the GTE predicate on the "used_at" field.
func UsedAtGTE(v time.Time) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldGTE(FieldUsedAt, v))
}

// UsedAtLT applies the LT predicate on the "used_at" field.
func UsedAtLT(v time.Time) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldLT(FieldUsedAt, v))
}

// UsedAtLTE applies the LTE predicate on the "used_at" field.
func UsedAtLTE(v time.Time) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldLTE(FieldUsedAt, v))
}

// UsedAtIsNil applies the IsNil predicate on the "used_at" field.
func UsedAtIsNil() predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldIsNull(FieldUsedAt))
}

// UsedAtNotNil applies the NotNil predicate on the "used_at" field.
func UsedAtNotNil() predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldNotNull(FieldUsedAt))
}

// NotesEQ applies the EQ predicate on the "notes" field.
func NotesEQ(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldEQ(FieldNotes, v))
}

// NotesNEQ applies the NEQ predicate on the "notes" field.
func NotesNEQ(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldNEQ(FieldNotes, v))
}

// NotesIn applies the In predicate on the "notes" field.
func NotesIn(vs ...string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldIn(FieldNotes, vs...))
}

// NotesNotIn applies the NotIn predicate on the "notes" field.
func NotesNotIn(vs ...string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldNotIn(FieldNotes, vs...))
}

// NotesGT applies the GT predicate on the "notes" field.
func NotesGT(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldGT(FieldNotes, v))
}

// NotesGTE applies the GTE predicate on the "notes" field.
func NotesGTE(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldGTE(FieldNotes, v))
}

// NotesLT applies the LT predicate on the "notes" field.
func NotesLT(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldLT(FieldNotes, v))
}

// NotesLTE applies the LTE predicate on the "notes" field.
func NotesLTE(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldLTE(FieldNotes, v))
}

// NotesContains applies the Contains predicate on the "notes" field.
func NotesContains(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldContains(FieldNotes, v))
}

// NotesHasPrefix applies the HasPrefix predicate on the "notes" field.
func NotesHasPrefix(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldHasPrefix(FieldNotes, v))
}

// NotesHasSuffix applies the HasSuffix predicate on the "notes" field.
func NotesHasSuffix(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldHasSuffix(FieldNotes, v))
}

// NotesIsNil applies the IsNil predicate on the "notes" field.
func NotesIsNil() predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldIsNull(FieldNotes))
}

// NotesNotNil applies the NotNil predicate on the "notes" field.
func NotesNotNil() predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldNotNull(FieldNotes))
}

// NotesEqualFold applies the EqualFold predicate on the "notes" field.
func NotesEqualFold(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldEqualFold(FieldNotes, v))
}

// NotesContainsFold applies the ContainsFold predicate on the "notes" field.
func NotesContainsFold(v string) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldContainsFold(FieldNotes, v))
}

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

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

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

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

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

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

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

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

// GroupIDEQ applies the EQ predicate on the "group_id" field.
func GroupIDEQ(v int64) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldEQ(FieldGroupID, v))
}

// GroupIDNEQ applies the NEQ predicate on the "group_id" field.
func GroupIDNEQ(v int64) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldNEQ(FieldGroupID, v))
}

// GroupIDIn applies the In predicate on the "group_id" field.
func GroupIDIn(vs ...int64) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldIn(FieldGroupID, vs...))
}

// GroupIDNotIn applies the NotIn predicate on the "group_id" field.
func GroupIDNotIn(vs ...int64) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldNotIn(FieldGroupID, vs...))
}

// GroupIDIsNil applies the IsNil predicate on the "group_id" field.
func GroupIDIsNil() predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldIsNull(FieldGroupID))
}

// GroupIDNotNil applies the NotNil predicate on the "group_id" field.
func GroupIDNotNil() predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldNotNull(FieldGroupID))
}

// ValidityDaysEQ applies the EQ predicate on the "validity_days" field.
func ValidityDaysEQ(v int) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldEQ(FieldValidityDays, v))
}

// ValidityDaysNEQ applies the NEQ predicate on the "validity_days" field.
func ValidityDaysNEQ(v int) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldNEQ(FieldValidityDays, v))
}

// ValidityDaysIn applies the In predicate on the "validity_days" field.
func ValidityDaysIn(vs ...int) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldIn(FieldValidityDays, vs...))
}

// ValidityDaysNotIn applies the NotIn predicate on the "validity_days" field.
func ValidityDaysNotIn(vs ...int) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldNotIn(FieldValidityDays, vs...))
}

// ValidityDaysGT applies the GT predicate on the "validity_days" field.
func ValidityDaysGT(v int) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldGT(FieldValidityDays, v))
}

// ValidityDaysGTE applies the GTE predicate on the "validity_days" field.
func ValidityDaysGTE(v int) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldGTE(FieldValidityDays, v))
}

// ValidityDaysLT applies the LT predicate on the "validity_days" field.
func ValidityDaysLT(v int) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldLT(FieldValidityDays, v))
}

// ValidityDaysLTE applies the LTE predicate on the "validity_days" field.
func ValidityDaysLTE(v int) predicate.RedeemCode {
	return predicate.RedeemCode(sql.FieldLTE(FieldValidityDays, v))
}

// HasUser applies the HasEdge predicate on the "user" edge.
func HasUser() predicate.RedeemCode {
	return predicate.RedeemCode(func(s *sql.Selector) {
		step := sqlgraph.NewStep(
			sqlgraph.From(Table, FieldID),
			sqlgraph.Edge(sqlgraph.M2O, true, UserTable, UserColumn),
		)
		sqlgraph.HasNeighbors(s, step)
	})
}

// HasUserWith applies the HasEdge predicate on the "user" edge with a given conditions (other predicates).
func HasUserWith(preds ...predicate.User) predicate.RedeemCode {
	return predicate.RedeemCode(func(s *sql.Selector) {
		step := newUserStep()
		sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
			for _, p := range preds {
				p(s)
			}
		})
	})
}

// HasGroup applies the HasEdge predicate on the "group" edge.
func HasGroup() predicate.RedeemCode {
	return predicate.RedeemCode(func(s *sql.Selector) {
		step := sqlgraph.NewStep(
			sqlgraph.From(Table, FieldID),
			sqlgraph.Edge(sqlgraph.M2O, true, GroupTable, GroupColumn),
		)
		sqlgraph.HasNeighbors(s, step)
	})
}

// HasGroupWith applies the HasEdge predicate on the "group" edge with a given conditions (other predicates).
func HasGroupWith(preds ...predicate.Group) predicate.RedeemCode {
	return predicate.RedeemCode(func(s *sql.Selector) {
		step := newGroupStep()
		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.RedeemCode) predicate.RedeemCode {
	return predicate.RedeemCode(sql.AndPredicates(predicates...))
}

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

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