// Code generated by ent, DO NOT EDIT. package payrefund import ( "time" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" ) const ( // Label holds the string label denoting the payrefund type in the database. Label = "pay_refund" // 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" // FieldChannelID holds the string denoting the channel_id field in the database. FieldChannelID = "channel_id" // FieldUserID holds the string denoting the user_id field in the database. FieldUserID = "user_id" // FieldOrderID holds the string denoting the order_id field in the database. FieldOrderID = "order_id" // FieldNotifyURL holds the string denoting the notify_url field in the database. FieldNotifyURL = "notify_url" // FieldRefundStatus holds the string denoting the refund_status field in the database. FieldRefundStatus = "refund_status" // FieldRefundAmount holds the string denoting the refund_amount field in the database. FieldRefundAmount = "refund_amount" // FieldPayAmount holds the string denoting the pay_amount field in the database. FieldPayAmount = "pay_amount" // FieldRefundNo holds the string denoting the refund_no field in the database. FieldRefundNo = "refund_no" // FieldRefundReason holds the string denoting the refund_reason field in the database. FieldRefundReason = "refund_reason" // FieldUserIP holds the string denoting the user_ip field in the database. FieldUserIP = "user_ip" // FieldChannelRefundNo holds the string denoting the channel_refund_no field in the database. FieldChannelRefundNo = "channel_refund_no" // FieldRefundTime holds the string denoting the refund_time field in the database. FieldRefundTime = "refund_time" // FieldChannelErrorCode holds the string denoting the channel_error_code field in the database. FieldChannelErrorCode = "channel_error_code" // FieldChannelErrorMsg holds the string denoting the channel_error_msg field in the database. FieldChannelErrorMsg = "channel_error_msg" // FieldChannelNotifyData holds the string denoting the channel_notify_data field in the database. FieldChannelNotifyData = "channel_notify_data" // EdgeOrder holds the string denoting the order edge name in mutations. EdgeOrder = "order" // EdgeChannel holds the string denoting the channel edge name in mutations. EdgeChannel = "channel" // Table holds the table name of the payrefund in the database. Table = "pay_refund" // OrderTable is the table that holds the order relation/edge. OrderTable = "pay_refund" // OrderInverseTable is the table name for the PayOrder entity. // It exists in this package in order to avoid circular dependency with the "payorder" package. OrderInverseTable = "pay_order" // OrderColumn is the table column denoting the order relation/edge. OrderColumn = "order_id" // ChannelTable is the table that holds the channel relation/edge. ChannelTable = "pay_refund" // ChannelInverseTable is the table name for the PayChannel entity. // It exists in this package in order to avoid circular dependency with the "paychannel" package. ChannelInverseTable = "pay_channel" // ChannelColumn is the table column denoting the channel relation/edge. ChannelColumn = "channel_id" ) // Columns holds all SQL columns for payrefund fields. var Columns = []string{ FieldID, FieldCreatedAt, FieldUpdatedAt, FieldStatus, FieldTenantID, FieldDeletedAt, FieldChannelID, FieldUserID, FieldOrderID, FieldNotifyURL, FieldRefundStatus, FieldRefundAmount, FieldPayAmount, FieldRefundNo, FieldRefundReason, FieldUserIP, FieldChannelRefundNo, FieldRefundTime, FieldChannelErrorCode, FieldChannelErrorMsg, FieldChannelNotifyData, } // 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 // DefaultRefundStatus holds the default value on creation for the "refund_status" field. DefaultRefundStatus uint8 // DefaultRefundAmount holds the default value on creation for the "refund_amount" field. DefaultRefundAmount uint64 // DefaultPayAmount holds the default value on creation for the "pay_amount" field. DefaultPayAmount uint64 ) // OrderOption defines the ordering options for the PayRefund 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() } // ByChannelID orders the results by the channel_id field. func ByChannelID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldChannelID, opts...).ToFunc() } // ByUserID orders the results by the user_id field. func ByUserID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldUserID, opts...).ToFunc() } // ByOrderID orders the results by the order_id field. func ByOrderID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldOrderID, opts...).ToFunc() } // ByNotifyURL orders the results by the notify_url field. func ByNotifyURL(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldNotifyURL, opts...).ToFunc() } // ByRefundStatus orders the results by the refund_status field. func ByRefundStatus(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldRefundStatus, opts...).ToFunc() } // ByRefundAmount orders the results by the refund_amount field. func ByRefundAmount(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldRefundAmount, opts...).ToFunc() } // ByPayAmount orders the results by the pay_amount field. func ByPayAmount(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldPayAmount, opts...).ToFunc() } // ByRefundNo orders the results by the refund_no field. func ByRefundNo(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldRefundNo, opts...).ToFunc() } // ByRefundReason orders the results by the refund_reason field. func ByRefundReason(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldRefundReason, opts...).ToFunc() } // ByUserIP orders the results by the user_ip field. func ByUserIP(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldUserIP, opts...).ToFunc() } // ByChannelRefundNo orders the results by the channel_refund_no field. func ByChannelRefundNo(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldChannelRefundNo, opts...).ToFunc() } // ByRefundTime orders the results by the refund_time field. func ByRefundTime(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldRefundTime, opts...).ToFunc() } // ByChannelErrorCode orders the results by the channel_error_code field. func ByChannelErrorCode(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldChannelErrorCode, opts...).ToFunc() } // ByChannelErrorMsg orders the results by the channel_error_msg field. func ByChannelErrorMsg(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldChannelErrorMsg, opts...).ToFunc() } // ByChannelNotifyData orders the results by the channel_notify_data field. func ByChannelNotifyData(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldChannelNotifyData, opts...).ToFunc() } // ByOrderField orders the results by order field. func ByOrderField(field string, opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newOrderStep(), sql.OrderByField(field, opts...)) } } // ByChannelField orders the results by channel field. func ByChannelField(field string, opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newChannelStep(), sql.OrderByField(field, opts...)) } } func newOrderStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(OrderInverseTable, FieldID), sqlgraph.Edge(sqlgraph.M2O, false, OrderTable, OrderColumn), ) } func newChannelStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(ChannelInverseTable, FieldID), sqlgraph.Edge(sqlgraph.M2O, false, ChannelTable, ChannelColumn), ) }