// Code generated by ent, DO NOT EDIT.

package usagetotal

import (
	"time"

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

const (
	// Label holds the string label denoting the usagetotal type in the database.
	Label = "usage_total"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// 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"
	// FieldStatus holds the string denoting the status field in the database.
	FieldStatus = "status"
	// FieldType holds the string denoting the type field in the database.
	FieldType = "type"
	// FieldBotID holds the string denoting the bot_id field in the database.
	FieldBotID = "bot_id"
	// FieldTotalTokens holds the string denoting the total_tokens field in the database.
	FieldTotalTokens = "total_tokens"
	// FieldStartIndex holds the string denoting the start_index field in the database.
	FieldStartIndex = "start_index"
	// FieldEndIndex holds the string denoting the end_index field in the database.
	FieldEndIndex = "end_index"
	// FieldOrganizationID holds the string denoting the organization_id field in the database.
	FieldOrganizationID = "organization_id"
	// Table holds the table name of the usagetotal in the database.
	Table = "usage_total"
)

// Columns holds all SQL columns for usagetotal fields.
var Columns = []string{
	FieldID,
	FieldCreatedAt,
	FieldUpdatedAt,
	FieldStatus,
	FieldType,
	FieldBotID,
	FieldTotalTokens,
	FieldStartIndex,
	FieldEndIndex,
	FieldOrganizationID,
}

// 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 (
	// 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
	// DefaultStatus holds the default value on creation for the "status" field.
	DefaultStatus uint8
	// DefaultType holds the default value on creation for the "type" field.
	DefaultType int
	// DefaultBotID holds the default value on creation for the "bot_id" field.
	DefaultBotID string
	// DefaultTotalTokens holds the default value on creation for the "total_tokens" field.
	DefaultTotalTokens uint64
	// DefaultStartIndex holds the default value on creation for the "start_index" field.
	DefaultStartIndex uint64
	// DefaultEndIndex holds the default value on creation for the "end_index" field.
	DefaultEndIndex uint64
	// DefaultOrganizationID holds the default value on creation for the "organization_id" field.
	DefaultOrganizationID uint64
)

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

// 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()
}

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

// ByType orders the results by the type field.
func ByType(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldType, opts...).ToFunc()
}

// ByBotID orders the results by the bot_id field.
func ByBotID(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldBotID, opts...).ToFunc()
}

// ByTotalTokens orders the results by the total_tokens field.
func ByTotalTokens(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldTotalTokens, opts...).ToFunc()
}

// ByStartIndex orders the results by the start_index field.
func ByStartIndex(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldStartIndex, opts...).ToFunc()
}

// ByEndIndex orders the results by the end_index field.
func ByEndIndex(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldEndIndex, opts...).ToFunc()
}

// ByOrganizationID orders the results by the organization_id field.
func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldOrganizationID, opts...).ToFunc()
}
