// Code generated by ent, DO NOT EDIT.

package usagedetail

import (
	"time"

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

const (
	// Label holds the string label denoting the usagedetail type in the database.
	Label = "usage_detail"
	// 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"
	// FieldReceiverID holds the string denoting the receiver_id field in the database.
	FieldReceiverID = "receiver_id"
	// FieldApp holds the string denoting the app field in the database.
	FieldApp = "app"
	// FieldSessionID holds the string denoting the session_id field in the database.
	FieldSessionID = "session_id"
	// FieldRequest holds the string denoting the request field in the database.
	FieldRequest = "request"
	// FieldResponse holds the string denoting the response field in the database.
	FieldResponse = "response"
	// FieldTotalTokens holds the string denoting the total_tokens field in the database.
	FieldTotalTokens = "total_tokens"
	// FieldPromptTokens holds the string denoting the prompt_tokens field in the database.
	FieldPromptTokens = "prompt_tokens"
	// FieldCompletionTokens holds the string denoting the completion_tokens field in the database.
	FieldCompletionTokens = "completion_tokens"
	// FieldOrganizationID holds the string denoting the organization_id field in the database.
	FieldOrganizationID = "organization_id"
	// Table holds the table name of the usagedetail in the database.
	Table = "usage_detail"
)

// Columns holds all SQL columns for usagedetail fields.
var Columns = []string{
	FieldID,
	FieldCreatedAt,
	FieldUpdatedAt,
	FieldStatus,
	FieldType,
	FieldBotID,
	FieldReceiverID,
	FieldApp,
	FieldSessionID,
	FieldRequest,
	FieldResponse,
	FieldTotalTokens,
	FieldPromptTokens,
	FieldCompletionTokens,
	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
	// DefaultReceiverID holds the default value on creation for the "receiver_id" field.
	DefaultReceiverID string
	// DefaultApp holds the default value on creation for the "app" field.
	DefaultApp int
	// DefaultSessionID holds the default value on creation for the "session_id" field.
	DefaultSessionID uint64
	// DefaultRequest holds the default value on creation for the "request" field.
	DefaultRequest string
	// DefaultResponse holds the default value on creation for the "response" field.
	DefaultResponse string
	// DefaultTotalTokens holds the default value on creation for the "total_tokens" field.
	DefaultTotalTokens uint64
	// DefaultPromptTokens holds the default value on creation for the "prompt_tokens" field.
	DefaultPromptTokens uint64
	// DefaultCompletionTokens holds the default value on creation for the "completion_tokens" field.
	DefaultCompletionTokens uint64
	// DefaultOrganizationID holds the default value on creation for the "organization_id" field.
	DefaultOrganizationID uint64
)

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

// ByReceiverID orders the results by the receiver_id field.
func ByReceiverID(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldReceiverID, opts...).ToFunc()
}

// ByApp orders the results by the app field.
func ByApp(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldApp, opts...).ToFunc()
}

// BySessionID orders the results by the session_id field.
func BySessionID(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldSessionID, opts...).ToFunc()
}

// ByRequest orders the results by the request field.
func ByRequest(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldRequest, opts...).ToFunc()
}

// ByResponse orders the results by the response field.
func ByResponse(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldResponse, opts...).ToFunc()
}

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

// ByPromptTokens orders the results by the prompt_tokens field.
func ByPromptTokens(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldPromptTokens, opts...).ToFunc()
}

// ByCompletionTokens orders the results by the completion_tokens field.
func ByCompletionTokens(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldCompletionTokens, opts...).ToFunc()
}

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