// Code generated by entc, DO NOT EDIT.

package triage

import (
	"time"

	"entgo.io/ent/dialect/sql"

	"github.com/pingcap/test-infra/common/model"
	"github.com/pingcap/test-infra/services/tcms/service/store/v2/ent/predicate"
)

// ID filters vertices based on their ID field.
func ID(id model.ID) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.EQ(s.C(FieldID), id))
	})
}

// IDEQ applies the EQ predicate on the ID field.
func IDEQ(id model.ID) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.EQ(s.C(FieldID), id))
	})
}

// IDNEQ applies the NEQ predicate on the ID field.
func IDNEQ(id model.ID) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.NEQ(s.C(FieldID), id))
	})
}

// IDIn applies the In predicate on the ID field.
func IDIn(ids ...model.ID) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		// if not arguments were provided, append the FALSE constants,
		// since we can't apply "IN ()". This will make this predicate falsy.
		if len(ids) == 0 {
			s.Where(sql.False())
			return
		}
		v := make([]interface{}, len(ids))
		for i := range v {
			v[i] = ids[i]
		}
		s.Where(sql.In(s.C(FieldID), v...))
	})
}

// IDNotIn applies the NotIn predicate on the ID field.
func IDNotIn(ids ...model.ID) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		// if not arguments were provided, append the FALSE constants,
		// since we can't apply "IN ()". This will make this predicate falsy.
		if len(ids) == 0 {
			s.Where(sql.False())
			return
		}
		v := make([]interface{}, len(ids))
		for i := range v {
			v[i] = ids[i]
		}
		s.Where(sql.NotIn(s.C(FieldID), v...))
	})
}

// IDGT applies the GT predicate on the ID field.
func IDGT(id model.ID) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.GT(s.C(FieldID), id))
	})
}

// IDGTE applies the GTE predicate on the ID field.
func IDGTE(id model.ID) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.GTE(s.C(FieldID), id))
	})
}

// IDLT applies the LT predicate on the ID field.
func IDLT(id model.ID) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.LT(s.C(FieldID), id))
	})
}

// IDLTE applies the LTE predicate on the ID field.
func IDLTE(id model.ID) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.LTE(s.C(FieldID), id))
	})
}

// CreatedAt applies equality check predicate on the "createdAt" field. It's identical to CreatedAtEQ.
func CreatedAt(v time.Time) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.EQ(s.C(FieldCreatedAt), v))
	})
}

// UpdatedAt applies equality check predicate on the "updatedAt" field. It's identical to UpdatedAtEQ.
func UpdatedAt(v time.Time) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.EQ(s.C(FieldUpdatedAt), v))
	})
}

// PlanExecutionID applies equality check predicate on the "planExecutionID" field. It's identical to PlanExecutionIDEQ.
func PlanExecutionID(v model.ID) predicate.Triage {
	vc := uint64(v)
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.EQ(s.C(FieldPlanExecutionID), vc))
	})
}

// PlanID applies equality check predicate on the "planID" field. It's identical to PlanIDEQ.
func PlanID(v model.ID) predicate.Triage {
	vc := uint64(v)
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.EQ(s.C(FieldPlanID), vc))
	})
}

// StartedAt applies equality check predicate on the "startedAt" field. It's identical to StartedAtEQ.
func StartedAt(v time.Time) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.EQ(s.C(FieldStartedAt), v))
	})
}

// TriagedAt applies equality check predicate on the "triagedAt" field. It's identical to TriagedAtEQ.
func TriagedAt(v time.Time) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.EQ(s.C(FieldTriagedAt), v))
	})
}

// Note applies equality check predicate on the "note" field. It's identical to NoteEQ.
func Note(v string) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.EQ(s.C(FieldNote), v))
	})
}

// CreatedAtEQ applies the EQ predicate on the "createdAt" field.
func CreatedAtEQ(v time.Time) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.EQ(s.C(FieldCreatedAt), v))
	})
}

// CreatedAtNEQ applies the NEQ predicate on the "createdAt" field.
func CreatedAtNEQ(v time.Time) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.NEQ(s.C(FieldCreatedAt), v))
	})
}

