// Code generated by ent, DO NOT EDIT.

package invitationstate

import (
	"time"

	"entgo.io/ent/dialect/sql"
)

const (
	// Label holds the string label denoting the invitationstate type in the database.
	Label = "invitation_state"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldCalendarID holds the string denoting the calendar_id field in the database.
	FieldCalendarID = "calendar_id"
	// FieldUID holds the string denoting the uid field in the database.
	FieldUID = "uid"
	// FieldEventStart holds the string denoting the event_start field in the database.
	FieldEventStart = "event_start"
	// FieldNotifiedAt holds the string denoting the notified_at field in the database.
	FieldNotifiedAt = "notified_at"
	// Table holds the table name of the invitationstate in the database.
	Table = "invitation_states"
)

// Columns holds all SQL columns for invitationstate fields.
var Columns = []string{
	FieldID,
	FieldCalendarID,
	FieldUID,
	FieldEventStart,
	FieldNotifiedAt,
}

// ValidColumn reports if the column name is valid (part of the table columns).
func ValidColumn(column string) bool {
	for i := range Columns {
		if column == Columns[i] {
			return true
		}
	}
	return false
}

var (
	// CalendarIDValidator is a validator for the "calendar_id" field. It is called by the builders before save.
	CalendarIDValidator func(string) error
	// UIDValidator is a validator for the "uid" field. It is called by the builders before save.
	UIDValidator func(string) error
	// DefaultNotifiedAt holds the default value on creation for the "notified_at" field.
	DefaultNotifiedAt func() time.Time
)

// OrderOption defines the ordering options for the InvitationState queries.
type OrderOption func(*sql.Selector)

// ByID orders the results by the id field.
func ByID(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldID, opts...).ToFunc()
}

// ByCalendarID orders the results by the calendar_id field.
func ByCalendarID(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldCalendarID, opts...).ToFunc()
}

// ByUID orders the results by the uid field.
func ByUID(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldUID, opts...).ToFunc()
}

// ByEventStart orders the results by the event_start field.
func ByEventStart(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldEventStart, opts...).ToFunc()
}

// ByNotifiedAt orders the results by the notified_at field.
func ByNotifiedAt(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldNotifiedAt, opts...).ToFunc()
}
