// Code generated by ent, DO NOT EDIT.

package orders

import (
	"time"

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

const (
	// Label holds the string label denoting the orders type in the database.
	Label = "orders"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldConsumerID holds the string denoting the consumer_id field in the database.
	FieldConsumerID = "consumer_id"
	// FieldPlayerID holds the string denoting the player_id field in the database.
	FieldPlayerID = "player_id"
	// FieldShopID holds the string denoting the shop_id field in the database.
	FieldShopID = "shop_id"
	// FieldServiceSnapshot holds the string denoting the service_snapshot field in the database.
	FieldServiceSnapshot = "service_snapshot"
	// FieldStatus holds the string denoting the status field in the database.
	FieldStatus = "status"
	// FieldTotalPrice holds the string denoting the total_price field in the database.
	FieldTotalPrice = "total_price"
	// FieldNote holds the string denoting the note field in the database.
	FieldNote = "note"
	// FieldVersion holds the string denoting the version field in the database.
	FieldVersion = "version"
	// FieldTimeoutJobID holds the string denoting the timeout_job_id field in the database.
	FieldTimeoutJobID = "timeout_job_id"
	// FieldSearchText holds the string denoting the search_text field in the database.
	FieldSearchText = "search_text"
	// FieldCreatedAt holds the string denoting the created_at field in the database.
	FieldCreatedAt = "created_at"
	// FieldAcceptedAt holds the string denoting the accepted_at field in the database.
	FieldAcceptedAt = "accepted_at"
	// FieldClosedAt holds the string denoting the closed_at field in the database.
	FieldClosedAt = "closed_at"
	// FieldCompletedAt holds the string denoting the completed_at field in the database.
	FieldCompletedAt = "completed_at"
	// FieldCancelledAt holds the string denoting the cancelled_at field in the database.
	FieldCancelledAt = "cancelled_at"
	// FieldUpdatedAt holds the string denoting the updated_at field in the database.
	FieldUpdatedAt = "updated_at"
	// Table holds the table name of the orders in the database.
	Table = "orders"
)

// Columns holds all SQL columns for orders fields.
var Columns = []string{
	FieldID,
	FieldConsumerID,
	FieldPlayerID,
	FieldShopID,
	FieldServiceSnapshot,
	FieldStatus,
	FieldTotalPrice,
	FieldNote,
	FieldVersion,
	FieldTimeoutJobID,
	FieldSearchText,
	FieldCreatedAt,
	FieldAcceptedAt,
	FieldClosedAt,
	FieldCompletedAt,
	FieldCancelledAt,
	FieldUpdatedAt,
}

// 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 (
	// DefaultStatus holds the default value on creation for the "status" field.
	DefaultStatus string
	// StatusValidator is a validator for the "status" field. It is called by the builders before save.
	StatusValidator func(string) error
	// DefaultVersion holds the default value on creation for the "version" field.
	DefaultVersion int
	// TimeoutJobIDValidator is a validator for the "timeout_job_id" field. It is called by the builders before save.
	TimeoutJobIDValidator func(string) error
	// DefaultCreatedAt holds the default value on creation for the "created_at" field.
	DefaultCreatedAt func() time.Time
	// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
	DefaultUpdatedAt func() time.Time
	// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
	UpdateDefaultUpdatedAt func() time.Time
)

// OrderOption defines the ordering options for the Orders 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()
}

// ByConsumerID orders the results by the consumer_id field.
func ByConsumerID(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldConsumerID, opts...).ToFunc()
}

// ByPlayerID orders the results by the player_id field.
func ByPlayerID(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldPlayerID, opts...).ToFunc()
}

// ByShopID orders the results by the shop_id field.
func ByShopID(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldShopID, opts...).ToFunc()
}

// ByStatus orders the results by the status field.
func ByStatus(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldStatus, opts...).ToFunc()
}

// ByTotalPrice orders the results by the total_price field.
func ByTotalPrice(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldTotalPrice, opts...).ToFunc()
}

// ByNote orders the results by the note field.
func ByNote(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldNote, opts...).ToFunc()
}

// ByVersion orders the results by the version field.
func ByVersion(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldVersion, opts...).ToFunc()
}

// ByTimeoutJobID orders the results by the timeout_job_id field.
func ByTimeoutJobID(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldTimeoutJobID, opts...).ToFunc()
}

// BySearchText orders the results by the search_text field.
func BySearchText(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldSearchText, opts...).ToFunc()
}

// ByCreatedAt orders the results by the created_at field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
}

// ByAcceptedAt orders the results by the accepted_at field.
func ByAcceptedAt(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldAcceptedAt, opts...).ToFunc()
}

// ByClosedAt orders the results by the closed_at field.
func ByClosedAt(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldClosedAt, opts...).ToFunc()
}

// ByCompletedAt orders the results by the completed_at field.
func ByCompletedAt(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldCompletedAt, opts...).ToFunc()
}

// ByCancelledAt orders the results by the cancelled_at field.
func ByCancelledAt(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldCancelledAt, opts...).ToFunc()
}

// ByUpdatedAt orders the results by the updated_at field.
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
}
