// Code generated by ent, DO NOT EDIT.

package docserverproject

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

const (
	// Label holds the string label denoting the docserverproject type in the database.
	Label = "doc_server_project"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldProjectName holds the string denoting the project_name field in the database.
	FieldProjectName = "project_name"
	// FieldSourceType holds the string denoting the source_type field in the database.
	FieldSourceType = "source_type"
	// FieldTargetType holds the string denoting the target_type field in the database.
	FieldTargetType = "target_type"
	// FieldSourceURL holds the string denoting the source_url field in the database.
	FieldSourceURL = "source_url"
	// FieldTargetURL holds the string denoting the target_url field in the database.
	FieldTargetURL = "target_url"
	// FieldTaskID holds the string denoting the task_id field in the database.
	FieldTaskID = "task_id"
	// FieldAppID holds the string denoting the app_id field in the database.
	FieldAppID = "app_id"
	// FieldStatus holds the string denoting the status field in the database.
	FieldStatus = "status"
	// FieldCreatedAt holds the string denoting the created_at field in the database.
	FieldCreatedAt = "created_at"
	// Table holds the table name of the docserverproject in the database.
	Table = "doc_server_project"
)

// Columns holds all SQL columns for docserverproject fields.
var Columns = []string{
	FieldID,
	FieldProjectName,
	FieldSourceType,
	FieldTargetType,
	FieldSourceURL,
	FieldTargetURL,
	FieldTaskID,
	FieldAppID,
	FieldStatus,
	FieldCreatedAt,
}

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

// Note that the variables below are initialized by the runtime
// package on the initialization of the application. Therefore,
// it should be imported in the main as follows:
//
//	import _ "convert-server/domain/entity/serversitemicros/runtime"
var (
	Hooks [4]ent.Hook
	// DefaultProjectName holds the default value on creation for the "project_name" field.
	DefaultProjectName string
	// DefaultSourceType holds the default value on creation for the "source_type" field.
	DefaultSourceType string
	// DefaultTargetType holds the default value on creation for the "target_type" field.
	DefaultTargetType string
	// SourceURLValidator is a validator for the "source_url" field. It is called by the builders before save.
	SourceURLValidator func(string) error
	// TargetURLValidator is a validator for the "target_url" field. It is called by the builders before save.
	TargetURLValidator func(string) error
	// DefaultTaskID holds the default value on creation for the "task_id" field.
	DefaultTaskID string
	// DefaultAppID holds the default value on creation for the "app_id" field.
	DefaultAppID int32
	// DefaultStatus holds the default value on creation for the "status" field.
	DefaultStatus int32
)

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

// ByProjectName orders the results by the project_name field.
func ByProjectName(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldProjectName, opts...).ToFunc()
}

// BySourceType orders the results by the source_type field.
func BySourceType(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldSourceType, opts...).ToFunc()
}

// ByTargetType orders the results by the target_type field.
func ByTargetType(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldTargetType, opts...).ToFunc()
}

// BySourceURL orders the results by the source_url field.
func BySourceURL(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldSourceURL, opts...).ToFunc()
}

// ByTargetURL orders the results by the target_url field.
func ByTargetURL(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldTargetURL, opts...).ToFunc()
}

// ByTaskID orders the results by the task_id field.
func ByTaskID(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldTaskID, opts...).ToFunc()
}

// ByAppID orders the results by the app_id field.
func ByAppID(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldAppID, opts...).ToFunc()
}

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

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