// Code generated by ent, DO NOT EDIT.

package playerservices

import (
	"time"

	"entgo.io/ent/dialect/sql"
	"github.com/shopspring/decimal"
)

const (
	// Label holds the string label denoting the playerservices type in the database.
	Label = "player_services"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldPlayerID holds the string denoting the player_id field in the database.
	FieldPlayerID = "player_id"
	// FieldGameID holds the string denoting the game_id field in the database.
	FieldGameID = "game_id"
	// FieldTitle holds the string denoting the title field in the database.
	FieldTitle = "title"
	// FieldDescription holds the string denoting the description field in the database.
	FieldDescription = "description"
	// FieldPrice holds the string denoting the price field in the database.
	FieldPrice = "price"
	// FieldUnit holds the string denoting the unit field in the database.
	FieldUnit = "unit"
	// FieldRankRange holds the string denoting the rank_range field in the database.
	FieldRankRange = "rank_range"
	// FieldAvailability holds the string denoting the availability field in the database.
	FieldAvailability = "availability"
	// FieldRating holds the string denoting the rating field in the database.
	FieldRating = "rating"
	// FieldIsActive holds the string denoting the is_active field in the database.
	FieldIsActive = "is_active"
	// FieldCreatedAt holds the string denoting the created_at field in the database.
	FieldCreatedAt = "created_at"
	// FieldUpdatedAt holds the string denoting the updated_at field in the database.
	FieldUpdatedAt = "updated_at"
	// Table holds the table name of the playerservices in the database.
	Table = "player_services"
)

// Columns holds all SQL columns for playerservices fields.
var Columns = []string{
	FieldID,
	FieldPlayerID,
	FieldGameID,
	FieldTitle,
	FieldDescription,
	FieldPrice,
	FieldUnit,
	FieldRankRange,
	FieldAvailability,
	FieldRating,
	FieldIsActive,
	FieldCreatedAt,
	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 (
	// TitleValidator is a validator for the "title" field. It is called by the builders before save.
	TitleValidator func(string) error
	// UnitValidator is a validator for the "unit" field. It is called by the builders before save.
	UnitValidator func(string) error
	// RankRangeValidator is a validator for the "rank_range" field. It is called by the builders before save.
	RankRangeValidator func(string) error
	// DefaultAvailability holds the default value on creation for the "availability" field.
	DefaultAvailability []string
	// DefaultRating holds the default value on creation for the "rating" field.
	DefaultRating decimal.Decimal
	// DefaultIsActive holds the default value on creation for the "is_active" field.
	DefaultIsActive bool
	// 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 PlayerServices 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()
}

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

// ByGameID orders the results by the game_id field.
func ByGameID(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldGameID, opts...).ToFunc()
}

// ByTitle orders the results by the title field.
func ByTitle(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldTitle, opts...).ToFunc()
}

// ByDescription orders the results by the description field.
func ByDescription(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldDescription, opts...).ToFunc()
}

// ByPrice orders the results by the price field.
func ByPrice(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldPrice, opts...).ToFunc()
}

// ByUnit orders the results by the unit field.
func ByUnit(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldUnit, opts...).ToFunc()
}

// ByRankRange orders the results by the rank_range field.
func ByRankRange(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldRankRange, opts...).ToFunc()
}

// ByRating orders the results by the rating field.
func ByRating(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldRating, opts...).ToFunc()
}

// ByIsActive orders the results by the is_active field.
func ByIsActive(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldIsActive, opts...).ToFunc()
}

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

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