// Code generated by ent, DO NOT EDIT. package chargeusagebased import ( "fmt" "time" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" "github.com/openmeterio/openmeter/openmeter/billing" "github.com/openmeterio/openmeter/openmeter/billing/charges/meta" "github.com/openmeterio/openmeter/openmeter/billing/charges/usagebased" "github.com/openmeterio/openmeter/openmeter/productcatalog" ) const ( // Label holds the string label denoting the chargeusagebased type in the database. Label = "charge_usage_based" // FieldID holds the string denoting the id field in the database. FieldID = "id" // FieldCustomerID holds the string denoting the customer_id field in the database. FieldCustomerID = "customer_id" // FieldServicePeriodFrom holds the string denoting the service_period_from field in the database. FieldServicePeriodFrom = "service_period_from" // FieldServicePeriodTo holds the string denoting the service_period_to field in the database. FieldServicePeriodTo = "service_period_to" // FieldBillingPeriodFrom holds the string denoting the billing_period_from field in the database. FieldBillingPeriodFrom = "billing_period_from" // FieldBillingPeriodTo holds the string denoting the billing_period_to field in the database. FieldBillingPeriodTo = "billing_period_to" // FieldFullServicePeriodFrom holds the string denoting the full_service_period_from field in the database. FieldFullServicePeriodFrom = "full_service_period_from" // FieldFullServicePeriodTo holds the string denoting the full_service_period_to field in the database. FieldFullServicePeriodTo = "full_service_period_to" // FieldStatus holds the string denoting the status field in the database. FieldStatus = "status" // FieldUniqueReferenceID holds the string denoting the unique_reference_id field in the database. FieldUniqueReferenceID = "unique_reference_id" // FieldCurrency holds the string denoting the currency field in the database. FieldCurrency = "currency" // FieldManagedBy holds the string denoting the managed_by field in the database. FieldManagedBy = "managed_by" // FieldSubscriptionID holds the string denoting the subscription_id field in the database. FieldSubscriptionID = "subscription_id" // FieldSubscriptionPhaseID holds the string denoting the subscription_phase_id field in the database. FieldSubscriptionPhaseID = "subscription_phase_id" // FieldSubscriptionItemID holds the string denoting the subscription_item_id field in the database. FieldSubscriptionItemID = "subscription_item_id" // FieldAdvanceAfter holds the string denoting the advance_after field in the database. FieldAdvanceAfter = "advance_after" // FieldTaxCodeID holds the string denoting the tax_code_id field in the database. FieldTaxCodeID = "tax_code_id" // FieldTaxBehavior holds the string denoting the tax_behavior field in the database. FieldTaxBehavior = "tax_behavior" // FieldAnnotations holds the string denoting the annotations field in the database. FieldAnnotations = "annotations" // FieldNamespace holds the string denoting the namespace field in the database. FieldNamespace = "namespace" // FieldMetadata holds the string denoting the metadata field in the database. FieldMetadata = "metadata" // 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" // 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" // FieldInvoiceAt holds the string denoting the invoice_at field in the database. FieldInvoiceAt = "invoice_at" // FieldSettlementMode holds the string denoting the settlement_mode field in the database. FieldSettlementMode = "settlement_mode" // FieldIntentDeletedAt holds the string denoting the intent_deleted_at field in the database. FieldIntentDeletedAt = "intent_deleted_at" // FieldDiscounts holds the string denoting the discounts field in the database. FieldDiscounts = "discounts" // FieldFeatureKey holds the string denoting the feature_key field in the database. FieldFeatureKey = "feature_key" // FieldFeatureID holds the string denoting the feature_id field in the database. FieldFeatureID = "feature_id" // FieldRatingEngine holds the string denoting the rating_engine field in the database. FieldRatingEngine = "rating_engine" // FieldPrice holds the string denoting the price field in the database. FieldPrice = "price" // FieldUnitConfig holds the string denoting the unit_config field in the database. FieldUnitConfig = "unit_config" // FieldCurrentRealizationRunID holds the string denoting the current_realization_run_id field in the database. FieldCurrentRealizationRunID = "current_realization_run_id" // FieldStatusDetailed holds the string denoting the status_detailed field in the database. FieldStatusDetailed = "status_detailed" // EdgeRuns holds the string denoting the runs edge name in mutations. EdgeRuns = "runs" // EdgeDetailedLines holds the string denoting the detailed_lines edge name in mutations. EdgeDetailedLines = "detailed_lines" // EdgeCurrentRun holds the string denoting the current_run edge name in mutations. EdgeCurrentRun = "current_run" // EdgeCharge holds the string denoting the charge edge name in mutations. EdgeCharge = "charge" // EdgeIntentOverride holds the string denoting the intent_override edge name in mutations. EdgeIntentOverride = "intent_override" // EdgeSubscription holds the string denoting the subscription edge name in mutations. EdgeSubscription = "subscription" // EdgeSubscriptionPhase holds the string denoting the subscription_phase edge name in mutations. EdgeSubscriptionPhase = "subscription_phase" // EdgeSubscriptionItem holds the string denoting the subscription_item edge name in mutations. EdgeSubscriptionItem = "subscription_item" // EdgeCustomer holds the string denoting the customer edge name in mutations. EdgeCustomer = "customer" // EdgeFeature holds the string denoting the feature edge name in mutations. EdgeFeature = "feature" // EdgeTaxCode holds the string denoting the tax_code edge name in mutations. EdgeTaxCode = "tax_code" // Table holds the table name of the chargeusagebased in the database. Table = "charge_usage_based" // RunsTable is the table that holds the runs relation/edge. RunsTable = "charge_usage_based_runs" // RunsInverseTable is the table name for the ChargeUsageBasedRuns entity. // It exists in this package in order to avoid circular dependency with the "chargeusagebasedruns" package. RunsInverseTable = "charge_usage_based_runs" // RunsColumn is the table column denoting the runs relation/edge. RunsColumn = "charge_id" // DetailedLinesTable is the table that holds the detailed_lines relation/edge. DetailedLinesTable = "charge_usage_based_run_detailed_line" // DetailedLinesInverseTable is the table name for the ChargeUsageBasedRunDetailedLine entity. // It exists in this package in order to avoid circular dependency with the "chargeusagebasedrundetailedline" package. DetailedLinesInverseTable = "charge_usage_based_run_detailed_line" // DetailedLinesColumn is the table column denoting the detailed_lines relation/edge. DetailedLinesColumn = "charge_id" // CurrentRunTable is the table that holds the current_run relation/edge. CurrentRunTable = "charge_usage_based" // CurrentRunInverseTable is the table name for the ChargeUsageBasedRuns entity. // It exists in this package in order to avoid circular dependency with the "chargeusagebasedruns" package. CurrentRunInverseTable = "charge_usage_based_runs" // CurrentRunColumn is the table column denoting the current_run relation/edge. CurrentRunColumn = "current_realization_run_id" // ChargeTable is the table that holds the charge relation/edge. ChargeTable = "charges" // ChargeInverseTable is the table name for the Charge entity. // It exists in this package in order to avoid circular dependency with the "charge" package. ChargeInverseTable = "charges" // ChargeColumn is the table column denoting the charge relation/edge. ChargeColumn = "charge_usage_based_id" // IntentOverrideTable is the table that holds the intent_override relation/edge. IntentOverrideTable = "charge_usage_based_overrides" // IntentOverrideInverseTable is the table name for the ChargeUsageBasedOverride entity. // It exists in this package in order to avoid circular dependency with the "chargeusagebasedoverride" package. IntentOverrideInverseTable = "charge_usage_based_overrides" // IntentOverrideColumn is the table column denoting the intent_override relation/edge. IntentOverrideColumn = "charge_id" // SubscriptionTable is the table that holds the subscription relation/edge. SubscriptionTable = "charge_usage_based" // SubscriptionInverseTable is the table name for the Subscription entity. // It exists in this package in order to avoid circular dependency with the "subscription" package. SubscriptionInverseTable = "subscriptions" // SubscriptionColumn is the table column denoting the subscription relation/edge. SubscriptionColumn = "subscription_id" // SubscriptionPhaseTable is the table that holds the subscription_phase relation/edge. SubscriptionPhaseTable = "charge_usage_based" // SubscriptionPhaseInverseTable is the table name for the SubscriptionPhase entity. // It exists in this package in order to avoid circular dependency with the "subscriptionphase" package. SubscriptionPhaseInverseTable = "subscription_phases" // SubscriptionPhaseColumn is the table column denoting the subscription_phase relation/edge. SubscriptionPhaseColumn = "subscription_phase_id" // SubscriptionItemTable is the table that holds the subscription_item relation/edge. SubscriptionItemTable = "charge_usage_based" // SubscriptionItemInverseTable is the table name for the SubscriptionItem entity. // It exists in this package in order to avoid circular dependency with the "subscriptionitem" package. SubscriptionItemInverseTable = "subscription_items" // SubscriptionItemColumn is the table column denoting the subscription_item relation/edge. SubscriptionItemColumn = "subscription_item_id" // CustomerTable is the table that holds the customer relation/edge. CustomerTable = "charge_usage_based" // CustomerInverseTable is the table name for the Customer entity. // It exists in this package in order to avoid circular dependency with the "customer" package. CustomerInverseTable = "customers" // CustomerColumn is the table column denoting the customer relation/edge. CustomerColumn = "customer_id" // FeatureTable is the table that holds the feature relation/edge. FeatureTable = "charge_usage_based" // FeatureInverseTable is the table name for the Feature entity. // It exists in this package in order to avoid circular dependency with the "dbfeature" package. FeatureInverseTable = "features" // FeatureColumn is the table column denoting the feature relation/edge. FeatureColumn = "feature_id" // TaxCodeTable is the table that holds the tax_code relation/edge. TaxCodeTable = "charge_usage_based" // TaxCodeInverseTable is the table name for the TaxCode entity. // It exists in this package in order to avoid circular dependency with the "dbtaxcode" package. TaxCodeInverseTable = "tax_codes" // TaxCodeColumn is the table column denoting the tax_code relation/edge. TaxCodeColumn = "tax_code_id" ) // Columns holds all SQL columns for chargeusagebased fields. var Columns = []string{ FieldID, FieldCustomerID, FieldServicePeriodFrom, FieldServicePeriodTo, FieldBillingPeriodFrom, FieldBillingPeriodTo, FieldFullServicePeriodFrom, FieldFullServicePeriodTo, FieldStatus, FieldUniqueReferenceID, FieldCurrency, FieldManagedBy, FieldSubscriptionID, FieldSubscriptionPhaseID, FieldSubscriptionItemID, FieldAdvanceAfter, FieldTaxCodeID, FieldTaxBehavior, FieldAnnotations, FieldNamespace, FieldMetadata, FieldCreatedAt, FieldUpdatedAt, FieldDeletedAt, FieldName, FieldDescription, FieldInvoiceAt, FieldSettlementMode, FieldIntentDeletedAt, FieldDiscounts, FieldFeatureKey, FieldFeatureID, FieldRatingEngine, FieldPrice, FieldUnitConfig, FieldCurrentRealizationRunID, FieldStatusDetailed, } // 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 ( // CustomerIDValidator is a validator for the "customer_id" field. It is called by the builders before save. CustomerIDValidator func(string) error // CurrencyValidator is a validator for the "currency" field. It is called by the builders before save. CurrencyValidator func(string) error // TaxCodeIDValidator is a validator for the "tax_code_id" field. It is called by the builders before save. TaxCodeIDValidator func(string) error // NamespaceValidator is a validator for the "namespace" field. It is called by the builders before save. NamespaceValidator func(string) error // 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 // FeatureKeyValidator is a validator for the "feature_key" field. It is called by the builders before save. FeatureKeyValidator func(string) error // FeatureIDValidator is a validator for the "feature_id" field. It is called by the builders before save. FeatureIDValidator func(string) error // DefaultID holds the default value on creation for the "id" field. DefaultID func() string // ValueScanner of all ChargeUsageBased fields. ValueScanner struct { Discounts field.TypeValueScanner[*billing.Discounts] Price field.TypeValueScanner[*productcatalog.Price] UnitConfig field.TypeValueScanner[*productcatalog.UnitConfig] } ) // StatusValidator is a validator for the "status" field enum values. It is called by the builders before save. func StatusValidator(s meta.ChargeStatus) error { switch s { case "created", "active", "final", "deleted": return nil default: return fmt.Errorf("chargeusagebased: invalid enum value for status field: %q", s) } } // ManagedByValidator is a validator for the "managed_by" field enum values. It is called by the builders before save. func ManagedByValidator(mb billing.InvoiceLineManagedBy) error { switch mb { case "subscription", "system", "manual": return nil default: return fmt.Errorf("chargeusagebased: invalid enum value for managed_by field: %q", mb) } } // TaxBehaviorValidator is a validator for the "tax_behavior" field enum values. It is called by the builders before save. func TaxBehaviorValidator(tb productcatalog.TaxBehavior) error { switch tb { case "inclusive", "exclusive": return nil default: return fmt.Errorf("chargeusagebased: invalid enum value for tax_behavior field: %q", tb) } } // SettlementModeValidator is a validator for the "settlement_mode" field enum values. It is called by the builders before save. func SettlementModeValidator(sm productcatalog.SettlementMode) error { switch sm { case "credit_then_invoice", "credit_only": return nil default: return fmt.Errorf("chargeusagebased: invalid enum value for settlement_mode field: %q", sm) } } // RatingEngineValidator is a validator for the "rating_engine" field enum values. It is called by the builders before save. func RatingEngineValidator(re usagebased.RatingEngine) error { switch re { case "delta", "period_preserving": return nil default: return fmt.Errorf("chargeusagebased: invalid enum value for rating_engine field: %q", re) } } // StatusDetailedValidator is a validator for the "status_detailed" field enum values. It is called by the builders before save. func StatusDetailedValidator(sd usagebased.Status) error { switch sd { case "created", "active", "active.realization.started", "active.realization.waiting_for_collection", "active.realization.processing", "active.realization.issuing", "active.realization.completed", "active.awaiting_payment_settlement", "final", "deleted": return nil default: return fmt.Errorf("chargeusagebased: invalid enum value for status_detailed field: %q", sd) } } // OrderOption defines the ordering options for the ChargeUsageBased 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() } // ByCustomerID orders the results by the customer_id field. func ByCustomerID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldCustomerID, opts...).ToFunc() } // ByServicePeriodFrom orders the results by the service_period_from field. func ByServicePeriodFrom(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldServicePeriodFrom, opts...).ToFunc() } // ByServicePeriodTo orders the results by the service_period_to field. func ByServicePeriodTo(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldServicePeriodTo, opts...).ToFunc() } // ByBillingPeriodFrom orders the results by the billing_period_from field. func ByBillingPeriodFrom(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldBillingPeriodFrom, opts...).ToFunc() } // ByBillingPeriodTo orders the results by the billing_period_to field. func ByBillingPeriodTo(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldBillingPeriodTo, opts...).ToFunc() } // ByFullServicePeriodFrom orders the results by the full_service_period_from field. func ByFullServicePeriodFrom(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldFullServicePeriodFrom, opts...).ToFunc() } // ByFullServicePeriodTo orders the results by the full_service_period_to field. func ByFullServicePeriodTo(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldFullServicePeriodTo, opts...).ToFunc() } // ByStatus orders the results by the status field. func ByStatus(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldStatus, opts...).ToFunc() } // ByUniqueReferenceID orders the results by the unique_reference_id field. func ByUniqueReferenceID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldUniqueReferenceID, opts...).ToFunc() } // ByCurrency orders the results by the currency field. func ByCurrency(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldCurrency, opts...).ToFunc() } // ByManagedBy orders the results by the managed_by field. func ByManagedBy(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldManagedBy, opts...).ToFunc() } // BySubscriptionID orders the results by the subscription_id field. func BySubscriptionID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldSubscriptionID, opts...).ToFunc() } // BySubscriptionPhaseID orders the results by the subscription_phase_id field. func BySubscriptionPhaseID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldSubscriptionPhaseID, opts...).ToFunc() } // BySubscriptionItemID orders the results by the subscription_item_id field. func BySubscriptionItemID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldSubscriptionItemID, opts...).ToFunc() } // ByAdvanceAfter orders the results by the advance_after field. func ByAdvanceAfter(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldAdvanceAfter, opts...).ToFunc() } // ByTaxCodeID orders the results by the tax_code_id field. func ByTaxCodeID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldTaxCodeID, opts...).ToFunc() } // ByTaxBehavior orders the results by the tax_behavior field. func ByTaxBehavior(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldTaxBehavior, opts...).ToFunc() } // ByNamespace orders the results by the namespace field. func ByNamespace(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldNamespace, 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() } // 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() } // ByInvoiceAt orders the results by the invoice_at field. func ByInvoiceAt(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldInvoiceAt, opts...).ToFunc() } // BySettlementMode orders the results by the settlement_mode field. func BySettlementMode(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldSettlementMode, opts...).ToFunc() } // ByIntentDeletedAt orders the results by the intent_deleted_at field. func ByIntentDeletedAt(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldIntentDeletedAt, opts...).ToFunc() } // ByDiscounts orders the results by the discounts field. func ByDiscounts(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldDiscounts, opts...).ToFunc() } // ByFeatureKey orders the results by the feature_key field. func ByFeatureKey(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldFeatureKey, opts...).ToFunc() } // ByFeatureID orders the results by the feature_id field. func ByFeatureID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldFeatureID, opts...).ToFunc() } // ByRatingEngine orders the results by the rating_engine field. func ByRatingEngine(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldRatingEngine, opts...).ToFunc() } // ByPrice orders the results by the price field. func ByPrice(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldPrice, opts...).ToFunc() } // ByUnitConfig orders the results by the unit_config field. func ByUnitConfig(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldUnitConfig, opts...).ToFunc() } // ByCurrentRealizationRunID orders the results by the current_realization_run_id field. func ByCurrentRealizationRunID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldCurrentRealizationRunID, opts...).ToFunc() } // ByStatusDetailed orders the results by the status_detailed field. func ByStatusDetailed(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldStatusDetailed, opts...).ToFunc() } // ByRunsCount orders the results by runs count. func ByRunsCount(opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborsCount(s, newRunsStep(), opts...) } } // ByRuns orders the results by runs terms. func ByRuns(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newRunsStep(), append([]sql.OrderTerm{term}, terms...)...) } } // ByDetailedLinesCount orders the results by detailed_lines count. func ByDetailedLinesCount(opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborsCount(s, newDetailedLinesStep(), opts...) } } // ByDetailedLines orders the results by detailed_lines terms. func ByDetailedLines(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newDetailedLinesStep(), append([]sql.OrderTerm{term}, terms...)...) } } // ByCurrentRunField orders the results by current_run field. func ByCurrentRunField(field string, opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newCurrentRunStep(), sql.OrderByField(field, opts...)) } } // ByChargeField orders the results by charge field. func ByChargeField(field string, opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newChargeStep(), sql.OrderByField(field, opts...)) } } // ByIntentOverrideField orders the results by intent_override field. func ByIntentOverrideField(field string, opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newIntentOverrideStep(), sql.OrderByField(field, opts...)) } } // BySubscriptionField orders the results by subscription field. func BySubscriptionField(field string, opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newSubscriptionStep(), sql.OrderByField(field, opts...)) } } // BySubscriptionPhaseField orders the results by subscription_phase field. func BySubscriptionPhaseField(field string, opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newSubscriptionPhaseStep(), sql.OrderByField(field, opts...)) } } // BySubscriptionItemField orders the results by subscription_item field. func BySubscriptionItemField(field string, opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newSubscriptionItemStep(), sql.OrderByField(field, opts...)) } } // ByCustomerField orders the results by customer field. func ByCustomerField(field string, opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newCustomerStep(), sql.OrderByField(field, opts...)) } } // ByFeatureField orders the results by feature field. func ByFeatureField(field string, opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newFeatureStep(), sql.OrderByField(field, opts...)) } } // ByTaxCodeField orders the results by tax_code field. func ByTaxCodeField(field string, opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newTaxCodeStep(), sql.OrderByField(field, opts...)) } } func newRunsStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(RunsInverseTable, FieldID), sqlgraph.Edge(sqlgraph.O2M, false, RunsTable, RunsColumn), ) } func newDetailedLinesStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(DetailedLinesInverseTable, FieldID), sqlgraph.Edge(sqlgraph.O2M, false, DetailedLinesTable, DetailedLinesColumn), ) } func newCurrentRunStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(CurrentRunInverseTable, FieldID), sqlgraph.Edge(sqlgraph.M2O, false, CurrentRunTable, CurrentRunColumn), ) } func newChargeStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(ChargeInverseTable, FieldID), sqlgraph.Edge(sqlgraph.O2O, false, ChargeTable, ChargeColumn), ) } func newIntentOverrideStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(IntentOverrideInverseTable, FieldID), sqlgraph.Edge(sqlgraph.O2O, false, IntentOverrideTable, IntentOverrideColumn), ) } func newSubscriptionStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(SubscriptionInverseTable, FieldID), sqlgraph.Edge(sqlgraph.M2O, true, SubscriptionTable, SubscriptionColumn), ) } func newSubscriptionPhaseStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(SubscriptionPhaseInverseTable, FieldID), sqlgraph.Edge(sqlgraph.M2O, true, SubscriptionPhaseTable, SubscriptionPhaseColumn), ) } func newSubscriptionItemStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(SubscriptionItemInverseTable, FieldID), sqlgraph.Edge(sqlgraph.M2O, true, SubscriptionItemTable, SubscriptionItemColumn), ) } func newCustomerStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(CustomerInverseTable, FieldID), sqlgraph.Edge(sqlgraph.M2O, true, CustomerTable, CustomerColumn), ) } func newFeatureStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(FeatureInverseTable, FieldID), sqlgraph.Edge(sqlgraph.M2O, true, FeatureTable, FeatureColumn), ) } func newTaxCodeStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(TaxCodeInverseTable, FieldID), sqlgraph.Edge(sqlgraph.M2O, true, TaxCodeTable, TaxCodeColumn), ) }