// Code generated by ent, DO NOT EDIT.

package wxcarduser

import (
	"time"

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

const (
	// Label holds the string label denoting the wxcarduser type in the database.
	Label = "wx_card_user"
	// 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"
	// FieldWxid holds the string denoting the wxid field in the database.
	FieldWxid = "wxid"
	// FieldAccount holds the string denoting the account field in the database.
	FieldAccount = "account"
	// FieldAvatar holds the string denoting the avatar field in the database.
	FieldAvatar = "avatar"
	// FieldNickname holds the string denoting the nickname field in the database.
	FieldNickname = "nickname"
	// FieldRemark holds the string denoting the remark field in the database.
	FieldRemark = "remark"
	// FieldPhone holds the string denoting the phone field in the database.
	FieldPhone = "phone"
	// FieldOpenID holds the string denoting the open_id field in the database.
	FieldOpenID = "open_id"
	// FieldUnionID holds the string denoting the union_id field in the database.
	FieldUnionID = "union_id"
	// FieldSessionKey holds the string denoting the session_key field in the database.
	FieldSessionKey = "session_key"
	// FieldIsVip holds the string denoting the is_vip field in the database.
	FieldIsVip = "is_vip"
	// Table holds the table name of the wxcarduser in the database.
	Table = "wx_card_user"
)

// Columns holds all SQL columns for wxcarduser fields.
var Columns = []string{
	FieldID,
	FieldCreatedAt,
	FieldUpdatedAt,
	FieldDeletedAt,
	FieldWxid,
	FieldAccount,
	FieldAvatar,
	FieldNickname,
	FieldRemark,
	FieldPhone,
	FieldOpenID,
	FieldUnionID,
	FieldSessionKey,
	FieldIsVip,
}

// 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
	// DefaultWxid holds the default value on creation for the "wxid" field.
	DefaultWxid string
	// DefaultAccount holds the default value on creation for the "account" field.
	DefaultAccount string
	// DefaultAvatar holds the default value on creation for the "avatar" field.
	DefaultAvatar string
	// DefaultNickname holds the default value on creation for the "nickname" field.
	DefaultNickname string
	// DefaultRemark holds the default value on creation for the "remark" field.
	DefaultRemark string
	// DefaultPhone holds the default value on creation for the "phone" field.
	DefaultPhone string
	// DefaultOpenID holds the default value on creation for the "open_id" field.
	DefaultOpenID string
	// DefaultUnionID holds the default value on creation for the "union_id" field.
	DefaultUnionID string
	// DefaultSessionKey holds the default value on creation for the "session_key" field.
	DefaultSessionKey string
	// DefaultIsVip holds the default value on creation for the "is_vip" field.
	DefaultIsVip int
)

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

// ByWxid orders the results by the wxid field.
func ByWxid(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldWxid, opts...).ToFunc()
}

// ByAccount orders the results by the account field.
func ByAccount(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldAccount, opts...).ToFunc()
}

// ByAvatar orders the results by the avatar field.
func ByAvatar(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldAvatar, opts...).ToFunc()
}

// ByNickname orders the results by the nickname field.
func ByNickname(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldNickname, opts...).ToFunc()
}

// ByRemark orders the results by the remark field.
func ByRemark(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldRemark, opts...).ToFunc()
}

// ByPhone orders the results by the phone field.
func ByPhone(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldPhone, opts...).ToFunc()
}

// ByOpenID orders the results by the open_id field.
func ByOpenID(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldOpenID, opts...).ToFunc()
}

// ByUnionID orders the results by the union_id field.
func ByUnionID(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldUnionID, opts...).ToFunc()
}

// BySessionKey orders the results by the session_key field.
func BySessionKey(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldSessionKey, opts...).ToFunc()
}

// ByIsVip orders the results by the is_vip field.
func ByIsVip(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldIsVip, opts...).ToFunc()
}
