// Code generated by ent, DO NOT EDIT. package paychannel import ( "time" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" ) const ( // Label holds the string label denoting the paychannel type in the database. Label = "pay_channel" // 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" // FieldTenantID holds the string denoting the tenant_id field in the database. FieldTenantID = "tenant_id" // FieldDeletedAt holds the string denoting the deleted_at field in the database. FieldDeletedAt = "deleted_at" // FieldCode holds the string denoting the code field in the database. FieldCode = "code" // FieldNameEn holds the string denoting the name_en field in the database. FieldNameEn = "name_en" // FieldNameZh holds the string denoting the name_zh field in the database. FieldNameZh = "name_zh" // FieldFreeRate holds the string denoting the free_rate field in the database. FieldFreeRate = "free_rate" // FieldAppID holds the string denoting the app_id field in the database. FieldAppID = "app_id" // FieldConfig holds the string denoting the config field in the database. FieldConfig = "config" // FieldRemake holds the string denoting the remake field in the database. FieldRemake = "remake" // FieldIcon holds the string denoting the icon field in the database. FieldIcon = "icon" // FieldOrderTimeOut holds the string denoting the order_time_out field in the database. FieldOrderTimeOut = "order_time_out" // FieldSupportCurrency holds the string denoting the support_currency field in the database. FieldSupportCurrency = "support_currency" // EdgeOrders holds the string denoting the orders edge name in mutations. EdgeOrders = "orders" // EdgeOrdersExtension holds the string denoting the orders_extension edge name in mutations. EdgeOrdersExtension = "orders_extension" // EdgeRefund holds the string denoting the refund edge name in mutations. EdgeRefund = "refund" // EdgeApp holds the string denoting the app edge name in mutations. EdgeApp = "app" // Table holds the table name of the paychannel in the database. Table = "pay_channel" // OrdersTable is the table that holds the orders relation/edge. OrdersTable = "pay_order" // OrdersInverseTable is the table name for the PayOrder entity. // It exists in this package in order to avoid circular dependency with the "payorder" package. OrdersInverseTable = "pay_order" // OrdersColumn is the table column denoting the orders relation/edge. OrdersColumn = "channel_id" // OrdersExtensionTable is the table that holds the orders_extension relation/edge. OrdersExtensionTable = "pay_order_extension" // OrdersExtensionInverseTable is the table name for the PayOrderExtension entity. // It exists in this package in order to avoid circular dependency with the "payorderextension" package. OrdersExtensionInverseTable = "pay_order_extension" // OrdersExtensionColumn is the table column denoting the orders_extension relation/edge. OrdersExtensionColumn = "channel_id" // RefundTable is the table that holds the refund relation/edge. RefundTable = "pay_refund" // RefundInverseTable is the table name for the PayRefund entity. // It exists in this package in order to avoid circular dependency with the "payrefund" package. RefundInverseTable = "pay_refund" // RefundColumn is the table column denoting the refund relation/edge. RefundColumn = "channel_id" // AppTable is the table that holds the app relation/edge. AppTable = "pay_channel" // AppInverseTable is the table name for the App entity. // It exists in this package in order to avoid circular dependency with the "app" package. AppInverseTable = "pay_app" // AppColumn is the table column denoting the app relation/edge. AppColumn = "app_id" ) // Columns holds all SQL columns for paychannel fields. var Columns = []string{ FieldID, FieldCreatedAt, FieldUpdatedAt, FieldStatus, FieldTenantID, FieldDeletedAt, FieldCode, FieldNameEn, FieldNameZh, FieldFreeRate, FieldAppID, FieldConfig, FieldRemake, FieldIcon, FieldOrderTimeOut, FieldSupportCurrency, } // 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 // DefaultTenantID holds the default value on creation for the "tenant_id" field. DefaultTenantID uint64 // DefaultFreeRate holds the default value on creation for the "free_rate" field. DefaultFreeRate string // DefaultOrderTimeOut holds the default value on creation for the "order_time_out" field. DefaultOrderTimeOut string // DefaultSupportCurrency holds the default value on creation for the "support_currency" field. DefaultSupportCurrency string ) // OrderOption defines the ordering options for the PayChannel 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() } // ByTenantID orders the results by the tenant_id field. func ByTenantID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldTenantID, opts...).ToFunc() } // ByDeletedAt orders the results by the deleted_at field. func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() } // ByCode orders the results by the code field. func ByCode(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldCode, opts...).ToFunc() } // ByNameEn orders the results by the name_en field. func ByNameEn(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldNameEn, opts...).ToFunc() } // ByNameZh orders the results by the name_zh field. func ByNameZh(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldNameZh, opts...).ToFunc() } // ByFreeRate orders the results by the free_rate field. func ByFreeRate(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldFreeRate, opts...).ToFunc() } // ByAppID orders the results by the app_id field. func ByAppID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldAppID, opts...).ToFunc() } // ByRemake orders the results by the remake field. func ByRemake(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldRemake, opts...).ToFunc() } // ByIcon orders the results by the icon field. func ByIcon(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldIcon, opts...).ToFunc() } // ByOrderTimeOut orders the results by the order_time_out field. func ByOrderTimeOut(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldOrderTimeOut, opts...).ToFunc() } // BySupportCurrency orders the results by the support_currency field. func BySupportCurrency(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldSupportCurrency, opts...).ToFunc() } // ByOrdersCount orders the results by orders count. func ByOrdersCount(opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborsCount(s, newOrdersStep(), opts...) } } // ByOrders orders the results by orders terms. func ByOrders(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newOrdersStep(), append([]sql.OrderTerm{term}, terms...)...) } } // ByOrdersExtensionCount orders the results by orders_extension count. func ByOrdersExtensionCount(opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborsCount(s, newOrdersExtensionStep(), opts...) } } // ByOrdersExtension orders the results by orders_extension terms. func ByOrdersExtension(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newOrdersExtensionStep(), append([]sql.OrderTerm{term}, terms...)...) } } // ByRefundCount orders the results by refund count. func ByRefundCount(opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborsCount(s, newRefundStep(), opts...) } } // ByRefund orders the results by refund terms. func ByRefund(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newRefundStep(), append([]sql.OrderTerm{term}, terms...)...) } } // ByAppField orders the results by app field. func ByAppField(field string, opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newAppStep(), sql.OrderByField(field, opts...)) } } func newOrdersStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(OrdersInverseTable, FieldID), sqlgraph.Edge(sqlgraph.O2M, true, OrdersTable, OrdersColumn), ) } func newOrdersExtensionStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(OrdersExtensionInverseTable, FieldID), sqlgraph.Edge(sqlgraph.O2M, true, OrdersExtensionTable, OrdersExtensionColumn), ) } func newRefundStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(RefundInverseTable, FieldID), sqlgraph.Edge(sqlgraph.O2M, true, RefundTable, RefundColumn), ) } func newAppStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(AppInverseTable, FieldID), sqlgraph.Edge(sqlgraph.M2O, false, AppTable, AppColumn), ) }