Add a full payment and subscription system supporting EasyPay (Alipay/WeChat), Stripe, and direct Alipay/WeChat Pay providers with multi-instance load balancing.
175 lines
6.5 KiB
Go
175 lines
6.5 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package subscriptionplan
|
|
|
|
import (
|
|
"time"
|
|
|
|
"entgo.io/ent/dialect/sql"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the subscriptionplan type in the database.
|
|
Label = "subscription_plan"
|
|
// FieldID holds the string denoting the id field in the database.
|
|
FieldID = "id"
|
|
// FieldGroupID holds the string denoting the group_id field in the database.
|
|
FieldGroupID = "group_id"
|
|
// FieldName holds the string denoting the name field in the database.
|
|
FieldName = "name"
|
|
// FieldDescription holds the string denoting the description field in the database.
|
|
FieldDescription = "description"
|
|
// FieldPrice holds the string denoting the price field in the database.
|
|
FieldPrice = "price"
|
|
// FieldOriginalPrice holds the string denoting the original_price field in the database.
|
|
FieldOriginalPrice = "original_price"
|
|
// FieldValidityDays holds the string denoting the validity_days field in the database.
|
|
FieldValidityDays = "validity_days"
|
|
// FieldValidityUnit holds the string denoting the validity_unit field in the database.
|
|
FieldValidityUnit = "validity_unit"
|
|
// FieldFeatures holds the string denoting the features field in the database.
|
|
FieldFeatures = "features"
|
|
// FieldProductName holds the string denoting the product_name field in the database.
|
|
FieldProductName = "product_name"
|
|
// FieldForSale holds the string denoting the for_sale field in the database.
|
|
FieldForSale = "for_sale"
|
|
// FieldSortOrder holds the string denoting the sort_order field in the database.
|
|
FieldSortOrder = "sort_order"
|
|
// 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"
|
|
// Table holds the table name of the subscriptionplan in the database.
|
|
Table = "subscription_plans"
|
|
)
|
|
|
|
// Columns holds all SQL columns for subscriptionplan fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldGroupID,
|
|
FieldName,
|
|
FieldDescription,
|
|
FieldPrice,
|
|
FieldOriginalPrice,
|
|
FieldValidityDays,
|
|
FieldValidityUnit,
|
|
FieldFeatures,
|
|
FieldProductName,
|
|
FieldForSale,
|
|
FieldSortOrder,
|
|
FieldCreatedAt,
|
|
FieldUpdatedAt,
|
|
}
|
|
|
|
// 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 (
|
|
// NameValidator is a validator for the "name" field. It is called by the builders before save.
|
|
NameValidator func(string) error
|
|
// DefaultDescription holds the default value on creation for the "description" field.
|
|
DefaultDescription string
|
|
// DefaultValidityDays holds the default value on creation for the "validity_days" field.
|
|
DefaultValidityDays int
|
|
// DefaultValidityUnit holds the default value on creation for the "validity_unit" field.
|
|
DefaultValidityUnit string
|
|
// ValidityUnitValidator is a validator for the "validity_unit" field. It is called by the builders before save.
|
|
ValidityUnitValidator func(string) error
|
|
// DefaultFeatures holds the default value on creation for the "features" field.
|
|
DefaultFeatures string
|
|
// DefaultProductName holds the default value on creation for the "product_name" field.
|
|
DefaultProductName string
|
|
// ProductNameValidator is a validator for the "product_name" field. It is called by the builders before save.
|
|
ProductNameValidator func(string) error
|
|
// DefaultForSale holds the default value on creation for the "for_sale" field.
|
|
DefaultForSale bool
|
|
// DefaultSortOrder holds the default value on creation for the "sort_order" field.
|
|
DefaultSortOrder int
|
|
// 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
|
|
)
|
|
|
|
// OrderOption defines the ordering options for the SubscriptionPlan 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()
|
|
}
|
|
|
|
// ByGroupID orders the results by the group_id field.
|
|
func ByGroupID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldGroupID, opts...).ToFunc()
|
|
}
|
|
|
|
// ByName orders the results by the name field.
|
|
func ByName(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldName, opts...).ToFunc()
|
|
}
|
|
|
|
// ByDescription orders the results by the description field.
|
|
func ByDescription(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldDescription, opts...).ToFunc()
|
|
}
|
|
|
|
// ByPrice orders the results by the price field.
|
|
func ByPrice(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldPrice, opts...).ToFunc()
|
|
}
|
|
|
|
// ByOriginalPrice orders the results by the original_price field.
|
|
func ByOriginalPrice(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldOriginalPrice, opts...).ToFunc()
|
|
}
|
|
|
|
// ByValidityDays orders the results by the validity_days field.
|
|
func ByValidityDays(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldValidityDays, opts...).ToFunc()
|
|
}
|
|
|
|
// ByValidityUnit orders the results by the validity_unit field.
|
|
func ByValidityUnit(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldValidityUnit, opts...).ToFunc()
|
|
}
|
|
|
|
// ByFeatures orders the results by the features field.
|
|
func ByFeatures(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldFeatures, opts...).ToFunc()
|
|
}
|
|
|
|
// ByProductName orders the results by the product_name field.
|
|
func ByProductName(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldProductName, opts...).ToFunc()
|
|
}
|
|
|
|
// ByForSale orders the results by the for_sale field.
|
|
func ByForSale(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldForSale, opts...).ToFunc()
|
|
}
|
|
|
|
// BySortOrder orders the results by the sort_order field.
|
|
func BySortOrder(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldSortOrder, 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()
|
|
}
|