// CreatedAtIn applies the In predicate on the "createdAt" field.
func CreatedAtIn(vs ...time.Time) predicate.Triage {
	v := make([]interface{}, len(vs))
	for i := range v {
		v[i] = vs[i]
	}
	return predicate.Triage(func(s *sql.Selector) {
		// if not arguments were provided, append the FALSE constants,
		// since we can't apply "IN ()". This will make this predicate falsy.
		if len(v) == 0 {
			s.Where(sql.False())
			return
		}
		s.Where(sql.In(s.C(FieldCreatedAt), v...))
	})
}

// CreatedAtNotIn applies the NotIn predicate on the "createdAt" field.
func CreatedAtNotIn(vs ...time.Time) predicate.Triage {
	v := make([]interface{}, len(vs))
	for i := range v {
		v[i] = vs[i]
	}
	return predicate.Triage(func(s *sql.Selector) {
		// if not arguments were provided, append the FALSE constants,
		// since we can't apply "IN ()". This will make this predicate falsy.
		if len(v) == 0 {
			s.Where(sql.False())
			return
		}
		s.Where(sql.NotIn(s.C(FieldCreatedAt), v...))
	})
}

// CreatedAtGT applies the GT predicate on the "createdAt" field.
func CreatedAtGT(v time.Time) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.GT(s.C(FieldCreatedAt), v))
	})
}

// CreatedAtGTE applies the GTE predicate on the "createdAt" field.
func CreatedAtGTE(v time.Time) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.GTE(s.C(FieldCreatedAt), v))
	})
}

// CreatedAtLT applies the LT predicate on the "createdAt" field.
func CreatedAtLT(v time.Time) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.LT(s.C(FieldCreatedAt), v))
	})
}

// CreatedAtLTE applies the LTE predicate on the "createdAt" field.
func CreatedAtLTE(v time.Time) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.LTE(s.C(FieldCreatedAt), v))
	})
}

// UpdatedAtEQ applies the EQ predicate on the "updatedAt" field.
func UpdatedAtEQ(v time.Time) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.EQ(s.C(FieldUpdatedAt), v))
	})
}

// UpdatedAtNEQ applies the NEQ predicate on the "updatedAt" field.
func UpdatedAtNEQ(v time.Time) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.NEQ(s.C(FieldUpdatedAt), v))
	})
}

// UpdatedAtIn applies the In predicate on the "updatedAt" field.
func UpdatedAtIn(vs ...time.Time) predicate.Triage {
	v := make([]interface{}, len(vs))
	for i := range v {
		v[i] = vs[i]
	}
	return predicate.Triage(func(s *sql.Selector) {
		// if not arguments were provided, append the FALSE constants,
		// since we can't apply "IN ()". This will make this predicate falsy.
		if len(v) == 0 {
			s.Where(sql.False())
			return
		}
		s.Where(sql.In(s.C(FieldUpdatedAt), v...))
	})
}

// UpdatedAtNotIn applies the NotIn predicate on the "updatedAt" field.
func UpdatedAtNotIn(vs ...time.Time) predicate.Triage {
	v := make([]interface{}, len(vs))
	for i := range v {
		v[i] = vs[i]
	}
	return predicate.Triage(func(s *sql.Selector) {
		// if not arguments were provided, append the FALSE constants,
		// since we can't apply "IN ()". This will make this predicate falsy.
		if len(v) == 0 {
			s.Where(sql.False())
			return
		}
		s.Where(sql.NotIn(s.C(FieldUpdatedAt), v...))
	})
}

// UpdatedAtGT applies the GT predicate on the "updatedAt" field.
func UpdatedAtGT(v time.Time) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.GT(s.C(FieldUpdatedAt), v))
	})
}

// UpdatedAtGTE applies the GTE predicate on the "updatedAt" field.
func UpdatedAtGTE(v time.Time) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.GTE(s.C(FieldUpdatedAt), v))
	})
}

// UpdatedAtLT applies the LT predicate on the "updatedAt" field.
func UpdatedAtLT(v time.Time) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.LT(s.C(FieldUpdatedAt), v))
	})
}

// UpdatedAtLTE applies the LTE predicate on the "updatedAt" field.
func UpdatedAtLTE(v time.Time) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.LTE(s.C(FieldUpdatedAt), v))
	})
}

// PlanExecutionIDEQ applies the EQ predicate on the "planExecutionID" field.
func PlanExecutionIDEQ(v model.ID) predicate.Triage {
	vc := uint64(v)
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.EQ(s.C(FieldPlanExecutionID), vc))
	})
}

