feat: snapshot payment provider keys on orders
This commit is contained in:
@@ -52,6 +52,8 @@ const (
|
||||
FieldSubscriptionDays = "subscription_days"
|
||||
// FieldProviderInstanceID holds the string denoting the provider_instance_id field in the database.
|
||||
FieldProviderInstanceID = "provider_instance_id"
|
||||
// FieldProviderKey holds the string denoting the provider_key field in the database.
|
||||
FieldProviderKey = "provider_key"
|
||||
// FieldStatus holds the string denoting the status field in the database.
|
||||
FieldStatus = "status"
|
||||
// FieldRefundAmount holds the string denoting the refund_amount field in the database.
|
||||
@@ -123,6 +125,7 @@ var Columns = []string{
|
||||
FieldSubscriptionGroupID,
|
||||
FieldSubscriptionDays,
|
||||
FieldProviderInstanceID,
|
||||
FieldProviderKey,
|
||||
FieldStatus,
|
||||
FieldRefundAmount,
|
||||
FieldRefundReason,
|
||||
@@ -176,6 +179,8 @@ var (
|
||||
OrderTypeValidator func(string) error
|
||||
// ProviderInstanceIDValidator is a validator for the "provider_instance_id" field. It is called by the builders before save.
|
||||
ProviderInstanceIDValidator func(string) error
|
||||
// ProviderKeyValidator is a validator for the "provider_key" field. It is called by the builders before save.
|
||||
ProviderKeyValidator func(string) error
|
||||
// DefaultStatus holds the default value on creation for the "status" field.
|
||||
DefaultStatus string
|
||||
// StatusValidator is a validator for the "status" field. It is called by the builders before save.
|
||||
@@ -301,6 +306,11 @@ func ByProviderInstanceID(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldProviderInstanceID, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByProviderKey orders the results by the provider_key field.
|
||||
func ByProviderKey(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldProviderKey, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByStatus orders the results by the status field.
|
||||
func ByStatus(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldStatus, opts...).ToFunc()
|
||||
|
||||
@@ -150,6 +150,11 @@ func ProviderInstanceID(v string) predicate.PaymentOrder {
|
||||
return predicate.PaymentOrder(sql.FieldEQ(FieldProviderInstanceID, v))
|
||||
}
|
||||
|
||||
// ProviderKey applies equality check predicate on the "provider_key" field. It's identical to ProviderKeyEQ.
|
||||
func ProviderKey(v string) predicate.PaymentOrder {
|
||||
return predicate.PaymentOrder(sql.FieldEQ(FieldProviderKey, v))
|
||||
}
|
||||
|
||||
// Status applies equality check predicate on the "status" field. It's identical to StatusEQ.
|
||||
func Status(v string) predicate.PaymentOrder {
|
||||
return predicate.PaymentOrder(sql.FieldEQ(FieldStatus, v))
|
||||
@@ -1360,6 +1365,81 @@ func ProviderInstanceIDContainsFold(v string) predicate.PaymentOrder {
|
||||
return predicate.PaymentOrder(sql.FieldContainsFold(FieldProviderInstanceID, v))
|
||||
}
|
||||
|
||||
// ProviderKeyEQ applies the EQ predicate on the "provider_key" field.
|
||||
func ProviderKeyEQ(v string) predicate.PaymentOrder {
|
||||
return predicate.PaymentOrder(sql.FieldEQ(FieldProviderKey, v))
|
||||
}
|
||||
|
||||
// ProviderKeyNEQ applies the NEQ predicate on the "provider_key" field.
|
||||
func ProviderKeyNEQ(v string) predicate.PaymentOrder {
|
||||
return predicate.PaymentOrder(sql.FieldNEQ(FieldProviderKey, v))
|
||||
}
|
||||
|
||||
// ProviderKeyIn applies the In predicate on the "provider_key" field.
|
||||
func ProviderKeyIn(vs ...string) predicate.PaymentOrder {
|
||||
return predicate.PaymentOrder(sql.FieldIn(FieldProviderKey, vs...))
|
||||
}
|
||||
|
||||
// ProviderKeyNotIn applies the NotIn predicate on the "provider_key" field.
|
||||
func ProviderKeyNotIn(vs ...string) predicate.PaymentOrder {
|
||||
return predicate.PaymentOrder(sql.FieldNotIn(FieldProviderKey, vs...))
|
||||
}
|
||||
|
||||
// ProviderKeyGT applies the GT predicate on the "provider_key" field.
|
||||
func ProviderKeyGT(v string) predicate.PaymentOrder {
|
||||
return predicate.PaymentOrder(sql.FieldGT(FieldProviderKey, v))
|
||||
}
|
||||
|
||||
// ProviderKeyGTE applies the GTE predicate on the "provider_key" field.
|
||||
func ProviderKeyGTE(v string) predicate.PaymentOrder {
|
||||
return predicate.PaymentOrder(sql.FieldGTE(FieldProviderKey, v))
|
||||
}
|
||||
|
||||
// ProviderKeyLT applies the LT predicate on the "provider_key" field.
|
||||
func ProviderKeyLT(v string) predicate.PaymentOrder {
|
||||
return predicate.PaymentOrder(sql.FieldLT(FieldProviderKey, v))
|
||||
}
|
||||
|
||||
// ProviderKeyLTE applies the LTE predicate on the "provider_key" field.
|
||||
func ProviderKeyLTE(v string) predicate.PaymentOrder {
|
||||
return predicate.PaymentOrder(sql.FieldLTE(FieldProviderKey, v))
|
||||
}
|
||||
|
||||
// ProviderKeyContains applies the Contains predicate on the "provider_key" field.
|
||||
func ProviderKeyContains(v string) predicate.PaymentOrder {
|
||||
return predicate.PaymentOrder(sql.FieldContains(FieldProviderKey, v))
|
||||
}
|
||||
|
||||
// ProviderKeyHasPrefix applies the HasPrefix predicate on the "provider_key" field.
|
||||
func ProviderKeyHasPrefix(v string) predicate.PaymentOrder {
|
||||
return predicate.PaymentOrder(sql.FieldHasPrefix(FieldProviderKey, v))
|
||||
}
|
||||
|
||||
// ProviderKeyHasSuffix applies the HasSuffix predicate on the "provider_key" field.
|
||||
func ProviderKeyHasSuffix(v string) predicate.PaymentOrder {
|
||||
return predicate.PaymentOrder(sql.FieldHasSuffix(FieldProviderKey, v))
|
||||
}
|
||||
|
||||
// ProviderKeyIsNil applies the IsNil predicate on the "provider_key" field.
|
||||
func ProviderKeyIsNil() predicate.PaymentOrder {
|
||||
return predicate.PaymentOrder(sql.FieldIsNull(FieldProviderKey))
|
||||
}
|
||||
|
||||
// ProviderKeyNotNil applies the NotNil predicate on the "provider_key" field.
|
||||
func ProviderKeyNotNil() predicate.PaymentOrder {
|
||||
return predicate.PaymentOrder(sql.FieldNotNull(FieldProviderKey))
|
||||
}
|
||||
|
||||
// ProviderKeyEqualFold applies the EqualFold predicate on the "provider_key" field.
|
||||
func ProviderKeyEqualFold(v string) predicate.PaymentOrder {
|
||||
return predicate.PaymentOrder(sql.FieldEqualFold(FieldProviderKey, v))
|
||||
}
|
||||
|
||||
// ProviderKeyContainsFold applies the ContainsFold predicate on the "provider_key" field.
|
||||
func ProviderKeyContainsFold(v string) predicate.PaymentOrder {
|
||||
return predicate.PaymentOrder(sql.FieldContainsFold(FieldProviderKey, v))
|
||||
}
|
||||
|
||||
// StatusEQ applies the EQ predicate on the "status" field.
|
||||
func StatusEQ(v string) predicate.PaymentOrder {
|
||||
return predicate.PaymentOrder(sql.FieldEQ(FieldStatus, v))
|
||||
|
||||
Reference in New Issue
Block a user