paymentauditlog.go 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. // Code generated by ent, DO NOT EDIT.
  2. package paymentauditlog
  3. import (
  4. "time"
  5. "entgo.io/ent/dialect/sql"
  6. )
  7. const (
  8. // Label holds the string label denoting the paymentauditlog type in the database.
  9. Label = "payment_audit_log"
  10. // FieldID holds the string denoting the id field in the database.
  11. FieldID = "id"
  12. // FieldOrderID holds the string denoting the order_id field in the database.
  13. FieldOrderID = "order_id"
  14. // FieldAction holds the string denoting the action field in the database.
  15. FieldAction = "action"
  16. // FieldDetail holds the string denoting the detail field in the database.
  17. FieldDetail = "detail"
  18. // FieldOperator holds the string denoting the operator field in the database.
  19. FieldOperator = "operator"
  20. // FieldCreatedAt holds the string denoting the created_at field in the database.
  21. FieldCreatedAt = "created_at"
  22. // Table holds the table name of the paymentauditlog in the database.
  23. Table = "payment_audit_logs"
  24. )
  25. // Columns holds all SQL columns for paymentauditlog fields.
  26. var Columns = []string{
  27. FieldID,
  28. FieldOrderID,
  29. FieldAction,
  30. FieldDetail,
  31. FieldOperator,
  32. FieldCreatedAt,
  33. }
  34. // ValidColumn reports if the column name is valid (part of the table columns).
  35. func ValidColumn(column string) bool {
  36. for i := range Columns {
  37. if column == Columns[i] {
  38. return true
  39. }
  40. }
  41. return false
  42. }
  43. var (
  44. // OrderIDValidator is a validator for the "order_id" field. It is called by the builders before save.
  45. OrderIDValidator func(string) error
  46. // ActionValidator is a validator for the "action" field. It is called by the builders before save.
  47. ActionValidator func(string) error
  48. // DefaultDetail holds the default value on creation for the "detail" field.
  49. DefaultDetail string
  50. // DefaultOperator holds the default value on creation for the "operator" field.
  51. DefaultOperator string
  52. // OperatorValidator is a validator for the "operator" field. It is called by the builders before save.
  53. OperatorValidator func(string) error
  54. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  55. DefaultCreatedAt func() time.Time
  56. )
  57. // OrderOption defines the ordering options for the PaymentAuditLog queries.
  58. type OrderOption func(*sql.Selector)
  59. // ByID orders the results by the id field.
  60. func ByID(opts ...sql.OrderTermOption) OrderOption {
  61. return sql.OrderByField(FieldID, opts...).ToFunc()
  62. }
  63. // ByOrderID orders the results by the order_id field.
  64. func ByOrderID(opts ...sql.OrderTermOption) OrderOption {
  65. return sql.OrderByField(FieldOrderID, opts...).ToFunc()
  66. }
  67. // ByAction orders the results by the action field.
  68. func ByAction(opts ...sql.OrderTermOption) OrderOption {
  69. return sql.OrderByField(FieldAction, opts...).ToFunc()
  70. }
  71. // ByDetail orders the results by the detail field.
  72. func ByDetail(opts ...sql.OrderTermOption) OrderOption {
  73. return sql.OrderByField(FieldDetail, opts...).ToFunc()
  74. }
  75. // ByOperator orders the results by the operator field.
  76. func ByOperator(opts ...sql.OrderTermOption) OrderOption {
  77. return sql.OrderByField(FieldOperator, opts...).ToFunc()
  78. }
  79. // ByCreatedAt orders the results by the created_at field.
  80. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  81. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  82. }