// PlanExecutionIDNEQ applies the NEQ predicate on the "planExecutionID" field.
func PlanExecutionIDNEQ(v model.ID) predicate.Triage {
	vc := uint64(v)
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.NEQ(s.C(FieldPlanExecutionID), vc))
	})
}

// PlanExecutionIDIn applies the In predicate on the "planExecutionID" field.
func PlanExecutionIDIn(vs ...model.ID) predicate.Triage {
	v := make([]interface{}, len(vs))
	for i := range v {
		v[i] = uint64(vs[i])
	}
	return predicate.Triage(func(s *sql.Selector) {
		// if not arguments were provided, append the FALSE constants,
		// since we can't apply "IN ()". This will make this predicate falsy.
		if len(v) == 0 {
			s.Where(sql.False())
			return
		}
		s.Where(sql.In(s.C(FieldPlanExecutionID), v...))
	})
}

// PlanExecutionIDNotIn applies the NotIn predicate on the "planExecutionID" field.
func PlanExecutionIDNotIn(vs ...model.ID) predicate.Triage {
	v := make([]interface{}, len(vs))
	for i := range v {
		v[i] = uint64(vs[i])
	}
	return predicate.Triage(func(s *sql.Selector) {
		// if not arguments were provided, append the FALSE constants,
		// since we can't apply "IN ()". This will make this predicate falsy.
		if len(v) == 0 {
			s.Where(sql.False())
			return
		}
		s.Where(sql.NotIn(s.C(FieldPlanExecutionID), v...))
	})
}

// PlanExecutionIDGT applies the GT predicate on the "planExecutionID" field.
func PlanExecutionIDGT(v model.ID) predicate.Triage {
	vc := uint64(v)
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.GT(s.C(FieldPlanExecutionID), vc))
	})
}

// PlanExecutionIDGTE applies the GTE predicate on the "planExecutionID" field.
func PlanExecutionIDGTE(v model.ID) predicate.Triage {
	vc := uint64(v)
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.GTE(s.C(FieldPlanExecutionID), vc))
	})
}

// PlanExecutionIDLT applies the LT predicate on the "planExecutionID" field.
func PlanExecutionIDLT(v model.ID) predicate.Triage {
	vc := uint64(v)
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.LT(s.C(FieldPlanExecutionID), vc))
	})
}

// PlanExecutionIDLTE applies the LTE predicate on the "planExecutionID" field.
func PlanExecutionIDLTE(v model.ID) predicate.Triage {
	vc := uint64(v)
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.LTE(s.C(FieldPlanExecutionID), vc))
	})
}

// PlanIDEQ applies the EQ predicate on the "planID" field.
func PlanIDEQ(v model.ID) predicate.Triage {
	vc := uint64(v)
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.EQ(s.C(FieldPlanID), vc))
	})
}

// PlanIDNEQ applies the NEQ predicate on the "planID" field.
func PlanIDNEQ(v model.ID) predicate.Triage {
	vc := uint64(v)
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.NEQ(s.C(FieldPlanID), vc))
	})
}

// PlanIDIn applies the In predicate on the "planID" field.
func PlanIDIn(vs ...model.ID) predicate.Triage {
	v := make([]interface{}, len(vs))
	for i := range v {
		v[i] = uint64(vs[i])
	}
	return predicate.Triage(func(s *sql.Selector) {
		// if not arguments were provided, append the FALSE constants,
		// since we can't apply "IN ()". This will make this predicate falsy.
		if len(v) == 0 {
			s.Where(sql.False())
			return
		}
		s.Where(sql.In(s.C(FieldPlanID), v...))
	})
}

// PlanIDNotIn applies the NotIn predicate on the "planID" field.
func PlanIDNotIn(vs ...model.ID) predicate.Triage {
	v := make([]interface{}, len(vs))
	for i := range v {
		v[i] = uint64(vs[i])
	}
	return predicate.Triage(func(s *sql.Selector) {
		// if not arguments were provided, append the FALSE constants,
		// since we can't apply "IN ()". This will make this predicate falsy.
		if len(v) == 0 {
			s.Where(sql.False())
			return
		}
		s.Where(sql.NotIn(s.C(FieldPlanID), v...))
	})
}

