where.go 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  1. // Code generated by ent, DO NOT EDIT.
  2. package promocode
  3. import (
  4. "time"
  5. "entgo.io/ent/dialect/sql"
  6. "entgo.io/ent/dialect/sql/sqlgraph"
  7. "github.com/Wei-Shaw/sub2api/ent/predicate"
  8. )
  9. // ID filters vertices based on their ID field.
  10. func ID(id int64) predicate.PromoCode {
  11. return predicate.PromoCode(sql.FieldEQ(FieldID, id))
  12. }
  13. // IDEQ applies the EQ predicate on the ID field.
  14. func IDEQ(id int64) predicate.PromoCode {
  15. return predicate.PromoCode(sql.FieldEQ(FieldID, id))
  16. }
  17. // IDNEQ applies the NEQ predicate on the ID field.
  18. func IDNEQ(id int64) predicate.PromoCode {
  19. return predicate.PromoCode(sql.FieldNEQ(FieldID, id))
  20. }
  21. // IDIn applies the In predicate on the ID field.
  22. func IDIn(ids ...int64) predicate.PromoCode {
  23. return predicate.PromoCode(sql.FieldIn(FieldID, ids...))
  24. }
  25. // IDNotIn applies the NotIn predicate on the ID field.
  26. func IDNotIn(ids ...int64) predicate.PromoCode {
  27. return predicate.PromoCode(sql.FieldNotIn(FieldID, ids...))
  28. }
  29. // IDGT applies the GT predicate on the ID field.
  30. func IDGT(id int64) predicate.PromoCode {
  31. return predicate.PromoCode(sql.FieldGT(FieldID, id))
  32. }
  33. // IDGTE applies the GTE predicate on the ID field.
  34. func IDGTE(id int64) predicate.PromoCode {
  35. return predicate.PromoCode(sql.FieldGTE(FieldID, id))
  36. }
  37. // IDLT applies the LT predicate on the ID field.
  38. func IDLT(id int64) predicate.PromoCode {
  39. return predicate.PromoCode(sql.FieldLT(FieldID, id))
  40. }
  41. // IDLTE applies the LTE predicate on the ID field.
  42. func IDLTE(id int64) predicate.PromoCode {
  43. return predicate.PromoCode(sql.FieldLTE(FieldID, id))
  44. }
  45. // Code applies equality check predicate on the "code" field. It's identical to CodeEQ.
  46. func Code(v string) predicate.PromoCode {
  47. return predicate.PromoCode(sql.FieldEQ(FieldCode, v))
  48. }
  49. // BonusAmount applies equality check predicate on the "bonus_amount" field. It's identical to BonusAmountEQ.
  50. func BonusAmount(v float64) predicate.PromoCode {
  51. return predicate.PromoCode(sql.FieldEQ(FieldBonusAmount, v))
  52. }
  53. // MaxUses applies equality check predicate on the "max_uses" field. It's identical to MaxUsesEQ.
  54. func MaxUses(v int) predicate.PromoCode {
  55. return predicate.PromoCode(sql.FieldEQ(FieldMaxUses, v))
  56. }
  57. // UsedCount applies equality check predicate on the "used_count" field. It's identical to UsedCountEQ.
  58. func UsedCount(v int) predicate.PromoCode {
  59. return predicate.PromoCode(sql.FieldEQ(FieldUsedCount, v))
  60. }
  61. // Status applies equality check predicate on the "status" field. It's identical to StatusEQ.
  62. func Status(v string) predicate.PromoCode {
  63. return predicate.PromoCode(sql.FieldEQ(FieldStatus, v))
  64. }
  65. // ExpiresAt applies equality check predicate on the "expires_at" field. It's identical to ExpiresAtEQ.
  66. func ExpiresAt(v time.Time) predicate.PromoCode {
  67. return predicate.PromoCode(sql.FieldEQ(FieldExpiresAt, v))
  68. }
  69. // Notes applies equality check predicate on the "notes" field. It's identical to NotesEQ.
  70. func Notes(v string) predicate.PromoCode {
  71. return predicate.PromoCode(sql.FieldEQ(FieldNotes, v))
  72. }
  73. // CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
  74. func CreatedAt(v time.Time) predicate.PromoCode {
  75. return predicate.PromoCode(sql.FieldEQ(FieldCreatedAt, v))
  76. }
  77. // UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.
  78. func UpdatedAt(v time.Time) predicate.PromoCode {
  79. return predicate.PromoCode(sql.FieldEQ(FieldUpdatedAt, v))
  80. }
  81. // CodeEQ applies the EQ predicate on the "code" field.
  82. func CodeEQ(v string) predicate.PromoCode {
  83. return predicate.PromoCode(sql.FieldEQ(FieldCode, v))
  84. }
  85. // CodeNEQ applies the NEQ predicate on the "code" field.
  86. func CodeNEQ(v string) predicate.PromoCode {
  87. return predicate.PromoCode(sql.FieldNEQ(FieldCode, v))
  88. }
  89. // CodeIn applies the In predicate on the "code" field.
  90. func CodeIn(vs ...string) predicate.PromoCode {
  91. return predicate.PromoCode(sql.FieldIn(FieldCode, vs...))
  92. }
  93. // CodeNotIn applies the NotIn predicate on the "code" field.
  94. func CodeNotIn(vs ...string) predicate.PromoCode {
  95. return predicate.PromoCode(sql.FieldNotIn(FieldCode, vs...))
  96. }
  97. // CodeGT applies the GT predicate on the "code" field.
  98. func CodeGT(v string) predicate.PromoCode {
  99. return predicate.PromoCode(sql.FieldGT(FieldCode, v))
  100. }
  101. // CodeGTE applies the GTE predicate on the "code" field.
  102. func CodeGTE(v string) predicate.PromoCode {
  103. return predicate.PromoCode(sql.FieldGTE(FieldCode, v))
  104. }
  105. // CodeLT applies the LT predicate on the "code" field.
  106. func CodeLT(v string) predicate.PromoCode {
  107. return predicate.PromoCode(sql.FieldLT(FieldCode, v))
  108. }
  109. // CodeLTE applies the LTE predicate on the "code" field.
  110. func CodeLTE(v string) predicate.PromoCode {
  111. return predicate.PromoCode(sql.FieldLTE(FieldCode, v))
  112. }
  113. // CodeContains applies the Contains predicate on the "code" field.
  114. func CodeContains(v string) predicate.PromoCode {
  115. return predicate.PromoCode(sql.FieldContains(FieldCode, v))
  116. }
  117. // CodeHasPrefix applies the HasPrefix predicate on the "code" field.
  118. func CodeHasPrefix(v string) predicate.PromoCode {
  119. return predicate.PromoCode(sql.FieldHasPrefix(FieldCode, v))
  120. }
  121. // CodeHasSuffix applies the HasSuffix predicate on the "code" field.
  122. func CodeHasSuffix(v string) predicate.PromoCode {
  123. return predicate.PromoCode(sql.FieldHasSuffix(FieldCode, v))
  124. }
  125. // CodeEqualFold applies the EqualFold predicate on the "code" field.
  126. func CodeEqualFold(v string) predicate.PromoCode {
  127. return predicate.PromoCode(sql.FieldEqualFold(FieldCode, v))
  128. }
  129. // CodeContainsFold applies the ContainsFold predicate on the "code" field.
  130. func CodeContainsFold(v string) predicate.PromoCode {
  131. return predicate.PromoCode(sql.FieldContainsFold(FieldCode, v))
  132. }
  133. // BonusAmountEQ applies the EQ predicate on the "bonus_amount" field.
  134. func BonusAmountEQ(v float64) predicate.PromoCode {
  135. return predicate.PromoCode(sql.FieldEQ(FieldBonusAmount, v))
  136. }
  137. // BonusAmountNEQ applies the NEQ predicate on the "bonus_amount" field.
  138. func BonusAmountNEQ(v float64) predicate.PromoCode {
  139. return predicate.PromoCode(sql.FieldNEQ(FieldBonusAmount, v))
  140. }
  141. // BonusAmountIn applies the In predicate on the "bonus_amount" field.
  142. func BonusAmountIn(vs ...float64) predicate.PromoCode {
  143. return predicate.PromoCode(sql.FieldIn(FieldBonusAmount, vs...))
  144. }
  145. // BonusAmountNotIn applies the NotIn predicate on the "bonus_amount" field.
  146. func BonusAmountNotIn(vs ...float64) predicate.PromoCode {
  147. return predicate.PromoCode(sql.FieldNotIn(FieldBonusAmount, vs...))
  148. }
  149. // BonusAmountGT applies the GT predicate on the "bonus_amount" field.
  150. func BonusAmountGT(v float64) predicate.PromoCode {
  151. return predicate.PromoCode(sql.FieldGT(FieldBonusAmount, v))
  152. }
  153. // BonusAmountGTE applies the GTE predicate on the "bonus_amount" field.
  154. func BonusAmountGTE(v float64) predicate.PromoCode {
  155. return predicate.PromoCode(sql.FieldGTE(FieldBonusAmount, v))
  156. }
  157. // BonusAmountLT applies the LT predicate on the "bonus_amount" field.
  158. func BonusAmountLT(v float64) predicate.PromoCode {
  159. return predicate.PromoCode(sql.FieldLT(FieldBonusAmount, v))
  160. }
  161. // BonusAmountLTE applies the LTE predicate on the "bonus_amount" field.
  162. func BonusAmountLTE(v float64) predicate.PromoCode {
  163. return predicate.PromoCode(sql.FieldLTE(FieldBonusAmount, v))
  164. }
  165. // MaxUsesEQ applies the EQ predicate on the "max_uses" field.
  166. func MaxUsesEQ(v int) predicate.PromoCode {
  167. return predicate.PromoCode(sql.FieldEQ(FieldMaxUses, v))
  168. }
  169. // MaxUsesNEQ applies the NEQ predicate on the "max_uses" field.
  170. func MaxUsesNEQ(v int) predicate.PromoCode {
  171. return predicate.PromoCode(sql.FieldNEQ(FieldMaxUses, v))
  172. }
  173. // MaxUsesIn applies the In predicate on the "max_uses" field.
  174. func MaxUsesIn(vs ...int) predicate.PromoCode {
  175. return predicate.PromoCode(sql.FieldIn(FieldMaxUses, vs...))
  176. }
  177. // MaxUsesNotIn applies the NotIn predicate on the "max_uses" field.
  178. func MaxUsesNotIn(vs ...int) predicate.PromoCode {
  179. return predicate.PromoCode(sql.FieldNotIn(FieldMaxUses, vs...))
  180. }
  181. // MaxUsesGT applies the GT predicate on the "max_uses" field.
  182. func MaxUsesGT(v int) predicate.PromoCode {
  183. return predicate.PromoCode(sql.FieldGT(FieldMaxUses, v))
  184. }
  185. // MaxUsesGTE applies the GTE predicate on the "max_uses" field.
  186. func MaxUsesGTE(v int) predicate.PromoCode {
  187. return predicate.PromoCode(sql.FieldGTE(FieldMaxUses, v))
  188. }
  189. // MaxUsesLT applies the LT predicate on the "max_uses" field.
  190. func MaxUsesLT(v int) predicate.PromoCode {
  191. return predicate.PromoCode(sql.FieldLT(FieldMaxUses, v))
  192. }
  193. // MaxUsesLTE applies the LTE predicate on the "max_uses" field.
  194. func MaxUsesLTE(v int) predicate.PromoCode {
  195. return predicate.PromoCode(sql.FieldLTE(FieldMaxUses, v))
  196. }
  197. // UsedCountEQ applies the EQ predicate on the "used_count" field.
  198. func UsedCountEQ(v int) predicate.PromoCode {
  199. return predicate.PromoCode(sql.FieldEQ(FieldUsedCount, v))
  200. }
  201. // UsedCountNEQ applies the NEQ predicate on the "used_count" field.
  202. func UsedCountNEQ(v int) predicate.PromoCode {
  203. return predicate.PromoCode(sql.FieldNEQ(FieldUsedCount, v))
  204. }
  205. // UsedCountIn applies the In predicate on the "used_count" field.
  206. func UsedCountIn(vs ...int) predicate.PromoCode {
  207. return predicate.PromoCode(sql.FieldIn(FieldUsedCount, vs...))
  208. }
  209. // UsedCountNotIn applies the NotIn predicate on the "used_count" field.
  210. func UsedCountNotIn(vs ...int) predicate.PromoCode {
  211. return predicate.PromoCode(sql.FieldNotIn(FieldUsedCount, vs...))
  212. }
  213. // UsedCountGT applies the GT predicate on the "used_count" field.
  214. func UsedCountGT(v int) predicate.PromoCode {
  215. return predicate.PromoCode(sql.FieldGT(FieldUsedCount, v))
  216. }
  217. // UsedCountGTE applies the GTE predicate on the "used_count" field.
  218. func UsedCountGTE(v int) predicate.PromoCode {
  219. return predicate.PromoCode(sql.FieldGTE(FieldUsedCount, v))
  220. }
  221. // UsedCountLT applies the LT predicate on the "used_count" field.
  222. func UsedCountLT(v int) predicate.PromoCode {
  223. return predicate.PromoCode(sql.FieldLT(FieldUsedCount, v))
  224. }
  225. // UsedCountLTE applies the LTE predicate on the "used_count" field.
  226. func UsedCountLTE(v int) predicate.PromoCode {
  227. return predicate.PromoCode(sql.FieldLTE(FieldUsedCount, v))
  228. }
  229. // StatusEQ applies the EQ predicate on the "status" field.
  230. func StatusEQ(v string) predicate.PromoCode {
  231. return predicate.PromoCode(sql.FieldEQ(FieldStatus, v))
  232. }
  233. // StatusNEQ applies the NEQ predicate on the "status" field.
  234. func StatusNEQ(v string) predicate.PromoCode {
  235. return predicate.PromoCode(sql.FieldNEQ(FieldStatus, v))
  236. }
  237. // StatusIn applies the In predicate on the "status" field.
  238. func StatusIn(vs ...string) predicate.PromoCode {
  239. return predicate.PromoCode(sql.FieldIn(FieldStatus, vs...))
  240. }
  241. // StatusNotIn applies the NotIn predicate on the "status" field.
  242. func StatusNotIn(vs ...string) predicate.PromoCode {
  243. return predicate.PromoCode(sql.FieldNotIn(FieldStatus, vs...))
  244. }
  245. // StatusGT applies the GT predicate on the "status" field.
  246. func StatusGT(v string) predicate.PromoCode {
  247. return predicate.PromoCode(sql.FieldGT(FieldStatus, v))
  248. }
  249. // StatusGTE applies the GTE predicate on the "status" field.
  250. func StatusGTE(v string) predicate.PromoCode {
  251. return predicate.PromoCode(sql.FieldGTE(FieldStatus, v))
  252. }
  253. // StatusLT applies the LT predicate on the "status" field.
  254. func StatusLT(v string) predicate.PromoCode {
  255. return predicate.PromoCode(sql.FieldLT(FieldStatus, v))
  256. }
  257. // StatusLTE applies the LTE predicate on the "status" field.
  258. func StatusLTE(v string) predicate.PromoCode {
  259. return predicate.PromoCode(sql.FieldLTE(FieldStatus, v))
  260. }
  261. // StatusContains applies the Contains predicate on the "status" field.
  262. func StatusContains(v string) predicate.PromoCode {
  263. return predicate.PromoCode(sql.FieldContains(FieldStatus, v))
  264. }
  265. // StatusHasPrefix applies the HasPrefix predicate on the "status" field.
  266. func StatusHasPrefix(v string) predicate.PromoCode {
  267. return predicate.PromoCode(sql.FieldHasPrefix(FieldStatus, v))
  268. }
  269. // StatusHasSuffix applies the HasSuffix predicate on the "status" field.
  270. func StatusHasSuffix(v string) predicate.PromoCode {
  271. return predicate.PromoCode(sql.FieldHasSuffix(FieldStatus, v))
  272. }
  273. // StatusEqualFold applies the EqualFold predicate on the "status" field.
  274. func StatusEqualFold(v string) predicate.PromoCode {
  275. return predicate.PromoCode(sql.FieldEqualFold(FieldStatus, v))
  276. }
  277. // StatusContainsFold applies the ContainsFold predicate on the "status" field.
  278. func StatusContainsFold(v string) predicate.PromoCode {
  279. return predicate.PromoCode(sql.FieldContainsFold(FieldStatus, v))
  280. }
  281. // ExpiresAtEQ applies the EQ predicate on the "expires_at" field.
  282. func ExpiresAtEQ(v time.Time) predicate.PromoCode {
  283. return predicate.PromoCode(sql.FieldEQ(FieldExpiresAt, v))
  284. }
  285. // ExpiresAtNEQ applies the NEQ predicate on the "expires_at" field.
  286. func ExpiresAtNEQ(v time.Time) predicate.PromoCode {
  287. return predicate.PromoCode(sql.FieldNEQ(FieldExpiresAt, v))
  288. }
  289. // ExpiresAtIn applies the In predicate on the "expires_at" field.
  290. func ExpiresAtIn(vs ...time.Time) predicate.PromoCode {
  291. return predicate.PromoCode(sql.FieldIn(FieldExpiresAt, vs...))
  292. }
  293. // ExpiresAtNotIn applies the NotIn predicate on the "expires_at" field.
  294. func ExpiresAtNotIn(vs ...time.Time) predicate.PromoCode {
  295. return predicate.PromoCode(sql.FieldNotIn(FieldExpiresAt, vs...))
  296. }
  297. // ExpiresAtGT applies the GT predicate on the "expires_at" field.
  298. func ExpiresAtGT(v time.Time) predicate.PromoCode {
  299. return predicate.PromoCode(sql.FieldGT(FieldExpiresAt, v))
  300. }
  301. // ExpiresAtGTE applies the GTE predicate on the "expires_at" field.
  302. func ExpiresAtGTE(v time.Time) predicate.PromoCode {
  303. return predicate.PromoCode(sql.FieldGTE(FieldExpiresAt, v))
  304. }
  305. // ExpiresAtLT applies the LT predicate on the "expires_at" field.
  306. func ExpiresAtLT(v time.Time) predicate.PromoCode {
  307. return predicate.PromoCode(sql.FieldLT(FieldExpiresAt, v))
  308. }
  309. // ExpiresAtLTE applies the LTE predicate on the "expires_at" field.
  310. func ExpiresAtLTE(v time.Time) predicate.PromoCode {
  311. return predicate.PromoCode(sql.FieldLTE(FieldExpiresAt, v))
  312. }
  313. // ExpiresAtIsNil applies the IsNil predicate on the "expires_at" field.
  314. func ExpiresAtIsNil() predicate.PromoCode {
  315. return predicate.PromoCode(sql.FieldIsNull(FieldExpiresAt))
  316. }
  317. // ExpiresAtNotNil applies the NotNil predicate on the "expires_at" field.
  318. func ExpiresAtNotNil() predicate.PromoCode {
  319. return predicate.PromoCode(sql.FieldNotNull(FieldExpiresAt))
  320. }
  321. // NotesEQ applies the EQ predicate on the "notes" field.
  322. func NotesEQ(v string) predicate.PromoCode {
  323. return predicate.PromoCode(sql.FieldEQ(FieldNotes, v))
  324. }
  325. // NotesNEQ applies the NEQ predicate on the "notes" field.
  326. func NotesNEQ(v string) predicate.PromoCode {
  327. return predicate.PromoCode(sql.FieldNEQ(FieldNotes, v))
  328. }
  329. // NotesIn applies the In predicate on the "notes" field.
  330. func NotesIn(vs ...string) predicate.PromoCode {
  331. return predicate.PromoCode(sql.FieldIn(FieldNotes, vs...))
  332. }
  333. // NotesNotIn applies the NotIn predicate on the "notes" field.
  334. func NotesNotIn(vs ...string) predicate.PromoCode {
  335. return predicate.PromoCode(sql.FieldNotIn(FieldNotes, vs...))
  336. }
  337. // NotesGT applies the GT predicate on the "notes" field.
  338. func NotesGT(v string) predicate.PromoCode {
  339. return predicate.PromoCode(sql.FieldGT(FieldNotes, v))
  340. }
  341. // NotesGTE applies the GTE predicate on the "notes" field.
  342. func NotesGTE(v string) predicate.PromoCode {
  343. return predicate.PromoCode(sql.FieldGTE(FieldNotes, v))
  344. }
  345. // NotesLT applies the LT predicate on the "notes" field.
  346. func NotesLT(v string) predicate.PromoCode {
  347. return predicate.PromoCode(sql.FieldLT(FieldNotes, v))
  348. }
  349. // NotesLTE applies the LTE predicate on the "notes" field.
  350. func NotesLTE(v string) predicate.PromoCode {
  351. return predicate.PromoCode(sql.FieldLTE(FieldNotes, v))
  352. }
  353. // NotesContains applies the Contains predicate on the "notes" field.
  354. func NotesContains(v string) predicate.PromoCode {
  355. return predicate.PromoCode(sql.FieldContains(FieldNotes, v))
  356. }
  357. // NotesHasPrefix applies the HasPrefix predicate on the "notes" field.
  358. func NotesHasPrefix(v string) predicate.PromoCode {
  359. return predicate.PromoCode(sql.FieldHasPrefix(FieldNotes, v))
  360. }
  361. // NotesHasSuffix applies the HasSuffix predicate on the "notes" field.
  362. func NotesHasSuffix(v string) predicate.PromoCode {
  363. return predicate.PromoCode(sql.FieldHasSuffix(FieldNotes, v))
  364. }
  365. // NotesIsNil applies the IsNil predicate on the "notes" field.
  366. func NotesIsNil() predicate.PromoCode {
  367. return predicate.PromoCode(sql.FieldIsNull(FieldNotes))
  368. }
  369. // NotesNotNil applies the NotNil predicate on the "notes" field.
  370. func NotesNotNil() predicate.PromoCode {
  371. return predicate.PromoCode(sql.FieldNotNull(FieldNotes))
  372. }
  373. // NotesEqualFold applies the EqualFold predicate on the "notes" field.
  374. func NotesEqualFold(v string) predicate.PromoCode {
  375. return predicate.PromoCode(sql.FieldEqualFold(FieldNotes, v))
  376. }
  377. // NotesContainsFold applies the ContainsFold predicate on the "notes" field.
  378. func NotesContainsFold(v string) predicate.PromoCode {
  379. return predicate.PromoCode(sql.FieldContainsFold(FieldNotes, v))
  380. }
  381. // CreatedAtEQ applies the EQ predicate on the "created_at" field.
  382. func CreatedAtEQ(v time.Time) predicate.PromoCode {
  383. return predicate.PromoCode(sql.FieldEQ(FieldCreatedAt, v))
  384. }
  385. // CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
  386. func CreatedAtNEQ(v time.Time) predicate.PromoCode {
  387. return predicate.PromoCode(sql.FieldNEQ(FieldCreatedAt, v))
  388. }
  389. // CreatedAtIn applies the In predicate on the "created_at" field.
  390. func CreatedAtIn(vs ...time.Time) predicate.PromoCode {
  391. return predicate.PromoCode(sql.FieldIn(FieldCreatedAt, vs...))
  392. }
  393. // CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
  394. func CreatedAtNotIn(vs ...time.Time) predicate.PromoCode {
  395. return predicate.PromoCode(sql.FieldNotIn(FieldCreatedAt, vs...))
  396. }
  397. // CreatedAtGT applies the GT predicate on the "created_at" field.
  398. func CreatedAtGT(v time.Time) predicate.PromoCode {
  399. return predicate.PromoCode(sql.FieldGT(FieldCreatedAt, v))
  400. }
  401. // CreatedAtGTE applies the GTE predicate on the "created_at" field.
  402. func CreatedAtGTE(v time.Time) predicate.PromoCode {
  403. return predicate.PromoCode(sql.FieldGTE(FieldCreatedAt, v))
  404. }
  405. // CreatedAtLT applies the LT predicate on the "created_at" field.
  406. func CreatedAtLT(v time.Time) predicate.PromoCode {
  407. return predicate.PromoCode(sql.FieldLT(FieldCreatedAt, v))
  408. }
  409. // CreatedAtLTE applies the LTE predicate on the "created_at" field.
  410. func CreatedAtLTE(v time.Time) predicate.PromoCode {
  411. return predicate.PromoCode(sql.FieldLTE(FieldCreatedAt, v))
  412. }
  413. // UpdatedAtEQ applies the EQ predicate on the "updated_at" field.
  414. func UpdatedAtEQ(v time.Time) predicate.PromoCode {
  415. return predicate.PromoCode(sql.FieldEQ(FieldUpdatedAt, v))
  416. }
  417. // UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.
  418. func UpdatedAtNEQ(v time.Time) predicate.PromoCode {
  419. return predicate.PromoCode(sql.FieldNEQ(FieldUpdatedAt, v))
  420. }
  421. // UpdatedAtIn applies the In predicate on the "updated_at" field.
  422. func UpdatedAtIn(vs ...time.Time) predicate.PromoCode {
  423. return predicate.PromoCode(sql.FieldIn(FieldUpdatedAt, vs...))
  424. }
  425. // UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.
  426. func UpdatedAtNotIn(vs ...time.Time) predicate.PromoCode {
  427. return predicate.PromoCode(sql.FieldNotIn(FieldUpdatedAt, vs...))
  428. }
  429. // UpdatedAtGT applies the GT predicate on the "updated_at" field.
  430. func UpdatedAtGT(v time.Time) predicate.PromoCode {
  431. return predicate.PromoCode(sql.FieldGT(FieldUpdatedAt, v))
  432. }
  433. // UpdatedAtGTE applies the GTE predicate on the "updated_at" field.
  434. func UpdatedAtGTE(v time.Time) predicate.PromoCode {
  435. return predicate.PromoCode(sql.FieldGTE(FieldUpdatedAt, v))
  436. }
  437. // UpdatedAtLT applies the LT predicate on the "updated_at" field.
  438. func UpdatedAtLT(v time.Time) predicate.PromoCode {
  439. return predicate.PromoCode(sql.FieldLT(FieldUpdatedAt, v))
  440. }
  441. // UpdatedAtLTE applies the LTE predicate on the "updated_at" field.
  442. func UpdatedAtLTE(v time.Time) predicate.PromoCode {
  443. return predicate.PromoCode(sql.FieldLTE(FieldUpdatedAt, v))
  444. }
  445. // HasUsageRecords applies the HasEdge predicate on the "usage_records" edge.
  446. func HasUsageRecords() predicate.PromoCode {
  447. return predicate.PromoCode(func(s *sql.Selector) {
  448. step := sqlgraph.NewStep(
  449. sqlgraph.From(Table, FieldID),
  450. sqlgraph.Edge(sqlgraph.O2M, false, UsageRecordsTable, UsageRecordsColumn),
  451. )
  452. sqlgraph.HasNeighbors(s, step)
  453. })
  454. }
  455. // HasUsageRecordsWith applies the HasEdge predicate on the "usage_records" edge with a given conditions (other predicates).
  456. func HasUsageRecordsWith(preds ...predicate.PromoCodeUsage) predicate.PromoCode {
  457. return predicate.PromoCode(func(s *sql.Selector) {
  458. step := newUsageRecordsStep()
  459. sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
  460. for _, p := range preds {
  461. p(s)
  462. }
  463. })
  464. })
  465. }
  466. // And groups predicates with the AND operator between them.
  467. func And(predicates ...predicate.PromoCode) predicate.PromoCode {
  468. return predicate.PromoCode(sql.AndPredicates(predicates...))
  469. }
  470. // Or groups predicates with the OR operator between them.
  471. func Or(predicates ...predicate.PromoCode) predicate.PromoCode {
  472. return predicate.PromoCode(sql.OrPredicates(predicates...))
  473. }
  474. // Not applies the not operator on the given predicate.
  475. func Not(p predicate.PromoCode) predicate.PromoCode {
  476. return predicate.PromoCode(sql.NotPredicates(p))
  477. }