// Code generated by ent, DO NOT EDIT.

package batchmsg

import (
	"time"

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

const (
	// Label holds the string label denoting the batchmsg type in the database.
	Label = "batch_msg"
	// 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"
	// FieldDeletedAt holds the string denoting the deleted_at field in the database.
	FieldDeletedAt = "deleted_at"
	// FieldStatus holds the string denoting the status field in the database.
	FieldStatus = "status"
	// FieldBatchNo holds the string denoting the batch_no field in the database.
	FieldBatchNo = "batch_no"
	// FieldTaskName holds the string denoting the task_name field in the database.
	FieldTaskName = "task_name"
	// FieldFromwxid holds the string denoting the fromwxid field in the database.
	FieldFromwxid = "fromwxid"
	// FieldMsg holds the string denoting the msg field in the database.
	FieldMsg = "msg"
	// FieldTag holds the string denoting the tag field in the database.
	FieldTag = "tag"
	// FieldTagids holds the string denoting the tagids field in the database.
	FieldTagids = "tagids"
	// FieldTotal holds the string denoting the total field in the database.
	FieldTotal = "total"
	// FieldSuccess holds the string denoting the success field in the database.
	FieldSuccess = "success"
	// FieldFail holds the string denoting the fail field in the database.
	FieldFail = "fail"
	// FieldStartTime holds the string denoting the start_time field in the database.
	FieldStartTime = "start_time"
	// FieldStopTime holds the string denoting the stop_time field in the database.
	FieldStopTime = "stop_time"
	// FieldSendTime holds the string denoting the send_time field in the database.
	FieldSendTime = "send_time"
	// FieldType holds the string denoting the type field in the database.
	FieldType = "type"
	// FieldOrganizationID holds the string denoting the organization_id field in the database.
	FieldOrganizationID = "organization_id"
	// Table holds the table name of the batchmsg in the database.
	Table = "batch_msg"
)

// Columns holds all SQL columns for batchmsg fields.
var Columns = []string{
	FieldID,
	FieldCreatedAt,
	FieldUpdatedAt,
	FieldDeletedAt,
	FieldStatus,
	FieldBatchNo,
	FieldTaskName,
	FieldFromwxid,
	FieldMsg,
	FieldTag,
	FieldTagids,
	FieldTotal,
	FieldSuccess,
	FieldFail,
	FieldStartTime,
	FieldStopTime,
	FieldSendTime,
	FieldType,
	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
}

// 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 _ "wechat-api/ent/runtime"
var (
	Hooks        [1]ent.Hook
	Interceptors [1]ent.Interceptor
	// 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
	// DefaultTaskName holds the default value on creation for the "task_name" field.
	DefaultTaskName string
	// OrganizationIDValidator is a validator for the "organization_id" field. It is called by the builders before save.
	OrganizationIDValidator func(uint64) error
)

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

// ByDeletedAt orders the results by the deleted_at field.
func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
}

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

// ByBatchNo orders the results by the batch_no field.
func ByBatchNo(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldBatchNo, opts...).ToFunc()
}

// ByTaskName orders the results by the task_name field.
func ByTaskName(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldTaskName, opts...).ToFunc()
}

// ByFromwxid orders the results by the fromwxid field.
func ByFromwxid(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldFromwxid, opts...).ToFunc()
}

// ByMsg orders the results by the msg field.
func ByMsg(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldMsg, opts...).ToFunc()
}

// ByTag orders the results by the tag field.
func ByTag(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldTag, opts...).ToFunc()
}

// ByTagids orders the results by the tagids field.
func ByTagids(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldTagids, opts...).ToFunc()
}

// ByTotal orders the results by the total field.
func ByTotal(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldTotal, opts...).ToFunc()
}

// BySuccess orders the results by the success field.
func BySuccess(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldSuccess, opts...).ToFunc()
}

// ByFail orders the results by the fail field.
func ByFail(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldFail, opts...).ToFunc()
}

// ByStartTime orders the results by the start_time field.
func ByStartTime(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldStartTime, opts...).ToFunc()
}

// ByStopTime orders the results by the stop_time field.
func ByStopTime(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldStopTime, opts...).ToFunc()
}

// BySendTime orders the results by the send_time field.
func BySendTime(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldSendTime, opts...).ToFunc()
}

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

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