// PlanIDGT applies the GT predicate on the "planID" field.
func PlanIDGT(v model.ID) predicate.Triage {
	vc := uint64(v)
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.GT(s.C(FieldPlanID), vc))
	})
}

// PlanIDGTE applies the GTE predicate on the "planID" field.
func PlanIDGTE(v model.ID) predicate.Triage {
	vc := uint64(v)
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.GTE(s.C(FieldPlanID), vc))
	})
}

// PlanIDLT applies the LT predicate on the "planID" field.
func PlanIDLT(v model.ID) predicate.Triage {
	vc := uint64(v)
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.LT(s.C(FieldPlanID), vc))
	})
}

// PlanIDLTE applies the LTE predicate on the "planID" field.
func PlanIDLTE(v model.ID) predicate.Triage {
	vc := uint64(v)
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.LTE(s.C(FieldPlanID), vc))
	})
}

// TriagePhaseEQ applies the EQ predicate on the "triagePhase" field.
func TriagePhaseEQ(v model.TriagePhase) predicate.Triage {
	vc := v
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.EQ(s.C(FieldTriagePhase), vc))
	})
}

// TriagePhaseNEQ applies the NEQ predicate on the "triagePhase" field.
func TriagePhaseNEQ(v model.TriagePhase) predicate.Triage {
	vc := v
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.NEQ(s.C(FieldTriagePhase), vc))
	})
}

// TriagePhaseIn applies the In predicate on the "triagePhase" field.
func TriagePhaseIn(vs ...model.TriagePhase) predicate.Triage {
	v := make([]interface{}, len(vs))
	for i := range v {
		v[i] = vs[i]
	}
	return predicate.Triage(func(s *sql.Selector) {
		// if not arguments were provided, append the FALSE constants,
		// since we can't apply "IN ()". This will make this predicate falsy.
		if len(v) == 0 {
			s.Where(sql.False())
			return
		}
		s.Where(sql.In(s.C(FieldTriagePhase), v...))
	})
}

// TriagePhaseNotIn applies the NotIn predicate on the "triagePhase" field.
func TriagePhaseNotIn(vs ...model.TriagePhase) predicate.Triage {
	v := make([]interface{}, len(vs))
	for i := range v {
		v[i] = vs[i]
	}
	return predicate.Triage(func(s *sql.Selector) {
		// if not arguments were provided, append the FALSE constants,
		// since we can't apply "IN ()". This will make this predicate falsy.
		if len(v) == 0 {
			s.Where(sql.False())
			return
		}
		s.Where(sql.NotIn(s.C(FieldTriagePhase), v...))
	})
}

// StartedAtEQ applies the EQ predicate on the "startedAt" field.
func StartedAtEQ(v time.Time) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.EQ(s.C(FieldStartedAt), v))
	})
}

// StartedAtNEQ applies the NEQ predicate on the "startedAt" field.
func StartedAtNEQ(v time.Time) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.NEQ(s.C(FieldStartedAt), v))
	})
}

// StartedAtIn applies the In predicate on the "startedAt" field.
func StartedAtIn(vs ...time.Time) predicate.Triage {
	v := make([]interface{}, len(vs))
	for i := range v {
		v[i] = vs[i]
	}
	return predicate.Triage(func(s *sql.Selector) {
		// if not arguments were provided, append the FALSE constants,
		// since we can't apply "IN ()". This will make this predicate falsy.
		if len(v) == 0 {
			s.Where(sql.False())
			return
		}
		s.Where(sql.In(s.C(FieldStartedAt), v...))
	})
}

// StartedAtNotIn applies the NotIn predicate on the "startedAt" field.
func StartedAtNotIn(vs ...time.Time) predicate.Triage {
	v := make([]interface{}, len(vs))
	for i := range v {
		v[i] = vs[i]
	}
	return predicate.Triage(func(s *sql.Selector) {
		// if not arguments were provided, append the FALSE constants,
		// since we can't apply "IN ()". This will make this predicate falsy.
		if len(v) == 0 {
			s.Where(sql.False())
			return
		}
		s.Where(sql.NotIn(s.C(FieldStartedAt), v...))
	})
}

// StartedAtGT applies the GT predicate on the "startedAt" field.
func StartedAtGT(v time.Time) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.GT(s.C(FieldStartedAt), v))
	})
}

// StartedAtGTE applies the GTE predicate on the "startedAt" field.
func StartedAtGTE(v time.Time) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.GTE(s.C(FieldStartedAt), v))
	})
}

