File size: 8,521 Bytes
63a69a8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
// Code generated by ent, DO NOT EDIT.

package chargeusagebasedruninvoicedusage

import (
	"time"

	"entgo.io/ent/dialect/sql"
	"entgo.io/ent/dialect/sql/sqlgraph"
)

const (
	// Label holds the string label denoting the chargeusagebasedruninvoicedusage type in the database.
	Label = "charge_usage_based_run_invoiced_usage"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "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"
	// FieldLedgerTransactionGroupID holds the string denoting the ledger_transaction_group_id field in the database.
	FieldLedgerTransactionGroupID = "ledger_transaction_group_id"
	// FieldNamespace holds the string denoting the namespace field in the database.
	FieldNamespace = "namespace"
	// 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"
	// FieldAnnotations holds the string denoting the annotations field in the database.
	FieldAnnotations = "annotations"
	// FieldAmount holds the string denoting the amount field in the database.
	FieldAmount = "amount"
	// FieldTaxesTotal holds the string denoting the taxes_total field in the database.
	FieldTaxesTotal = "taxes_total"
	// FieldTaxesInclusiveTotal holds the string denoting the taxes_inclusive_total field in the database.
	FieldTaxesInclusiveTotal = "taxes_inclusive_total"
	// FieldTaxesExclusiveTotal holds the string denoting the taxes_exclusive_total field in the database.
	FieldTaxesExclusiveTotal = "taxes_exclusive_total"
	// FieldChargesTotal holds the string denoting the charges_total field in the database.
	FieldChargesTotal = "charges_total"
	// FieldDiscountsTotal holds the string denoting the discounts_total field in the database.
	FieldDiscountsTotal = "discounts_total"
	// FieldCreditsTotal holds the string denoting the credits_total field in the database.
	FieldCreditsTotal = "credits_total"
	// FieldTotal holds the string denoting the total field in the database.
	FieldTotal = "total"
	// FieldRunID holds the string denoting the run_id field in the database.
	FieldRunID = "run_id"
	// EdgeRun holds the string denoting the run edge name in mutations.
	EdgeRun = "run"
	// Table holds the table name of the chargeusagebasedruninvoicedusage in the database.
	Table = "charge_usage_based_run_invoiced_usages"
	// RunTable is the table that holds the run relation/edge.
	RunTable = "charge_usage_based_run_invoiced_usages"
	// RunInverseTable is the table name for the ChargeUsageBasedRuns entity.
	// It exists in this package in order to avoid circular dependency with the "chargeusagebasedruns" package.
	RunInverseTable = "charge_usage_based_runs"
	// RunColumn is the table column denoting the run relation/edge.
	RunColumn = "run_id"
)

// Columns holds all SQL columns for chargeusagebasedruninvoicedusage fields.
var Columns = []string{
	FieldID,
	FieldServicePeriodFrom,
	FieldServicePeriodTo,
	FieldLedgerTransactionGroupID,
	FieldNamespace,
	FieldCreatedAt,
	FieldUpdatedAt,
	FieldDeletedAt,
	FieldAnnotations,
	FieldAmount,
	FieldTaxesTotal,
	FieldTaxesInclusiveTotal,
	FieldTaxesExclusiveTotal,
	FieldChargesTotal,
	FieldDiscountsTotal,
	FieldCreditsTotal,
	FieldTotal,
	FieldRunID,
}

// 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 (
	// LedgerTransactionGroupIDValidator is a validator for the "ledger_transaction_group_id" field. It is called by the builders before save.
	LedgerTransactionGroupIDValidator 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
	// DefaultID holds the default value on creation for the "id" field.
	DefaultID func() string
)

// OrderOption defines the ordering options for the ChargeUsageBasedRunInvoicedUsage 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()
}

// 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()
}

// ByLedgerTransactionGroupID orders the results by the ledger_transaction_group_id field.
func ByLedgerTransactionGroupID(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldLedgerTransactionGroupID, 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()
}

// ByAmount orders the results by the amount field.
func ByAmount(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldAmount, opts...).ToFunc()
}

// ByTaxesTotal orders the results by the taxes_total field.
func ByTaxesTotal(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldTaxesTotal, opts...).ToFunc()
}

// ByTaxesInclusiveTotal orders the results by the taxes_inclusive_total field.
func ByTaxesInclusiveTotal(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldTaxesInclusiveTotal, opts...).ToFunc()
}

// ByTaxesExclusiveTotal orders the results by the taxes_exclusive_total field.
func ByTaxesExclusiveTotal(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldTaxesExclusiveTotal, opts...).ToFunc()
}

// ByChargesTotal orders the results by the charges_total field.
func ByChargesTotal(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldChargesTotal, opts...).ToFunc()
}

// ByDiscountsTotal orders the results by the discounts_total field.
func ByDiscountsTotal(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldDiscountsTotal, opts...).ToFunc()
}

// ByCreditsTotal orders the results by the credits_total field.
func ByCreditsTotal(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldCreditsTotal, opts...).ToFunc()
}

// ByTotal orders the results by the total field.
func ByTotal(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldTotal, opts...).ToFunc()
}

// ByRunID orders the results by the run_id field.
func ByRunID(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldRunID, opts...).ToFunc()
}

// ByRunField orders the results by run field.
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),
	)
}