| |
|
|
| package chargeusagebasedruninvoicedusage |
|
|
| import ( |
| "time" |
|
|
| "entgo.io/ent/dialect/sql" |
| "entgo.io/ent/dialect/sql/sqlgraph" |
| ) |
|
|
| const ( |
| |
| Label = "charge_usage_based_run_invoiced_usage" |
| |
| FieldID = "id" |
| |
| FieldServicePeriodFrom = "service_period_from" |
| |
| FieldServicePeriodTo = "service_period_to" |
| |
| FieldLedgerTransactionGroupID = "ledger_transaction_group_id" |
| |
| FieldNamespace = "namespace" |
| |
| FieldCreatedAt = "created_at" |
| |
| FieldUpdatedAt = "updated_at" |
| |
| FieldDeletedAt = "deleted_at" |
| |
| FieldAnnotations = "annotations" |
| |
| FieldAmount = "amount" |
| |
| FieldTaxesTotal = "taxes_total" |
| |
| FieldTaxesInclusiveTotal = "taxes_inclusive_total" |
| |
| FieldTaxesExclusiveTotal = "taxes_exclusive_total" |
| |
| FieldChargesTotal = "charges_total" |
| |
| FieldDiscountsTotal = "discounts_total" |
| |
| FieldCreditsTotal = "credits_total" |
| |
| FieldTotal = "total" |
| |
| FieldRunID = "run_id" |
| |
| EdgeRun = "run" |
| |
| Table = "charge_usage_based_run_invoiced_usages" |
| |
| RunTable = "charge_usage_based_run_invoiced_usages" |
| |
| |
| RunInverseTable = "charge_usage_based_runs" |
| |
| RunColumn = "run_id" |
| ) |
|
|
| |
| var Columns = []string{ |
| FieldID, |
| FieldServicePeriodFrom, |
| FieldServicePeriodTo, |
| FieldLedgerTransactionGroupID, |
| FieldNamespace, |
| FieldCreatedAt, |
| FieldUpdatedAt, |
| FieldDeletedAt, |
| FieldAnnotations, |
| FieldAmount, |
| FieldTaxesTotal, |
| FieldTaxesInclusiveTotal, |
| FieldTaxesExclusiveTotal, |
| FieldChargesTotal, |
| FieldDiscountsTotal, |
| FieldCreditsTotal, |
| FieldTotal, |
| FieldRunID, |
| } |
|
|
| |
| func ValidColumn(column string) bool { |
| for i := range Columns { |
| if column == Columns[i] { |
| return true |
| } |
| } |
| return false |
| } |
|
|
| var ( |
| |
| LedgerTransactionGroupIDValidator func(string) error |
| |
| NamespaceValidator func(string) error |
| |
| DefaultCreatedAt func() time.Time |
| |
| DefaultUpdatedAt func() time.Time |
| |
| UpdateDefaultUpdatedAt func() time.Time |
| |
| DefaultID func() string |
| ) |
|
|
| |
| type OrderOption func(*sql.Selector) |
|
|
| |
| func ByID(opts ...sql.OrderTermOption) OrderOption { |
| return sql.OrderByField(FieldID, opts...).ToFunc() |
| } |
|
|
| |
| func ByServicePeriodFrom(opts ...sql.OrderTermOption) OrderOption { |
| return sql.OrderByField(FieldServicePeriodFrom, opts...).ToFunc() |
| } |
|
|
| |
| func ByServicePeriodTo(opts ...sql.OrderTermOption) OrderOption { |
| return sql.OrderByField(FieldServicePeriodTo, opts...).ToFunc() |
| } |
|
|
| |
| func ByLedgerTransactionGroupID(opts ...sql.OrderTermOption) OrderOption { |
| return sql.OrderByField(FieldLedgerTransactionGroupID, opts...).ToFunc() |
| } |
|
|
| |
| func ByNamespace(opts ...sql.OrderTermOption) OrderOption { |
| return sql.OrderByField(FieldNamespace, opts...).ToFunc() |
| } |
|
|
| |
| func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { |
| return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() |
| } |
|
|
| |
| func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { |
| return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() |
| } |
|
|
| |
| func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { |
| return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() |
| } |
|
|
| |
| func ByAmount(opts ...sql.OrderTermOption) OrderOption { |
| return sql.OrderByField(FieldAmount, opts...).ToFunc() |
| } |
|
|
| |
| func ByTaxesTotal(opts ...sql.OrderTermOption) OrderOption { |
| return sql.OrderByField(FieldTaxesTotal, opts...).ToFunc() |
| } |
|
|
| |
| func ByTaxesInclusiveTotal(opts ...sql.OrderTermOption) OrderOption { |
| return sql.OrderByField(FieldTaxesInclusiveTotal, opts...).ToFunc() |
| } |
|
|
| |
| func ByTaxesExclusiveTotal(opts ...sql.OrderTermOption) OrderOption { |
| return sql.OrderByField(FieldTaxesExclusiveTotal, opts...).ToFunc() |
| } |
|
|
| |
| func ByChargesTotal(opts ...sql.OrderTermOption) OrderOption { |
| return sql.OrderByField(FieldChargesTotal, opts...).ToFunc() |
| } |
|
|
| |
| func ByDiscountsTotal(opts ...sql.OrderTermOption) OrderOption { |
| return sql.OrderByField(FieldDiscountsTotal, opts...).ToFunc() |
| } |
|
|
| |
| func ByCreditsTotal(opts ...sql.OrderTermOption) OrderOption { |
| return sql.OrderByField(FieldCreditsTotal, opts...).ToFunc() |
| } |
|
|
| |
| func ByTotal(opts ...sql.OrderTermOption) OrderOption { |
| return sql.OrderByField(FieldTotal, opts...).ToFunc() |
| } |
|
|
| |
| func ByRunID(opts ...sql.OrderTermOption) OrderOption { |
| return sql.OrderByField(FieldRunID, opts...).ToFunc() |
| } |
|
|
| |
| func ByRunField(field string, opts ...sql.OrderTermOption) OrderOption { |
| return func(s *sql.Selector) { |
| sqlgraph.OrderByNeighborTerms(s, newRunStep(), sql.OrderByField(field, opts...)) |
| } |
| } |
| func newRunStep() *sqlgraph.Step { |
| return sqlgraph.NewStep( |
| sqlgraph.From(Table, FieldID), |
| sqlgraph.To(RunInverseTable, FieldID), |
| sqlgraph.Edge(sqlgraph.O2O, true, RunTable, RunColumn), |
| ) |
| } |
|
|