// StartedAtLT applies the LT predicate on the "startedAt" field.
func StartedAtLT(v time.Time) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.LT(s.C(FieldStartedAt), v))
	})
}

// StartedAtLTE applies the LTE predicate on the "startedAt" field.
func StartedAtLTE(v time.Time) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.LTE(s.C(FieldStartedAt), v))
	})
}

// StartedAtIsNil applies the IsNil predicate on the "startedAt" field.
func StartedAtIsNil() predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.IsNull(s.C(FieldStartedAt)))
	})
}

// StartedAtNotNil applies the NotNil predicate on the "startedAt" field.
func StartedAtNotNil() predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.NotNull(s.C(FieldStartedAt)))
	})
}

// TriagedAtEQ applies the EQ predicate on the "triagedAt" field.
func TriagedAtEQ(v time.Time) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.EQ(s.C(FieldTriagedAt), v))
	})
}

// TriagedAtNEQ applies the NEQ predicate on the "triagedAt" field.
func TriagedAtNEQ(v time.Time) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.NEQ(s.C(FieldTriagedAt), v))
	})
}

// TriagedAtIn applies the In predicate on the "triagedAt" field.
func TriagedAtIn(vs ...time.Time) predicate.Triage {
	v := make([]interface{}, len(vs))
	for i := range v {
		v[i] = vs[i]
	}
	return predicate.Triage(func(s *sql.Selector) {
		// if not arguments were provided, append the FALSE constants,
		// since we can't apply "IN ()". This will make this predicate falsy.
		if len(v) == 0 {
			s.Where(sql.False())
			return
		}
		s.Where(sql.In(s.C(FieldTriagedAt), v...))
	})
}

// TriagedAtNotIn applies the NotIn predicate on the "triagedAt" field.
func TriagedAtNotIn(vs ...time.Time) predicate.Triage {
	v := make([]interface{}, len(vs))
	for i := range v {
		v[i] = vs[i]
	}
	return predicate.Triage(func(s *sql.Selector) {
		// if not arguments were provided, append the FALSE constants,
		// since we can't apply "IN ()". This will make this predicate falsy.
		if len(v) == 0 {
			s.Where(sql.False())
			return
		}
		s.Where(sql.NotIn(s.C(FieldTriagedAt), v...))
	})
}

// TriagedAtGT applies the GT predicate on the "triagedAt" field.
func TriagedAtGT(v time.Time) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.GT(s.C(FieldTriagedAt), v))
	})
}

// TriagedAtGTE applies the GTE predicate on the "triagedAt" field.
func TriagedAtGTE(v time.Time) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.GTE(s.C(FieldTriagedAt), v))
	})
}

// TriagedAtLT applies the LT predicate on the "triagedAt" field.
func TriagedAtLT(v time.Time) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.LT(s.C(FieldTriagedAt), v))
	})
}

// TriagedAtLTE applies the LTE predicate on the "triagedAt" field.
func TriagedAtLTE(v time.Time) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.LTE(s.C(FieldTriagedAt), v))
	})
}

// TriagedAtIsNil applies the IsNil predicate on the "triagedAt" field.
func TriagedAtIsNil() predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.IsNull(s.C(FieldTriagedAt)))
	})
}

// TriagedAtNotNil applies the NotNil predicate on the "triagedAt" field.
func TriagedAtNotNil() predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.NotNull(s.C(FieldTriagedAt)))
	})
}

// SolutionEQ applies the EQ predicate on the "solution" field.
func SolutionEQ(v model.ExecFailSolution) predicate.Triage {
	vc := v
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.EQ(s.C(FieldSolution), vc))
	})
}

// SolutionNEQ applies the NEQ predicate on the "solution" field.
func SolutionNEQ(v model.ExecFailSolution) predicate.Triage {
	vc := v
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.NEQ(s.C(FieldSolution), vc))
	})
}

// SolutionIn applies the In predicate on the "solution" field.
func SolutionIn(vs ...model.ExecFailSolution) predicate.Triage {
	v := make([]interface{}, len(vs))
	for i := range v {
		v[i] = vs[i]
	}
	return predicate.Triage(func(s *sql.Selector) {
		// if not arguments were provided, append the FALSE constants,
		// since we can't apply "IN ()". This will make this predicate falsy.
		if len(v) == 0 {
			s.Where(sql.False())
			return
		}
		s.Where(sql.In(s.C(FieldSolution), v...))
	})
}

