paymentproviderinstance.go 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. // Code generated by ent, DO NOT EDIT.
  2. package paymentproviderinstance
  3. import (
  4. "time"
  5. "entgo.io/ent/dialect/sql"
  6. )
  7. const (
  8. // Label holds the string label denoting the paymentproviderinstance type in the database.
  9. Label = "payment_provider_instance"
  10. // FieldID holds the string denoting the id field in the database.
  11. FieldID = "id"
  12. // FieldProviderKey holds the string denoting the provider_key field in the database.
  13. FieldProviderKey = "provider_key"
  14. // FieldName holds the string denoting the name field in the database.
  15. FieldName = "name"
  16. // FieldConfig holds the string denoting the config field in the database.
  17. FieldConfig = "config"
  18. // FieldSupportedTypes holds the string denoting the supported_types field in the database.
  19. FieldSupportedTypes = "supported_types"
  20. // FieldEnabled holds the string denoting the enabled field in the database.
  21. FieldEnabled = "enabled"
  22. // FieldPaymentMode holds the string denoting the payment_mode field in the database.
  23. FieldPaymentMode = "payment_mode"
  24. // FieldSortOrder holds the string denoting the sort_order field in the database.
  25. FieldSortOrder = "sort_order"
  26. // FieldLimits holds the string denoting the limits field in the database.
  27. FieldLimits = "limits"
  28. // FieldRefundEnabled holds the string denoting the refund_enabled field in the database.
  29. FieldRefundEnabled = "refund_enabled"
  30. // FieldAllowUserRefund holds the string denoting the allow_user_refund field in the database.
  31. FieldAllowUserRefund = "allow_user_refund"
  32. // FieldCreatedAt holds the string denoting the created_at field in the database.
  33. FieldCreatedAt = "created_at"
  34. // FieldUpdatedAt holds the string denoting the updated_at field in the database.
  35. FieldUpdatedAt = "updated_at"
  36. // Table holds the table name of the paymentproviderinstance in the database.
  37. Table = "payment_provider_instances"
  38. )
  39. // Columns holds all SQL columns for paymentproviderinstance fields.
  40. var Columns = []string{
  41. FieldID,
  42. FieldProviderKey,
  43. FieldName,
  44. FieldConfig,
  45. FieldSupportedTypes,
  46. FieldEnabled,
  47. FieldPaymentMode,
  48. FieldSortOrder,
  49. FieldLimits,
  50. FieldRefundEnabled,
  51. FieldAllowUserRefund,
  52. FieldCreatedAt,
  53. FieldUpdatedAt,
  54. }
  55. // ValidColumn reports if the column name is valid (part of the table columns).
  56. func ValidColumn(column string) bool {
  57. for i := range Columns {
  58. if column == Columns[i] {
  59. return true
  60. }
  61. }
  62. return false
  63. }
  64. var (
  65. // ProviderKeyValidator is a validator for the "provider_key" field. It is called by the builders before save.
  66. ProviderKeyValidator func(string) error
  67. // DefaultName holds the default value on creation for the "name" field.
  68. DefaultName string
  69. // NameValidator is a validator for the "name" field. It is called by the builders before save.
  70. NameValidator func(string) error
  71. // DefaultSupportedTypes holds the default value on creation for the "supported_types" field.
  72. DefaultSupportedTypes string
  73. // SupportedTypesValidator is a validator for the "supported_types" field. It is called by the builders before save.
  74. SupportedTypesValidator func(string) error
  75. // DefaultEnabled holds the default value on creation for the "enabled" field.
  76. DefaultEnabled bool
  77. // DefaultPaymentMode holds the default value on creation for the "payment_mode" field.
  78. DefaultPaymentMode string
  79. // PaymentModeValidator is a validator for the "payment_mode" field. It is called by the builders before save.
  80. PaymentModeValidator func(string) error
  81. // DefaultSortOrder holds the default value on creation for the "sort_order" field.
  82. DefaultSortOrder int
  83. // DefaultLimits holds the default value on creation for the "limits" field.
  84. DefaultLimits string
  85. // DefaultRefundEnabled holds the default value on creation for the "refund_enabled" field.
  86. DefaultRefundEnabled bool
  87. // DefaultAllowUserRefund holds the default value on creation for the "allow_user_refund" field.
  88. DefaultAllowUserRefund bool
  89. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  90. DefaultCreatedAt func() time.Time
  91. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  92. DefaultUpdatedAt func() time.Time
  93. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  94. UpdateDefaultUpdatedAt func() time.Time
  95. )
  96. // OrderOption defines the ordering options for the PaymentProviderInstance queries.
  97. type OrderOption func(*sql.Selector)
  98. // ByID orders the results by the id field.
  99. func ByID(opts ...sql.OrderTermOption) OrderOption {
  100. return sql.OrderByField(FieldID, opts...).ToFunc()
  101. }
  102. // ByProviderKey orders the results by the provider_key field.
  103. func ByProviderKey(opts ...sql.OrderTermOption) OrderOption {
  104. return sql.OrderByField(FieldProviderKey, opts...).ToFunc()
  105. }
  106. // ByName orders the results by the name field.
  107. func ByName(opts ...sql.OrderTermOption) OrderOption {
  108. return sql.OrderByField(FieldName, opts...).ToFunc()
  109. }
  110. // ByConfig orders the results by the config field.
  111. func ByConfig(opts ...sql.OrderTermOption) OrderOption {
  112. return sql.OrderByField(FieldConfig, opts...).ToFunc()
  113. }
  114. // BySupportedTypes orders the results by the supported_types field.
  115. func BySupportedTypes(opts ...sql.OrderTermOption) OrderOption {
  116. return sql.OrderByField(FieldSupportedTypes, opts...).ToFunc()
  117. }
  118. // ByEnabled orders the results by the enabled field.
  119. func ByEnabled(opts ...sql.OrderTermOption) OrderOption {
  120. return sql.OrderByField(FieldEnabled, opts...).ToFunc()
  121. }
  122. // ByPaymentMode orders the results by the payment_mode field.
  123. func ByPaymentMode(opts ...sql.OrderTermOption) OrderOption {
  124. return sql.OrderByField(FieldPaymentMode, opts...).ToFunc()
  125. }
  126. // BySortOrder orders the results by the sort_order field.
  127. func BySortOrder(opts ...sql.OrderTermOption) OrderOption {
  128. return sql.OrderByField(FieldSortOrder, opts...).ToFunc()
  129. }
  130. // ByLimits orders the results by the limits field.
  131. func ByLimits(opts ...sql.OrderTermOption) OrderOption {
  132. return sql.OrderByField(FieldLimits, opts...).ToFunc()
  133. }
  134. // ByRefundEnabled orders the results by the refund_enabled field.
  135. func ByRefundEnabled(opts ...sql.OrderTermOption) OrderOption {
  136. return sql.OrderByField(FieldRefundEnabled, opts...).ToFunc()
  137. }
  138. // ByAllowUserRefund orders the results by the allow_user_refund field.
  139. func ByAllowUserRefund(opts ...sql.OrderTermOption) OrderOption {
  140. return sql.OrderByField(FieldAllowUserRefund, opts...).ToFunc()
  141. }
  142. // ByCreatedAt orders the results by the created_at field.
  143. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  144. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  145. }
  146. // ByUpdatedAt orders the results by the updated_at field.
  147. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  148. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  149. }