// SolutionNotIn applies the NotIn predicate on the "solution" field.
func SolutionNotIn(vs ...model.ExecFailSolution) predicate.Triage {
	v := make([]interface{}, len(vs))
	for i := range v {
		v[i] = vs[i]
	}
	return predicate.Triage(func(s *sql.Selector) {
		// if not arguments were provided, append the FALSE constants,
		// since we can't apply "IN ()". This will make this predicate falsy.
		if len(v) == 0 {
			s.Where(sql.False())
			return
		}
		s.Where(sql.NotIn(s.C(FieldSolution), v...))
	})
}

// NoteEQ applies the EQ predicate on the "note" field.
func NoteEQ(v string) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.EQ(s.C(FieldNote), v))
	})
}

// NoteNEQ applies the NEQ predicate on the "note" field.
func NoteNEQ(v string) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.NEQ(s.C(FieldNote), v))
	})
}

// NoteIn applies the In predicate on the "note" field.
func NoteIn(vs ...string) predicate.Triage {
	v := make([]interface{}, len(vs))
	for i := range v {
		v[i] = vs[i]
	}
	return predicate.Triage(func(s *sql.Selector) {
		// if not arguments were provided, append the FALSE constants,
		// since we can't apply "IN ()". This will make this predicate falsy.
		if len(v) == 0 {
			s.Where(sql.False())
			return
		}
		s.Where(sql.In(s.C(FieldNote), v...))
	})
}

// NoteNotIn applies the NotIn predicate on the "note" field.
func NoteNotIn(vs ...string) predicate.Triage {
	v := make([]interface{}, len(vs))
	for i := range v {
		v[i] = vs[i]
	}
	return predicate.Triage(func(s *sql.Selector) {
		// if not arguments were provided, append the FALSE constants,
		// since we can't apply "IN ()". This will make this predicate falsy.
		if len(v) == 0 {
			s.Where(sql.False())
			return
		}
		s.Where(sql.NotIn(s.C(FieldNote), v...))
	})
}

// NoteGT applies the GT predicate on the "note" field.
func NoteGT(v string) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.GT(s.C(FieldNote), v))
	})
}

// NoteGTE applies the GTE predicate on the "note" field.
func NoteGTE(v string) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.GTE(s.C(FieldNote), v))
	})
}

// NoteLT applies the LT predicate on the "note" field.
func NoteLT(v string) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.LT(s.C(FieldNote), v))
	})
}

// NoteLTE applies the LTE predicate on the "note" field.
func NoteLTE(v string) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.LTE(s.C(FieldNote), v))
	})
}

// NoteContains applies the Contains predicate on the "note" field.
func NoteContains(v string) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.Contains(s.C(FieldNote), v))
	})
}

// NoteHasPrefix applies the HasPrefix predicate on the "note" field.
func NoteHasPrefix(v string) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.HasPrefix(s.C(FieldNote), v))
	})
}

// NoteHasSuffix applies the HasSuffix predicate on the "note" field.
func NoteHasSuffix(v string) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.HasSuffix(s.C(FieldNote), v))
	})
}

// NoteEqualFold applies the EqualFold predicate on the "note" field.
func NoteEqualFold(v string) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.EqualFold(s.C(FieldNote), v))
	})
}

// NoteContainsFold applies the ContainsFold predicate on the "note" field.
func NoteContainsFold(v string) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s.Where(sql.ContainsFold(s.C(FieldNote), v))
	})
}

// And groups predicates with the AND operator between them.
func And(predicates ...predicate.Triage) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s1 := s.Clone().SetP(nil)
		for _, p := range predicates {
			p(s1)
		}
		s.Where(s1.P())
	})
}

// Or groups predicates with the OR operator between them.
func Or(predicates ...predicate.Triage) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		s1 := s.Clone().SetP(nil)
		for i, p := range predicates {
			if i > 0 {
				s1.Or()
			}
			p(s1)
		}
		s.Where(s1.P())
	})
}

// Not applies the not operator on the given predicate.
func Not(p predicate.Triage) predicate.Triage {
	return predicate.Triage(func(s *sql.Selector) {
		p(s.Not())
	})
}
