@medusajs/loyalty-plugin 2.22.4 → 2.22.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (238) hide show
  1. package/CHANGELOG.md +432 -0
  2. package/package.json +20 -20
  3. package/.medusa/server/src/admin/index.js +0 -47854
  4. package/.medusa/server/src/admin/index.mjs +0 -47836
  5. package/.medusa/server/src/api/admin/gift-cards/[id]/orders/route.d.ts +0 -2
  6. package/.medusa/server/src/api/admin/gift-cards/[id]/orders/route.js +0 -28
  7. package/.medusa/server/src/api/admin/gift-cards/[id]/route.d.ts +0 -4
  8. package/.medusa/server/src/api/admin/gift-cards/[id]/route.js +0 -41
  9. package/.medusa/server/src/api/admin/gift-cards/middlewares.d.ts +0 -2
  10. package/.medusa/server/src/api/admin/gift-cards/middlewares.js +0 -82
  11. package/.medusa/server/src/api/admin/gift-cards/query-config.d.ts +0 -14
  12. package/.medusa/server/src/api/admin/gift-cards/query-config.js +0 -32
  13. package/.medusa/server/src/api/admin/gift-cards/route.d.ts +0 -4
  14. package/.medusa/server/src/api/admin/gift-cards/route.js +0 -42
  15. package/.medusa/server/src/api/admin/gift-cards/validators.d.ts +0 -139
  16. package/.medusa/server/src/api/admin/gift-cards/validators.js +0 -56
  17. package/.medusa/server/src/api/admin/store-credit-accounts/[id]/credit/route.d.ts +0 -3
  18. package/.medusa/server/src/api/admin/store-credit-accounts/[id]/credit/route.js +0 -30
  19. package/.medusa/server/src/api/admin/store-credit-accounts/[id]/debit/route.d.ts +0 -3
  20. package/.medusa/server/src/api/admin/store-credit-accounts/[id]/debit/route.js +0 -30
  21. package/.medusa/server/src/api/admin/store-credit-accounts/[id]/route.d.ts +0 -3
  22. package/.medusa/server/src/api/admin/store-credit-accounts/[id]/route.js +0 -19
  23. package/.medusa/server/src/api/admin/store-credit-accounts/[id]/transactions/route.d.ts +0 -3
  24. package/.medusa/server/src/api/admin/store-credit-accounts/[id]/transactions/route.js +0 -23
  25. package/.medusa/server/src/api/admin/store-credit-accounts/middlewares.d.ts +0 -2
  26. package/.medusa/server/src/api/admin/store-credit-accounts/middlewares.js +0 -92
  27. package/.medusa/server/src/api/admin/store-credit-accounts/query-config.d.ts +0 -18
  28. package/.medusa/server/src/api/admin/store-credit-accounts/query-config.js +0 -44
  29. package/.medusa/server/src/api/admin/store-credit-accounts/route.d.ts +0 -4
  30. package/.medusa/server/src/api/admin/store-credit-accounts/route.js +0 -52
  31. package/.medusa/server/src/api/admin/store-credit-accounts/validators.d.ts +0 -147
  32. package/.medusa/server/src/api/admin/store-credit-accounts/validators.js +0 -49
  33. package/.medusa/server/src/api/middlewares.d.ts +0 -2
  34. package/.medusa/server/src/api/middlewares.js +0 -25
  35. package/.medusa/server/src/api/store/carts/[id]/gift-cards/route.d.ts +0 -5
  36. package/.medusa/server/src/api/store/carts/[id]/gift-cards/route.js +0 -43
  37. package/.medusa/server/src/api/store/carts/[id]/store-credits/route.d.ts +0 -4
  38. package/.medusa/server/src/api/store/carts/[id]/store-credits/route.js +0 -25
  39. package/.medusa/server/src/api/store/carts/middlewares.d.ts +0 -2
  40. package/.medusa/server/src/api/store/carts/middlewares.js +0 -35
  41. package/.medusa/server/src/api/store/carts/query-config.d.ts +0 -5
  42. package/.medusa/server/src/api/store/carts/query-config.js +0 -14
  43. package/.medusa/server/src/api/store/carts/validators.d.ts +0 -13
  44. package/.medusa/server/src/api/store/carts/validators.js +0 -14
  45. package/.medusa/server/src/api/store/gift-cards/[idOrCode]/route.d.ts +0 -3
  46. package/.medusa/server/src/api/store/gift-cards/[idOrCode]/route.js +0 -24
  47. package/.medusa/server/src/api/store/gift-cards/middlewares.d.ts +0 -2
  48. package/.medusa/server/src/api/store/gift-cards/middlewares.js +0 -16
  49. package/.medusa/server/src/api/store/gift-cards/query-config.d.ts +0 -14
  50. package/.medusa/server/src/api/store/gift-cards/query-config.js +0 -73
  51. package/.medusa/server/src/api/store/gift-cards/validators.d.ts +0 -7
  52. package/.medusa/server/src/api/store/gift-cards/validators.js +0 -8
  53. package/.medusa/server/src/api/store/store-credit-accounts/[id]/route.d.ts +0 -3
  54. package/.medusa/server/src/api/store/store-credit-accounts/[id]/route.js +0 -31
  55. package/.medusa/server/src/api/store/store-credit-accounts/claim/route.d.ts +0 -3
  56. package/.medusa/server/src/api/store/store-credit-accounts/claim/route.js +0 -25
  57. package/.medusa/server/src/api/store/store-credit-accounts/middlewares.d.ts +0 -2
  58. package/.medusa/server/src/api/store/store-credit-accounts/middlewares.js +0 -36
  59. package/.medusa/server/src/api/store/store-credit-accounts/query-config.d.ts +0 -14
  60. package/.medusa/server/src/api/store/store-credit-accounts/query-config.js +0 -51
  61. package/.medusa/server/src/api/store/store-credit-accounts/route.d.ts +0 -3
  62. package/.medusa/server/src/api/store/store-credit-accounts/route.js +0 -40
  63. package/.medusa/server/src/api/store/store-credit-accounts/validators.d.ts +0 -44
  64. package/.medusa/server/src/api/store/store-credit-accounts/validators.js +0 -19
  65. package/.medusa/server/src/links/cart-gift-cards-link.d.ts +0 -2
  66. package/.medusa/server/src/links/cart-gift-cards-link.js +0 -13
  67. package/.medusa/server/src/links/customer-store-credit-account-link.d.ts +0 -1
  68. package/.medusa/server/src/links/customer-store-credit-account-link.js +0 -13
  69. package/.medusa/server/src/links/gift-card-store-credit.d.ts +0 -2
  70. package/.medusa/server/src/links/gift-card-store-credit.js +0 -10
  71. package/.medusa/server/src/links/order-gift-cards-link.d.ts +0 -2
  72. package/.medusa/server/src/links/order-gift-cards-link.js +0 -13
  73. package/.medusa/server/src/links/order-line-item-gift-card-link.d.ts +0 -1
  74. package/.medusa/server/src/links/order-line-item-gift-card-link.js +0 -19
  75. package/.medusa/server/src/migration-scripts/create-loyalty-rbac-policies.d.ts +0 -6
  76. package/.medusa/server/src/migration-scripts/create-loyalty-rbac-policies.js +0 -30
  77. package/.medusa/server/src/modules/loyalty/index.d.ts +0 -21
  78. package/.medusa/server/src/modules/loyalty/index.js +0 -12
  79. package/.medusa/server/src/modules/loyalty/migrations/Migration20250123130553.d.ts +0 -5
  80. package/.medusa/server/src/modules/loyalty/migrations/Migration20250123130553.js +0 -17
  81. package/.medusa/server/src/modules/loyalty/migrations/Migration20250127174331.d.ts +0 -5
  82. package/.medusa/server/src/modules/loyalty/migrations/Migration20250127174331.js +0 -19
  83. package/.medusa/server/src/modules/loyalty/migrations/Migration20250206141026.d.ts +0 -5
  84. package/.medusa/server/src/modules/loyalty/migrations/Migration20250206141026.js +0 -19
  85. package/.medusa/server/src/modules/loyalty/migrations/Migration20250206141429.d.ts +0 -5
  86. package/.medusa/server/src/modules/loyalty/migrations/Migration20250206141429.js +0 -14
  87. package/.medusa/server/src/modules/loyalty/migrations/Migration20250206144714.d.ts +0 -5
  88. package/.medusa/server/src/modules/loyalty/migrations/Migration20250206144714.js +0 -14
  89. package/.medusa/server/src/modules/loyalty/migrations/Migration20250326095923.d.ts +0 -5
  90. package/.medusa/server/src/modules/loyalty/migrations/Migration20250326095923.js +0 -16
  91. package/.medusa/server/src/modules/loyalty/migrations/Migration20250617080328.d.ts +0 -5
  92. package/.medusa/server/src/modules/loyalty/migrations/Migration20250617080328.js +0 -20
  93. package/.medusa/server/src/modules/loyalty/models/gift-card.d.ts +0 -18
  94. package/.medusa/server/src/modules/loyalty/models/gift-card.js +0 -18
  95. package/.medusa/server/src/modules/loyalty/models/index.d.ts +0 -1
  96. package/.medusa/server/src/modules/loyalty/models/index.js +0 -9
  97. package/.medusa/server/src/modules/loyalty/service.d.ts +0 -25
  98. package/.medusa/server/src/modules/loyalty/service.js +0 -20
  99. package/.medusa/server/src/modules/store-credit/index.d.ts +0 -5
  100. package/.medusa/server/src/modules/store-credit/index.js +0 -12
  101. package/.medusa/server/src/modules/store-credit/migrations/Migration20250129115518.d.ts +0 -5
  102. package/.medusa/server/src/modules/store-credit/migrations/Migration20250129115518.js +0 -16
  103. package/.medusa/server/src/modules/store-credit/migrations/Migration20250130213237.d.ts +0 -5
  104. package/.medusa/server/src/modules/store-credit/migrations/Migration20250130213237.js +0 -18
  105. package/.medusa/server/src/modules/store-credit/migrations/Migration20250130220640.d.ts +0 -5
  106. package/.medusa/server/src/modules/store-credit/migrations/Migration20250130220640.js +0 -19
  107. package/.medusa/server/src/modules/store-credit/migrations/Migration20250131205753.d.ts +0 -5
  108. package/.medusa/server/src/modules/store-credit/migrations/Migration20250131205753.js +0 -14
  109. package/.medusa/server/src/modules/store-credit/migrations/Migration20250520081315.d.ts +0 -5
  110. package/.medusa/server/src/modules/store-credit/migrations/Migration20250520081315.js +0 -16
  111. package/.medusa/server/src/modules/store-credit/migrations/Migration20250626081315.d.ts +0 -5
  112. package/.medusa/server/src/modules/store-credit/migrations/Migration20250626081315.js +0 -16
  113. package/.medusa/server/src/modules/store-credit/migrations/Migration20250722080351.d.ts +0 -5
  114. package/.medusa/server/src/modules/store-credit/migrations/Migration20250722080351.js +0 -27
  115. package/.medusa/server/src/modules/store-credit/models/account-transaction.d.ts +0 -28
  116. package/.medusa/server/src/modules/store-credit/models/account-transaction.js +0 -21
  117. package/.medusa/server/src/modules/store-credit/models/index.d.ts +0 -2
  118. package/.medusa/server/src/modules/store-credit/models/index.js +0 -11
  119. package/.medusa/server/src/modules/store-credit/models/store-credit-account.d.ts +0 -27
  120. package/.medusa/server/src/modules/store-credit/models/store-credit-account.js +0 -27
  121. package/.medusa/server/src/modules/store-credit/service.d.ts +0 -56
  122. package/.medusa/server/src/modules/store-credit/service.js +0 -322
  123. package/.medusa/server/src/subscribers/create-gift-card.d.ts +0 -5
  124. package/.medusa/server/src/subscribers/create-gift-card.js +0 -53
  125. package/.medusa/server/src/types/cart/index.d.ts +0 -12
  126. package/.medusa/server/src/types/cart/index.js +0 -3
  127. package/.medusa/server/src/types/http/gift-card.d.ts +0 -42
  128. package/.medusa/server/src/types/http/gift-card.js +0 -3
  129. package/.medusa/server/src/types/http/index.d.ts +0 -3
  130. package/.medusa/server/src/types/http/index.js +0 -20
  131. package/.medusa/server/src/types/http/store-credit-account.d.ts +0 -71
  132. package/.medusa/server/src/types/http/store-credit-account.js +0 -3
  133. package/.medusa/server/src/types/http/transaction.d.ts +0 -19
  134. package/.medusa/server/src/types/http/transaction.js +0 -3
  135. package/.medusa/server/src/types/index.d.ts +0 -5
  136. package/.medusa/server/src/types/index.js +0 -22
  137. package/.medusa/server/src/types/loyalty/index.d.ts +0 -3
  138. package/.medusa/server/src/types/loyalty/index.js +0 -20
  139. package/.medusa/server/src/types/loyalty/module.d.ts +0 -166
  140. package/.medusa/server/src/types/loyalty/module.js +0 -12
  141. package/.medusa/server/src/types/loyalty/service.d.ts +0 -169
  142. package/.medusa/server/src/types/loyalty/service.js +0 -3
  143. package/.medusa/server/src/types/loyalty/workflows.d.ts +0 -3
  144. package/.medusa/server/src/types/loyalty/workflows.js +0 -3
  145. package/.medusa/server/src/types/modules.d.ts +0 -6
  146. package/.medusa/server/src/types/modules.js +0 -12
  147. package/.medusa/server/src/types/rbac.d.ts +0 -7
  148. package/.medusa/server/src/types/rbac.js +0 -8
  149. package/.medusa/server/src/types/store-credit/index.d.ts +0 -2
  150. package/.medusa/server/src/types/store-credit/index.js +0 -19
  151. package/.medusa/server/src/types/store-credit/module.d.ts +0 -315
  152. package/.medusa/server/src/types/store-credit/module.js +0 -13
  153. package/.medusa/server/src/types/store-credit/service.d.ts +0 -325
  154. package/.medusa/server/src/types/store-credit/service.js +0 -3
  155. package/.medusa/server/src/utils/__tests__/code-generator.spec.d.ts +0 -1
  156. package/.medusa/server/src/utils/__tests__/code-generator.spec.js +0 -30
  157. package/.medusa/server/src/utils/__tests__/gift-card.spec.d.ts +0 -1
  158. package/.medusa/server/src/utils/__tests__/gift-card.spec.js +0 -23
  159. package/.medusa/server/src/utils/code-generator.d.ts +0 -1
  160. package/.medusa/server/src/utils/code-generator.js +0 -30
  161. package/.medusa/server/src/utils/gift-card.d.ts +0 -17
  162. package/.medusa/server/src/utils/gift-card.js +0 -25
  163. package/.medusa/server/src/workflows/carts/index.d.ts +0 -5
  164. package/.medusa/server/src/workflows/carts/index.js +0 -22
  165. package/.medusa/server/src/workflows/carts/steps/validate-gift-card-balances.d.ts +0 -37
  166. package/.medusa/server/src/workflows/carts/steps/validate-gift-card-balances.js +0 -36
  167. package/.medusa/server/src/workflows/carts/workflows/__tests__/validate-gift-card-expiry.spec.d.ts +0 -1
  168. package/.medusa/server/src/workflows/carts/workflows/__tests__/validate-gift-card-expiry.spec.js +0 -94
  169. package/.medusa/server/src/workflows/carts/workflows/add-gift-card-to-cart.d.ts +0 -136
  170. package/.medusa/server/src/workflows/carts/workflows/add-gift-card-to-cart.js +0 -204
  171. package/.medusa/server/src/workflows/carts/workflows/add-store-credits-to-cart.d.ts +0 -136
  172. package/.medusa/server/src/workflows/carts/workflows/add-store-credits-to-cart.js +0 -161
  173. package/.medusa/server/src/workflows/carts/workflows/confirm-cart-credit-lines.d.ts +0 -94
  174. package/.medusa/server/src/workflows/carts/workflows/confirm-cart-credit-lines.js +0 -139
  175. package/.medusa/server/src/workflows/carts/workflows/refresh-cart-gift-cards.d.ts +0 -30
  176. package/.medusa/server/src/workflows/carts/workflows/refresh-cart-gift-cards.js +0 -158
  177. package/.medusa/server/src/workflows/carts/workflows/remove-gift-cart-from-cart.d.ts +0 -103
  178. package/.medusa/server/src/workflows/carts/workflows/remove-gift-cart-from-cart.js +0 -124
  179. package/.medusa/server/src/workflows/common/steps/validate-presence-of.d.ts +0 -29
  180. package/.medusa/server/src/workflows/common/steps/validate-presence-of.js +0 -22
  181. package/.medusa/server/src/workflows/gift-cards/index.d.ts +0 -9
  182. package/.medusa/server/src/workflows/gift-cards/index.js +0 -26
  183. package/.medusa/server/src/workflows/gift-cards/steps/create-gift-cards.d.ts +0 -20
  184. package/.medusa/server/src/workflows/gift-cards/steps/create-gift-cards.js +0 -39
  185. package/.medusa/server/src/workflows/gift-cards/steps/delete-gift-cards.d.ts +0 -17
  186. package/.medusa/server/src/workflows/gift-cards/steps/delete-gift-cards.js +0 -24
  187. package/.medusa/server/src/workflows/gift-cards/steps/retrieve-gift-card-balance.d.ts +0 -32
  188. package/.medusa/server/src/workflows/gift-cards/steps/retrieve-gift-card-balance.js +0 -34
  189. package/.medusa/server/src/workflows/gift-cards/steps/update-gift-cards.d.ts +0 -19
  190. package/.medusa/server/src/workflows/gift-cards/steps/update-gift-cards.js +0 -41
  191. package/.medusa/server/src/workflows/gift-cards/workflows/claim-gift-card.d.ts +0 -65
  192. package/.medusa/server/src/workflows/gift-cards/workflows/claim-gift-card.js +0 -101
  193. package/.medusa/server/src/workflows/gift-cards/workflows/create-gift-cards.d.ts +0 -36
  194. package/.medusa/server/src/workflows/gift-cards/workflows/create-gift-cards.js +0 -88
  195. package/.medusa/server/src/workflows/gift-cards/workflows/delete-gift-card.d.ts +0 -28
  196. package/.medusa/server/src/workflows/gift-cards/workflows/delete-gift-card.js +0 -34
  197. package/.medusa/server/src/workflows/gift-cards/workflows/redeem-gift-card.d.ts +0 -60
  198. package/.medusa/server/src/workflows/gift-cards/workflows/redeem-gift-card.js +0 -129
  199. package/.medusa/server/src/workflows/gift-cards/workflows/update-gift-cards.d.ts +0 -28
  200. package/.medusa/server/src/workflows/gift-cards/workflows/update-gift-cards.js +0 -31
  201. package/.medusa/server/src/workflows/hooks/after-order-created.d.ts +0 -1
  202. package/.medusa/server/src/workflows/hooks/after-order-created.js +0 -30
  203. package/.medusa/server/src/workflows/hooks/after-order-credit-lines-created.d.ts +0 -1
  204. package/.medusa/server/src/workflows/hooks/after-order-credit-lines-created.js +0 -31
  205. package/.medusa/server/src/workflows/hooks/before-payment-collection-refresh.d.ts +0 -1
  206. package/.medusa/server/src/workflows/hooks/before-payment-collection-refresh.js +0 -26
  207. package/.medusa/server/src/workflows/hooks/complete-cart-before-payment-authorization.d.ts +0 -1
  208. package/.medusa/server/src/workflows/hooks/complete-cart-before-payment-authorization.js +0 -27
  209. package/.medusa/server/src/workflows/index.d.ts +0 -3
  210. package/.medusa/server/src/workflows/index.js +0 -20
  211. package/.medusa/server/src/workflows/orders/index.d.ts +0 -2
  212. package/.medusa/server/src/workflows/orders/index.js +0 -19
  213. package/.medusa/server/src/workflows/orders/workflows/link-gift-cards-to-order.d.ts +0 -34
  214. package/.medusa/server/src/workflows/orders/workflows/link-gift-cards-to-order.js +0 -75
  215. package/.medusa/server/src/workflows/orders/workflows/refund-credit-lines.d.ts +0 -88
  216. package/.medusa/server/src/workflows/orders/workflows/refund-credit-lines.js +0 -131
  217. package/.medusa/server/src/workflows/store-credit/index.d.ts +0 -9
  218. package/.medusa/server/src/workflows/store-credit/index.js +0 -26
  219. package/.medusa/server/src/workflows/store-credit/steps/create-store-credit-accounts.d.ts +0 -19
  220. package/.medusa/server/src/workflows/store-credit/steps/create-store-credit-accounts.js +0 -37
  221. package/.medusa/server/src/workflows/store-credit/steps/credit-account.d.ts +0 -20
  222. package/.medusa/server/src/workflows/store-credit/steps/credit-account.js +0 -31
  223. package/.medusa/server/src/workflows/store-credit/steps/debit-account.d.ts +0 -20
  224. package/.medusa/server/src/workflows/store-credit/steps/debit-account.js +0 -31
  225. package/.medusa/server/src/workflows/store-credit/workflows/claim-store-credit-account.d.ts +0 -91
  226. package/.medusa/server/src/workflows/store-credit/workflows/claim-store-credit-account.js +0 -170
  227. package/.medusa/server/src/workflows/store-credit/workflows/create-store-credit-accounts.d.ts +0 -50
  228. package/.medusa/server/src/workflows/store-credit/workflows/create-store-credit-accounts.js +0 -50
  229. package/.medusa/server/src/workflows/store-credit/workflows/credit-accounts.d.ts +0 -29
  230. package/.medusa/server/src/workflows/store-credit/workflows/credit-accounts.js +0 -32
  231. package/.medusa/server/src/workflows/store-credit/workflows/credit-store-credit-account.d.ts +0 -29
  232. package/.medusa/server/src/workflows/store-credit/workflows/credit-store-credit-account.js +0 -55
  233. package/.medusa/server/src/workflows/store-credit/workflows/debit-accounts.d.ts +0 -29
  234. package/.medusa/server/src/workflows/store-credit/workflows/debit-accounts.js +0 -32
  235. package/.medusa/server/src/workflows/store-credit/workflows/debit-store-credit-account.d.ts +0 -30
  236. package/.medusa/server/src/workflows/store-credit/workflows/debit-store-credit-account.js +0 -56
  237. package/.medusa/server/tailwind.config.d.ts +0 -3
  238. package/.medusa/server/tailwind.config.js +0 -12
@@ -1,12 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const utils_1 = require("@medusajs/framework/utils");
7
- const types_1 = require("../../types");
8
- const service_1 = __importDefault(require("./service"));
9
- exports.default = (0, utils_1.Module)(types_1.PluginModule.LOYALTY, {
10
- service: service_1.default,
11
- });
12
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9sb3lhbHR5L2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEscURBQW1EO0FBQ25ELHVDQUEyQztBQUMzQyx3REFBNkM7QUFFN0Msa0JBQWUsSUFBQSxjQUFNLEVBQUMsb0JBQVksQ0FBQyxPQUFPLEVBQUU7SUFDMUMsT0FBTyxFQUFFLGlCQUFvQjtDQUM5QixDQUFDLENBQUMifQ==
@@ -1,5 +0,0 @@
1
- import { Migration } from "@medusajs/framework/mikro-orm/migrations";
2
- export declare class Migration20250123130553 extends Migration {
3
- up(): Promise<void>;
4
- down(): Promise<void>;
5
- }
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Migration20250123130553 = void 0;
4
- const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
5
- class Migration20250123130553 extends migrations_1.Migration {
6
- async up() {
7
- this.addSql('create table if not exists "loyalty_gift_card" ("id" text not null, "status" text check ("status" in (\'pending\', \'redeemed\')) not null default \'pending\', "value" numeric not null, "code" text not null, "currency_code" text not null, "expires_at" timestamptz null, "line_item_id" text not null, "customer_id" text not null, "note" text null, "metadata" jsonb null, "raw_value" jsonb not null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "loyalty_gift_card_pkey" primary key ("id"));');
8
- this.addSql('CREATE UNIQUE INDEX IF NOT EXISTS "IDX_loyalty_gift_card_code_unique" ON "loyalty_gift_card" (code) WHERE deleted_at IS NULL;');
9
- this.addSql('CREATE INDEX IF NOT EXISTS "IDX_loyalty_gift_card_deleted_at" ON "loyalty_gift_card" (deleted_at) WHERE deleted_at IS NULL;');
10
- this.addSql('CREATE UNIQUE INDEX IF NOT EXISTS "IDX_line_item_id_customer_id" ON "loyalty_gift_card" (line_item_id, customer_id) WHERE deleted_at IS NULL;');
11
- }
12
- async down() {
13
- this.addSql('drop table if exists "loyalty_gift_card" cascade;');
14
- }
15
- }
16
- exports.Migration20250123130553 = Migration20250123130553;
17
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWlncmF0aW9uMjAyNTAxMjMxMzA1NTMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9sb3lhbHR5L21pZ3JhdGlvbnMvTWlncmF0aW9uMjAyNTAxMjMxMzA1NTMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEseUVBQXFFO0FBRXJFLE1BQWEsdUJBQXdCLFNBQVEsc0JBQVM7SUFDcEQsS0FBSyxDQUFDLEVBQUU7UUFDTixJQUFJLENBQUMsTUFBTSxDQUNULHlrQkFBeWtCLENBQzFrQixDQUFDO1FBRUYsSUFBSSxDQUFDLE1BQU0sQ0FDVCwrSEFBK0gsQ0FDaEksQ0FBQztRQUVGLElBQUksQ0FBQyxNQUFNLENBQ1QsNkhBQTZILENBQzlILENBQUM7UUFFRixJQUFJLENBQUMsTUFBTSxDQUNULCtJQUErSSxDQUNoSixDQUFDO0lBQ0osQ0FBQztJQUVELEtBQUssQ0FBQyxJQUFJO1FBQ1IsSUFBSSxDQUFDLE1BQU0sQ0FBQyxtREFBbUQsQ0FBQyxDQUFDO0lBQ25FLENBQUM7Q0FDRjtBQXRCRCwwREFzQkMifQ==
@@ -1,5 +0,0 @@
1
- import { Migration } from "@medusajs/framework/mikro-orm/migrations";
2
- export declare class Migration20250127174331 extends Migration {
3
- up(): Promise<void>;
4
- down(): Promise<void>;
5
- }
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Migration20250127174331 = void 0;
4
- const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
5
- class Migration20250127174331 extends migrations_1.Migration {
6
- async up() {
7
- this.addSql('create table if not exists "loyalty_gift_card_invitation" ("id" text not null, "email" text not null, "code" text not null, "status" text check ("status" in (\'pending\', \'accepted\', \'rejected\')) not null default \'pending\', "expires_at" timestamptz null, "gift_card_id" text not null, "metadata" jsonb null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "loyalty_gift_card_invitation_pkey" primary key ("id"));');
8
- this.addSql('alter table if exists "loyalty_gift_card_invitation" add constraint "loyalty_gift_card_invitation_gift_card_id_unique" unique ("gift_card_id");');
9
- this.addSql('CREATE UNIQUE INDEX IF NOT EXISTS "IDX_loyalty_gift_card_invitation_code_unique" ON "loyalty_gift_card_invitation" (code) WHERE deleted_at IS NULL;');
10
- this.addSql('CREATE INDEX IF NOT EXISTS "IDX_loyalty_gift_card_invitation_gift_card_id" ON "loyalty_gift_card_invitation" (gift_card_id) WHERE deleted_at IS NULL;');
11
- this.addSql('CREATE INDEX IF NOT EXISTS "IDX_loyalty_gift_card_invitation_deleted_at" ON "loyalty_gift_card_invitation" (deleted_at) WHERE deleted_at IS NULL;');
12
- this.addSql('alter table if exists "loyalty_gift_card_invitation" add constraint "loyalty_gift_card_invitation_gift_card_id_foreign" foreign key ("gift_card_id") references "loyalty_gift_card" ("id") on update cascade;');
13
- }
14
- async down() {
15
- this.addSql('drop table if exists "loyalty_gift_card_invitation" cascade;');
16
- }
17
- }
18
- exports.Migration20250127174331 = Migration20250127174331;
19
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWlncmF0aW9uMjAyNTAxMjcxNzQzMzEuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9sb3lhbHR5L21pZ3JhdGlvbnMvTWlncmF0aW9uMjAyNTAxMjcxNzQzMzEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEseUVBQXFFO0FBRXJFLE1BQWEsdUJBQXdCLFNBQVEsc0JBQVM7SUFDcEQsS0FBSyxDQUFDLEVBQUU7UUFDTixJQUFJLENBQUMsTUFBTSxDQUNULGdnQkFBZ2dCLENBQ2pnQixDQUFDO1FBRUYsSUFBSSxDQUFDLE1BQU0sQ0FDVCxpSkFBaUosQ0FDbEosQ0FBQztRQUVGLElBQUksQ0FBQyxNQUFNLENBQ1QscUpBQXFKLENBQ3RKLENBQUM7UUFFRixJQUFJLENBQUMsTUFBTSxDQUNULHVKQUF1SixDQUN4SixDQUFDO1FBRUYsSUFBSSxDQUFDLE1BQU0sQ0FDVCxtSkFBbUosQ0FDcEosQ0FBQztRQUVGLElBQUksQ0FBQyxNQUFNLENBQ1QsK01BQStNLENBQ2hOLENBQUM7SUFDSixDQUFDO0lBRUQsS0FBSyxDQUFDLElBQUk7UUFDUixJQUFJLENBQUMsTUFBTSxDQUFDLDhEQUE4RCxDQUFDLENBQUM7SUFDOUUsQ0FBQztDQUNGO0FBOUJELDBEQThCQyJ9
@@ -1,5 +0,0 @@
1
- import { Migration } from "@medusajs/framework/mikro-orm/migrations";
2
- export declare class Migration20250206141026 extends Migration {
3
- up(): Promise<void>;
4
- down(): Promise<void>;
5
- }
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Migration20250206141026 = void 0;
4
- const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
5
- class Migration20250206141026 extends migrations_1.Migration {
6
- async up() {
7
- this.addSql(`alter table if exists "loyalty_gift_card_invitation" drop constraint if exists "loyalty_gift_card_invitation_gift_card_id_unique";`);
8
- this.addSql(`drop index if exists "loyalty_gift_card_invitation_gift_card_id_unique";`);
9
- this.addSql(`drop index if exists "IDX_loyalty_gift_card_invitation_gift_card_id";`);
10
- this.addSql(`CREATE UNIQUE INDEX IF NOT EXISTS "IDX_loyalty_gift_card_invitation_gift_card_id_unique" ON "loyalty_gift_card_invitation" (gift_card_id) WHERE deleted_at IS NULL;`);
11
- }
12
- async down() {
13
- this.addSql(`drop index if exists "IDX_loyalty_gift_card_invitation_gift_card_id_unique";`);
14
- this.addSql(`alter table if exists "loyalty_gift_card_invitation" add constraint "loyalty_gift_card_invitation_gift_card_id_unique" unique ("gift_card_id");`);
15
- this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_loyalty_gift_card_invitation_gift_card_id" ON "loyalty_gift_card_invitation" (gift_card_id) WHERE deleted_at IS NULL;`);
16
- }
17
- }
18
- exports.Migration20250206141026 = Migration20250206141026;
19
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWlncmF0aW9uMjAyNTAyMDYxNDEwMjYuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9sb3lhbHR5L21pZ3JhdGlvbnMvTWlncmF0aW9uMjAyNTAyMDYxNDEwMjYudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEseUVBQXFFO0FBRXJFLE1BQWEsdUJBQXdCLFNBQVEsc0JBQVM7SUFDM0MsS0FBSyxDQUFDLEVBQUU7UUFDZixJQUFJLENBQUMsTUFBTSxDQUNULG9JQUFvSSxDQUNySSxDQUFDO1FBQ0YsSUFBSSxDQUFDLE1BQU0sQ0FDVCwwRUFBMEUsQ0FDM0UsQ0FBQztRQUNGLElBQUksQ0FBQyxNQUFNLENBQ1QsdUVBQXVFLENBQ3hFLENBQUM7UUFFRixJQUFJLENBQUMsTUFBTSxDQUNULHFLQUFxSyxDQUN0SyxDQUFDO0lBQ0osQ0FBQztJQUVRLEtBQUssQ0FBQyxJQUFJO1FBQ2pCLElBQUksQ0FBQyxNQUFNLENBQ1QsOEVBQThFLENBQy9FLENBQUM7UUFFRixJQUFJLENBQUMsTUFBTSxDQUNULGlKQUFpSixDQUNsSixDQUFDO1FBQ0YsSUFBSSxDQUFDLE1BQU0sQ0FDVCx1SkFBdUosQ0FDeEosQ0FBQztJQUNKLENBQUM7Q0FDRjtBQTdCRCwwREE2QkMifQ==
@@ -1,5 +0,0 @@
1
- import { Migration } from "@medusajs/framework/mikro-orm/migrations";
2
- export declare class Migration20250206141429 extends Migration {
3
- up(): Promise<void>;
4
- down(): Promise<void>;
5
- }
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Migration20250206141429 = void 0;
4
- const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
5
- class Migration20250206141429 extends migrations_1.Migration {
6
- async up() {
7
- this.addSql(`drop index if exists "IDX_line_item_id_customer_id";`);
8
- }
9
- async down() {
10
- this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_line_item_id_customer_id" ON "loyalty_gift_card" (line_item_id, customer_id) WHERE deleted_at IS NULL;`);
11
- }
12
- }
13
- exports.Migration20250206141429 = Migration20250206141429;
14
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWlncmF0aW9uMjAyNTAyMDYxNDE0MjkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9sb3lhbHR5L21pZ3JhdGlvbnMvTWlncmF0aW9uMjAyNTAyMDYxNDE0MjkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEseUVBQXFFO0FBRXJFLE1BQWEsdUJBQXdCLFNBQVEsc0JBQVM7SUFDM0MsS0FBSyxDQUFDLEVBQUU7UUFDZixJQUFJLENBQUMsTUFBTSxDQUFDLHNEQUFzRCxDQUFDLENBQUM7SUFDdEUsQ0FBQztJQUVRLEtBQUssQ0FBQyxJQUFJO1FBQ2pCLElBQUksQ0FBQyxNQUFNLENBQ1Qsd0lBQXdJLENBQ3pJLENBQUM7SUFDSixDQUFDO0NBQ0Y7QUFWRCwwREFVQyJ9
@@ -1,5 +0,0 @@
1
- import { Migration } from "@medusajs/framework/mikro-orm/migrations";
2
- export declare class Migration20250206144714 extends Migration {
3
- up(): Promise<void>;
4
- down(): Promise<void>;
5
- }
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Migration20250206144714 = void 0;
4
- const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
5
- class Migration20250206144714 extends migrations_1.Migration {
6
- async up() {
7
- this.addSql(`alter table if exists "loyalty_gift_card" add column if not exists "reference_id" text null, add column if not exists "reference" text null;`);
8
- }
9
- async down() {
10
- this.addSql(`alter table if exists "loyalty_gift_card" drop column if exists "reference_id", drop column if exists "reference";`);
11
- }
12
- }
13
- exports.Migration20250206144714 = Migration20250206144714;
14
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWlncmF0aW9uMjAyNTAyMDYxNDQ3MTQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9sb3lhbHR5L21pZ3JhdGlvbnMvTWlncmF0aW9uMjAyNTAyMDYxNDQ3MTQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEseUVBQXFFO0FBRXJFLE1BQWEsdUJBQXdCLFNBQVEsc0JBQVM7SUFDM0MsS0FBSyxDQUFDLEVBQUU7UUFDZixJQUFJLENBQUMsTUFBTSxDQUNULDhJQUE4SSxDQUMvSSxDQUFDO0lBQ0osQ0FBQztJQUVRLEtBQUssQ0FBQyxJQUFJO1FBQ2pCLElBQUksQ0FBQyxNQUFNLENBQ1Qsb0hBQW9ILENBQ3JILENBQUM7SUFDSixDQUFDO0NBQ0Y7QUFaRCwwREFZQyJ9
@@ -1,5 +0,0 @@
1
- import { Migration } from "@medusajs/framework/mikro-orm/migrations";
2
- export declare class Migration20250326095923 extends Migration {
3
- up(): Promise<void>;
4
- down(): Promise<void>;
5
- }
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Migration20250326095923 = void 0;
4
- const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
5
- class Migration20250326095923 extends migrations_1.Migration {
6
- async up() {
7
- this.addSql(`alter table if exists "loyalty_gift_card" alter column "line_item_id" type text using ("line_item_id"::text);`);
8
- this.addSql(`alter table if exists "loyalty_gift_card" alter column "line_item_id" drop not null;`);
9
- }
10
- async down() {
11
- this.addSql(`alter table if exists "loyalty_gift_card" alter column "line_item_id" type text using ("line_item_id"::text);`);
12
- this.addSql(`alter table if exists "loyalty_gift_card" alter column "line_item_id" set not null;`);
13
- }
14
- }
15
- exports.Migration20250326095923 = Migration20250326095923;
16
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWlncmF0aW9uMjAyNTAzMjYwOTU5MjMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9sb3lhbHR5L21pZ3JhdGlvbnMvTWlncmF0aW9uMjAyNTAzMjYwOTU5MjMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEseUVBQXFFO0FBRXJFLE1BQWEsdUJBQXdCLFNBQVEsc0JBQVM7SUFFM0MsS0FBSyxDQUFDLEVBQUU7UUFDZixJQUFJLENBQUMsTUFBTSxDQUFDLCtHQUErRyxDQUFDLENBQUM7UUFDN0gsSUFBSSxDQUFDLE1BQU0sQ0FBQyxzRkFBc0YsQ0FBQyxDQUFDO0lBQ3RHLENBQUM7SUFFUSxLQUFLLENBQUMsSUFBSTtRQUNqQixJQUFJLENBQUMsTUFBTSxDQUFDLCtHQUErRyxDQUFDLENBQUM7UUFDN0gsSUFBSSxDQUFDLE1BQU0sQ0FBQyxxRkFBcUYsQ0FBQyxDQUFDO0lBQ3JHLENBQUM7Q0FFRjtBQVpELDBEQVlDIn0=
@@ -1,5 +0,0 @@
1
- import { Migration } from "@medusajs/framework/mikro-orm/migrations";
2
- export declare class Migration20250617080328 extends Migration {
3
- up(): Promise<void>;
4
- down(): Promise<void>;
5
- }
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Migration20250617080328 = void 0;
4
- const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
5
- class Migration20250617080328 extends migrations_1.Migration {
6
- async up() {
7
- this.addSql(`drop table if exists "loyalty_gift_card_invitation" cascade;`);
8
- this.addSql(`alter table if exists "loyalty_gift_card" drop column if exists "customer_id";`);
9
- }
10
- async down() {
11
- this.addSql(`create table if not exists "loyalty_gift_card_invitation" ("id" text not null, "email" text not null, "code" text not null, "status" text check ("status" in ('pending', 'accepted', 'rejected')) not null default 'pending', "expires_at" timestamptz null, "gift_card_id" text not null, "metadata" jsonb null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "loyalty_gift_card_invitation_pkey" primary key ("id"));`);
12
- this.addSql(`CREATE UNIQUE INDEX IF NOT EXISTS "IDX_loyalty_gift_card_invitation_code_unique" ON "loyalty_gift_card_invitation" (code) WHERE deleted_at IS NULL;`);
13
- this.addSql(`CREATE UNIQUE INDEX IF NOT EXISTS "IDX_loyalty_gift_card_invitation_gift_card_id_unique" ON "loyalty_gift_card_invitation" (gift_card_id) WHERE deleted_at IS NULL;`);
14
- this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_loyalty_gift_card_invitation_deleted_at" ON "loyalty_gift_card_invitation" (deleted_at) WHERE deleted_at IS NULL;`);
15
- this.addSql(`alter table if exists "loyalty_gift_card_invitation" add constraint "loyalty_gift_card_invitation_gift_card_id_foreign" foreign key ("gift_card_id") references "loyalty_gift_card" ("id") on update cascade;`);
16
- this.addSql(`alter table if exists "loyalty_gift_card" add column if not exists "customer_id" text null;`);
17
- }
18
- }
19
- exports.Migration20250617080328 = Migration20250617080328;
20
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWlncmF0aW9uMjAyNTA2MTcwODAzMjguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9sb3lhbHR5L21pZ3JhdGlvbnMvTWlncmF0aW9uMjAyNTA2MTcwODAzMjgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEseUVBQXFFO0FBRXJFLE1BQWEsdUJBQXdCLFNBQVEsc0JBQVM7SUFFM0MsS0FBSyxDQUFDLEVBQUU7UUFDZixJQUFJLENBQUMsTUFBTSxDQUFDLDhEQUE4RCxDQUFDLENBQUM7UUFFNUUsSUFBSSxDQUFDLE1BQU0sQ0FBQyxnRkFBZ0YsQ0FBQyxDQUFDO0lBQ2hHLENBQUM7SUFFUSxLQUFLLENBQUMsSUFBSTtRQUNqQixJQUFJLENBQUMsTUFBTSxDQUFDLHdmQUF3ZixDQUFDLENBQUM7UUFDdGdCLElBQUksQ0FBQyxNQUFNLENBQUMscUpBQXFKLENBQUMsQ0FBQztRQUNuSyxJQUFJLENBQUMsTUFBTSxDQUFDLHFLQUFxSyxDQUFDLENBQUM7UUFDbkwsSUFBSSxDQUFDLE1BQU0sQ0FBQyxtSkFBbUosQ0FBQyxDQUFDO1FBRWpLLElBQUksQ0FBQyxNQUFNLENBQUMsK01BQStNLENBQUMsQ0FBQztRQUU3TixJQUFJLENBQUMsTUFBTSxDQUFDLDZGQUE2RixDQUFDLENBQUM7SUFDN0csQ0FBQztDQUVGO0FBbkJELDBEQW1CQyJ9
@@ -1,18 +0,0 @@
1
- import { GiftCardStatus } from "../../../types";
2
- declare const _default: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
3
- id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
4
- status: import("@medusajs/framework/utils").EnumProperty<typeof GiftCardStatus>;
5
- value: import("@medusajs/framework/utils").BigNumberProperty;
6
- code: import("@medusajs/framework/utils").TextProperty;
7
- currency_code: import("@medusajs/framework/utils").TextProperty;
8
- expires_at: import("@medusajs/framework/utils").NullableModifier<Date, import("@medusajs/framework/utils").DateTimeProperty>;
9
- reference_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
10
- reference: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
11
- line_item_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
12
- note: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
13
- metadata: import("@medusajs/framework/utils").NullableModifier<NoInfer<Record<string, unknown>>, import("@medusajs/framework/utils").JSONProperty<NoInfer<Record<string, unknown>>>>;
14
- }>, {
15
- readonly tableName: "loyalty_gift_card";
16
- readonly name: "GiftCard";
17
- }>;
18
- export default _default;
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const utils_1 = require("@medusajs/framework/utils");
4
- const types_1 = require("../../../types");
5
- exports.default = utils_1.model.define({ tableName: "loyalty_gift_card", name: "GiftCard" }, {
6
- id: utils_1.model.id({ prefix: "gcard" }).primaryKey(),
7
- status: utils_1.model.enum(types_1.GiftCardStatus).default(types_1.GiftCardStatus.PENDING),
8
- value: utils_1.model.bigNumber(),
9
- code: utils_1.model.text().searchable().unique(),
10
- currency_code: utils_1.model.text().searchable(),
11
- expires_at: utils_1.model.dateTime().nullable(),
12
- reference_id: utils_1.model.text().nullable(),
13
- reference: utils_1.model.text().nullable(),
14
- line_item_id: utils_1.model.text().nullable(),
15
- note: utils_1.model.text().nullable(),
16
- metadata: utils_1.model.json().nullable(),
17
- });
18
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2lmdC1jYXJkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL21vZHVsZXMvbG95YWx0eS9tb2RlbHMvZ2lmdC1jYXJkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEscURBQWtEO0FBQ2xELDBDQUFnRDtBQUVoRCxrQkFBZSxhQUFLLENBQUMsTUFBTSxDQUN6QixFQUFFLFNBQVMsRUFBRSxtQkFBbUIsRUFBRSxJQUFJLEVBQUUsVUFBVSxFQUFFLEVBQ3BEO0lBQ0UsRUFBRSxFQUFFLGFBQUssQ0FBQyxFQUFFLENBQUMsRUFBRSxNQUFNLEVBQUUsT0FBTyxFQUFFLENBQUMsQ0FBQyxVQUFVLEVBQUU7SUFDOUMsTUFBTSxFQUFFLGFBQUssQ0FBQyxJQUFJLENBQUMsc0JBQWMsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxzQkFBYyxDQUFDLE9BQU8sQ0FBQztJQUNsRSxLQUFLLEVBQUUsYUFBSyxDQUFDLFNBQVMsRUFBRTtJQUN4QixJQUFJLEVBQUUsYUFBSyxDQUFDLElBQUksRUFBRSxDQUFDLFVBQVUsRUFBRSxDQUFDLE1BQU0sRUFBRTtJQUN4QyxhQUFhLEVBQUUsYUFBSyxDQUFDLElBQUksRUFBRSxDQUFDLFVBQVUsRUFBRTtJQUN4QyxVQUFVLEVBQUUsYUFBSyxDQUFDLFFBQVEsRUFBRSxDQUFDLFFBQVEsRUFBRTtJQUN2QyxZQUFZLEVBQUUsYUFBSyxDQUFDLElBQUksRUFBRSxDQUFDLFFBQVEsRUFBRTtJQUNyQyxTQUFTLEVBQUUsYUFBSyxDQUFDLElBQUksRUFBRSxDQUFDLFFBQVEsRUFBRTtJQUNsQyxZQUFZLEVBQUUsYUFBSyxDQUFDLElBQUksRUFBRSxDQUFDLFFBQVEsRUFBRTtJQUNyQyxJQUFJLEVBQUUsYUFBSyxDQUFDLElBQUksRUFBRSxDQUFDLFFBQVEsRUFBRTtJQUM3QixRQUFRLEVBQUUsYUFBSyxDQUFDLElBQUksRUFBRSxDQUFDLFFBQVEsRUFBRTtDQUNsQyxDQUNGLENBQUMifQ==
@@ -1 +0,0 @@
1
- export { default as GiftCard } from "./gift-card";
@@ -1,9 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.GiftCard = void 0;
7
- var gift_card_1 = require("./gift-card");
8
- Object.defineProperty(exports, "GiftCard", { enumerable: true, get: function () { return __importDefault(gift_card_1).default; } });
9
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9sb3lhbHR5L21vZGVscy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQSx5Q0FBaUQ7QUFBeEMsc0hBQUEsT0FBTyxPQUFZIn0=
@@ -1,25 +0,0 @@
1
- import { LoyaltyPluginOptions } from "../../types";
2
- declare const LoyaltyModuleService_base: import("@medusajs/framework/utils").MedusaServiceReturnType<import("@medusajs/framework/utils").ModelConfigurationsToConfigTemplate<{
3
- readonly GiftCard: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
4
- id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
5
- status: import("@medusajs/framework/utils").EnumProperty<typeof import("../../types").GiftCardStatus>;
6
- value: import("@medusajs/framework/utils").BigNumberProperty;
7
- code: import("@medusajs/framework/utils").TextProperty;
8
- currency_code: import("@medusajs/framework/utils").TextProperty;
9
- expires_at: import("@medusajs/framework/utils").NullableModifier<Date, import("@medusajs/framework/utils").DateTimeProperty>;
10
- reference_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
11
- reference: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
12
- line_item_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
13
- note: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
14
- metadata: import("@medusajs/framework/utils").NullableModifier<NoInfer<Record<string, unknown>>, import("@medusajs/framework/utils").JSONProperty<NoInfer<Record<string, unknown>>>>;
15
- }>, {
16
- readonly tableName: "loyalty_gift_card";
17
- readonly name: "GiftCard";
18
- }>;
19
- }>>;
20
- declare class LoyaltyModuleService extends LoyaltyModuleService_base {
21
- private options_;
22
- constructor(dependencies: Record<string, unknown>, options?: LoyaltyPluginOptions);
23
- getOptions(): Promise<LoyaltyPluginOptions>;
24
- }
25
- export default LoyaltyModuleService;
@@ -1,20 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const utils_1 = require("@medusajs/framework/utils");
7
- const gift_card_1 = __importDefault(require("./models/gift-card"));
8
- class LoyaltyModuleService extends (0, utils_1.MedusaService)({
9
- GiftCard: gift_card_1.default,
10
- }) {
11
- constructor(dependencies, options = {}) {
12
- super(dependencies, options);
13
- this.options_ = options;
14
- }
15
- async getOptions() {
16
- return this.options_;
17
- }
18
- }
19
- exports.default = LoyaltyModuleService;
20
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9tb2R1bGVzL2xveWFsdHkvc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLHFEQUF5RDtBQUV6RCxtRUFBeUM7QUFFekMsTUFBTSxvQkFBcUIsU0FBUSxJQUFBLHFCQUFhLEVBQUM7SUFDL0MsUUFBUSxFQUFSLG1CQUFRO0NBQ1QsQ0FBQztJQUdBLFlBQ0UsWUFBcUMsRUFDckMsVUFBZ0MsRUFBRTtRQUVsQyxLQUFLLENBQUMsWUFBWSxFQUFFLE9BQU8sQ0FBQyxDQUFBO1FBQzVCLElBQUksQ0FBQyxRQUFRLEdBQUcsT0FBTyxDQUFBO0lBQ3pCLENBQUM7SUFDRCxLQUFLLENBQUMsVUFBVTtRQUNkLE9BQU8sSUFBSSxDQUFDLFFBQVEsQ0FBQTtJQUN0QixDQUFDO0NBQ0Y7QUFFRCxrQkFBZSxvQkFBb0IsQ0FBQSJ9
@@ -1,5 +0,0 @@
1
- import StoreCreditService from "./service";
2
- declare const _default: import("@medusajs/types").ModuleExports<typeof StoreCreditService> & {
3
- linkable: Record<string, any>;
4
- };
5
- export default _default;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const utils_1 = require("@medusajs/framework/utils");
7
- const types_1 = require("../../types");
8
- const service_1 = __importDefault(require("./service"));
9
- exports.default = (0, utils_1.Module)(types_1.PluginModule.STORE_CREDIT, {
10
- service: service_1.default,
11
- });
12
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9zdG9yZS1jcmVkaXQvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSxxREFBbUQ7QUFDbkQsdUNBQTJDO0FBQzNDLHdEQUEyQztBQUUzQyxrQkFBZSxJQUFBLGNBQU0sRUFBQyxvQkFBWSxDQUFDLFlBQVksRUFBRTtJQUMvQyxPQUFPLEVBQUUsaUJBQWtCO0NBQzVCLENBQUMsQ0FBQyJ9
@@ -1,5 +0,0 @@
1
- import { Migration } from "@medusajs/framework/mikro-orm/migrations";
2
- export declare class Migration20250129115518 extends Migration {
3
- up(): Promise<void>;
4
- down(): Promise<void>;
5
- }
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Migration20250129115518 = void 0;
4
- const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
5
- class Migration20250129115518 extends migrations_1.Migration {
6
- async up() {
7
- this.addSql('create table if not exists "store_credit_account" ("id" text not null, "currency_code" text not null, "customer_id" text not null, "metadata" jsonb null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "store_credit_account_pkey" primary key ("id"));');
8
- this.addSql('CREATE INDEX IF NOT EXISTS "IDX_store_credit_account_deleted_at" ON "store_credit_account" (deleted_at) WHERE deleted_at IS NULL;');
9
- this.addSql('CREATE UNIQUE INDEX IF NOT EXISTS "IDX_customer_id_currency_code" ON "store_credit_account" (customer_id, currency_code) WHERE deleted_at IS NULL;');
10
- }
11
- async down() {
12
- this.addSql('drop table if exists "store_credit_account" cascade;');
13
- }
14
- }
15
- exports.Migration20250129115518 = Migration20250129115518;
16
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWlncmF0aW9uMjAyNTAxMjkxMTU1MTguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9zdG9yZS1jcmVkaXQvbWlncmF0aW9ucy9NaWdyYXRpb24yMDI1MDEyOTExNTUxOC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSx5RUFBcUU7QUFFckUsTUFBYSx1QkFBd0IsU0FBUSxzQkFBUztJQUNwRCxLQUFLLENBQUMsRUFBRTtRQUNOLElBQUksQ0FBQyxNQUFNLENBQ1Qsd1ZBQXdWLENBQ3pWLENBQUM7UUFFRixJQUFJLENBQUMsTUFBTSxDQUNULG1JQUFtSSxDQUNwSSxDQUFDO1FBRUYsSUFBSSxDQUFDLE1BQU0sQ0FDVCxvSkFBb0osQ0FDckosQ0FBQztJQUNKLENBQUM7SUFFRCxLQUFLLENBQUMsSUFBSTtRQUNSLElBQUksQ0FBQyxNQUFNLENBQUMsc0RBQXNELENBQUMsQ0FBQztJQUN0RSxDQUFDO0NBQ0Y7QUFsQkQsMERBa0JDIn0=
@@ -1,5 +0,0 @@
1
- import { Migration } from "@medusajs/framework/mikro-orm/migrations";
2
- export declare class Migration20250130213237 extends Migration {
3
- up(): Promise<void>;
4
- down(): Promise<void>;
5
- }
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Migration20250130213237 = void 0;
4
- const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
5
- class Migration20250130213237 extends migrations_1.Migration {
6
- async up() {
7
- this.addSql('create table if not exists "store_credit_transaction_group" ("id" text not null, "code" text not null, "account_id" text not null, "metadata" jsonb null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "store_credit_transaction_group_pkey" primary key ("id"));');
8
- this.addSql('CREATE UNIQUE INDEX IF NOT EXISTS "IDX_store_credit_transaction_group_code_unique" ON "store_credit_transaction_group" (code) WHERE deleted_at IS NULL;');
9
- this.addSql('CREATE INDEX IF NOT EXISTS "IDX_store_credit_transaction_group_account_id" ON "store_credit_transaction_group" (account_id) WHERE deleted_at IS NULL;');
10
- this.addSql('CREATE INDEX IF NOT EXISTS "IDX_store_credit_transaction_group_deleted_at" ON "store_credit_transaction_group" (deleted_at) WHERE deleted_at IS NULL;');
11
- this.addSql('alter table if exists "store_credit_transaction_group" add constraint "store_credit_transaction_group_account_id_foreign" foreign key ("account_id") references "store_credit_account" ("id") on update cascade;');
12
- }
13
- async down() {
14
- this.addSql('drop table if exists "store_credit_transaction_group" cascade;');
15
- }
16
- }
17
- exports.Migration20250130213237 = Migration20250130213237;
18
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWlncmF0aW9uMjAyNTAxMzAyMTMyMzcuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9zdG9yZS1jcmVkaXQvbWlncmF0aW9ucy9NaWdyYXRpb24yMDI1MDEzMDIxMzIzNy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSx5RUFBcUU7QUFFckUsTUFBYSx1QkFBd0IsU0FBUSxzQkFBUztJQUNwRCxLQUFLLENBQUMsRUFBRTtRQUNOLElBQUksQ0FBQyxNQUFNLENBQ1Qsa1dBQWtXLENBQ25XLENBQUM7UUFFRixJQUFJLENBQUMsTUFBTSxDQUNULHlKQUF5SixDQUMxSixDQUFDO1FBRUYsSUFBSSxDQUFDLE1BQU0sQ0FDVCx1SkFBdUosQ0FDeEosQ0FBQztRQUVGLElBQUksQ0FBQyxNQUFNLENBQ1QsdUpBQXVKLENBQ3hKLENBQUM7UUFFRixJQUFJLENBQUMsTUFBTSxDQUNULGtOQUFrTixDQUNuTixDQUFDO0lBQ0osQ0FBQztJQUVELEtBQUssQ0FBQyxJQUFJO1FBQ1IsSUFBSSxDQUFDLE1BQU0sQ0FDVCxnRUFBZ0UsQ0FDakUsQ0FBQztJQUNKLENBQUM7Q0FDRjtBQTVCRCwwREE0QkMifQ==
@@ -1,5 +0,0 @@
1
- import { Migration } from "@medusajs/framework/mikro-orm/migrations";
2
- export declare class Migration20250130220640 extends Migration {
3
- up(): Promise<void>;
4
- down(): Promise<void>;
5
- }
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Migration20250130220640 = void 0;
4
- const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
5
- class Migration20250130220640 extends migrations_1.Migration {
6
- async up() {
7
- this.addSql('create table if not exists "store_credit_account_transaction" ("id" text not null, "amount" numeric not null, "type" text check ("type" in (\'credit\', \'debit\')) not null, "reference" text not null, "reference_id" text not null, "note" text null, "account_id" text not null, "transaction_group_id" text null, "metadata" jsonb null, "raw_amount" jsonb not null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "store_credit_account_transaction_pkey" primary key ("id"));');
8
- this.addSql('CREATE INDEX IF NOT EXISTS "IDX_store_credit_account_transaction_account_id" ON "store_credit_account_transaction" (account_id) WHERE deleted_at IS NULL;');
9
- this.addSql('CREATE INDEX IF NOT EXISTS "IDX_store_credit_account_transaction_transaction_group_id" ON "store_credit_account_transaction" (transaction_group_id) WHERE deleted_at IS NULL;');
10
- this.addSql('CREATE INDEX IF NOT EXISTS "IDX_store_credit_account_transaction_deleted_at" ON "store_credit_account_transaction" (deleted_at) WHERE deleted_at IS NULL;');
11
- this.addSql('alter table if exists "store_credit_account_transaction" add constraint "store_credit_account_transaction_account_id_foreign" foreign key ("account_id") references "store_credit_account" ("id") on update cascade;');
12
- this.addSql('alter table if exists "store_credit_account_transaction" add constraint "store_credit_account_transaction_transaction_group_id_foreign" foreign key ("transaction_group_id") references "store_credit_transaction_group" ("id") on update cascade on delete set null;');
13
- }
14
- async down() {
15
- this.addSql('drop table if exists "store_credit_account_transaction" cascade;');
16
- }
17
- }
18
- exports.Migration20250130220640 = Migration20250130220640;
19
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWlncmF0aW9uMjAyNTAxMzAyMjA2NDAuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9zdG9yZS1jcmVkaXQvbWlncmF0aW9ucy9NaWdyYXRpb24yMDI1MDEzMDIyMDY0MC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSx5RUFBcUU7QUFFckUsTUFBYSx1QkFBd0IsU0FBUSxzQkFBUztJQUNwRCxLQUFLLENBQUMsRUFBRTtRQUNOLElBQUksQ0FBQyxNQUFNLENBQ1QscWpCQUFxakIsQ0FDdGpCLENBQUM7UUFFRixJQUFJLENBQUMsTUFBTSxDQUNULDJKQUEySixDQUM1SixDQUFDO1FBRUYsSUFBSSxDQUFDLE1BQU0sQ0FDVCwrS0FBK0ssQ0FDaEwsQ0FBQztRQUVGLElBQUksQ0FBQyxNQUFNLENBQ1QsMkpBQTJKLENBQzVKLENBQUM7UUFFRixJQUFJLENBQUMsTUFBTSxDQUNULHNOQUFzTixDQUN2TixDQUFDO1FBRUYsSUFBSSxDQUFDLE1BQU0sQ0FDVCx1UUFBdVEsQ0FDeFEsQ0FBQztJQUNKLENBQUM7SUFFRCxLQUFLLENBQUMsSUFBSTtRQUNSLElBQUksQ0FBQyxNQUFNLENBQ1Qsa0VBQWtFLENBQ25FLENBQUM7SUFDSixDQUFDO0NBQ0Y7QUFoQ0QsMERBZ0NDIn0=
@@ -1,5 +0,0 @@
1
- import { Migration } from "@medusajs/framework/mikro-orm/migrations";
2
- export declare class Migration20250131205753 extends Migration {
3
- up(): Promise<void>;
4
- down(): Promise<void>;
5
- }
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Migration20250131205753 = void 0;
4
- const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
5
- class Migration20250131205753 extends migrations_1.Migration {
6
- async up() {
7
- this.addSql('CREATE UNIQUE INDEX IF NOT EXISTS "IDX_account_id" ON "store_credit_transaction_group" (code, account_id) WHERE deleted_at IS NULL;');
8
- }
9
- async down() {
10
- this.addSql('drop index if exists "IDX_account_id";');
11
- }
12
- }
13
- exports.Migration20250131205753 = Migration20250131205753;
14
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWlncmF0aW9uMjAyNTAxMzEyMDU3NTMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9zdG9yZS1jcmVkaXQvbWlncmF0aW9ucy9NaWdyYXRpb24yMDI1MDEzMTIwNTc1My50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSx5RUFBcUU7QUFFckUsTUFBYSx1QkFBd0IsU0FBUSxzQkFBUztJQUVwRCxLQUFLLENBQUMsRUFBRTtRQUNOLElBQUksQ0FBQyxNQUFNLENBQUMscUlBQXFJLENBQUMsQ0FBQztJQUNySixDQUFDO0lBRUQsS0FBSyxDQUFDLElBQUk7UUFDUixJQUFJLENBQUMsTUFBTSxDQUFDLHdDQUF3QyxDQUFDLENBQUM7SUFDeEQsQ0FBQztDQUVGO0FBVkQsMERBVUMifQ==
@@ -1,5 +0,0 @@
1
- import { Migration } from "@medusajs/framework/mikro-orm/migrations";
2
- export declare class Migration20250520081315 extends Migration {
3
- up(): Promise<void>;
4
- down(): Promise<void>;
5
- }
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Migration20250520081315 = void 0;
4
- const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
5
- class Migration20250520081315 extends migrations_1.Migration {
6
- async up() {
7
- this.addSql(`alter table if exists "store_credit_account" alter column "customer_id" type text using ("customer_id"::text);`);
8
- this.addSql(`alter table if exists "store_credit_account" alter column "customer_id" drop not null;`);
9
- }
10
- async down() {
11
- this.addSql(`alter table if exists "store_credit_account" alter column "customer_id" type text using ("customer_id"::text);`);
12
- this.addSql(`alter table if exists "store_credit_account" alter column "customer_id" set not null;`);
13
- }
14
- }
15
- exports.Migration20250520081315 = Migration20250520081315;
16
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWlncmF0aW9uMjAyNTA1MjAwODEzMTUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9zdG9yZS1jcmVkaXQvbWlncmF0aW9ucy9NaWdyYXRpb24yMDI1MDUyMDA4MTMxNS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSx5RUFBcUU7QUFFckUsTUFBYSx1QkFBd0IsU0FBUSxzQkFBUztJQUUzQyxLQUFLLENBQUMsRUFBRTtRQUNmLElBQUksQ0FBQyxNQUFNLENBQUMsZ0hBQWdILENBQUMsQ0FBQztRQUM5SCxJQUFJLENBQUMsTUFBTSxDQUFDLHdGQUF3RixDQUFDLENBQUM7SUFDeEcsQ0FBQztJQUVRLEtBQUssQ0FBQyxJQUFJO1FBQ2pCLElBQUksQ0FBQyxNQUFNLENBQUMsZ0hBQWdILENBQUMsQ0FBQztRQUM5SCxJQUFJLENBQUMsTUFBTSxDQUFDLHVGQUF1RixDQUFDLENBQUM7SUFDdkcsQ0FBQztDQUVGO0FBWkQsMERBWUMifQ==
@@ -1,5 +0,0 @@
1
- import { Migration } from "@medusajs/framework/mikro-orm/migrations";
2
- export declare class Migration20250520081315 extends Migration {
3
- up(): Promise<void>;
4
- down(): Promise<void>;
5
- }
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Migration20250520081315 = void 0;
4
- const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
5
- class Migration20250520081315 extends migrations_1.Migration {
6
- async up() {
7
- this.addSql(`alter table if exists "store_credit_account" add column "code" text;`);
8
- this.addSql(`create unique index if not exists "IDX_store_credit_account_code_unique" on "store_credit_account" (code) where deleted_at is null;`);
9
- }
10
- async down() {
11
- this.addSql(`alter table if exists "store_credit_account" drop column "code";`);
12
- this.addSql(`drop index if exists "IDX_store_credit_account_code_unique";`);
13
- }
14
- }
15
- exports.Migration20250520081315 = Migration20250520081315;
16
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWlncmF0aW9uMjAyNTA2MjYwODEzMTUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9zdG9yZS1jcmVkaXQvbWlncmF0aW9ucy9NaWdyYXRpb24yMDI1MDYyNjA4MTMxNS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSx5RUFBcUU7QUFFckUsTUFBYSx1QkFBd0IsU0FBUSxzQkFBUztJQUMzQyxLQUFLLENBQUMsRUFBRTtRQUNmLElBQUksQ0FBQyxNQUFNLENBQ1Qsc0VBQXNFLENBQ3ZFLENBQUM7UUFDRixJQUFJLENBQUMsTUFBTSxDQUNULHFJQUFxSSxDQUN0SSxDQUFDO0lBQ0osQ0FBQztJQUVRLEtBQUssQ0FBQyxJQUFJO1FBQ2pCLElBQUksQ0FBQyxNQUFNLENBQ1Qsa0VBQWtFLENBQ25FLENBQUM7UUFDRixJQUFJLENBQUMsTUFBTSxDQUFDLDhEQUE4RCxDQUFDLENBQUM7SUFDOUUsQ0FBQztDQUNGO0FBaEJELDBEQWdCQyJ9
@@ -1,5 +0,0 @@
1
- import { Migration } from "@medusajs/framework/mikro-orm/migrations";
2
- export declare class Migration20250722080351 extends Migration {
3
- up(): Promise<void>;
4
- down(): Promise<void>;
5
- }
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Migration20250722080351 = void 0;
4
- const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
5
- class Migration20250722080351 extends migrations_1.Migration {
6
- async up() {
7
- this.addSql(`alter table if exists "store_credit_account_transaction" drop constraint if exists "store_credit_account_transaction_transaction_group_id_foreign";`);
8
- this.addSql(`drop table if exists "store_credit_transaction_group" cascade;`);
9
- this.addSql(`alter table if exists "store_credit_account" add column if not exists "code" text null;`);
10
- this.addSql(`drop index if exists "IDX_store_credit_account_transaction_transaction_group_id";`);
11
- this.addSql(`alter table if exists "store_credit_account_transaction" drop column if exists "transaction_group_id";`);
12
- }
13
- async down() {
14
- this.addSql(`create table if not exists "store_credit_transaction_group" ("id" text not null, "code" text not null, "account_id" text not null, "metadata" jsonb null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "store_credit_transaction_group_pkey" primary key ("id"));`);
15
- this.addSql(`CREATE UNIQUE INDEX IF NOT EXISTS "IDX_store_credit_transaction_group_code_unique" ON "store_credit_transaction_group" (code) WHERE deleted_at IS NULL;`);
16
- this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_store_credit_transaction_group_account_id" ON "store_credit_transaction_group" (account_id) WHERE deleted_at IS NULL;`);
17
- this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_store_credit_transaction_group_deleted_at" ON "store_credit_transaction_group" (deleted_at) WHERE deleted_at IS NULL;`);
18
- this.addSql(`CREATE UNIQUE INDEX IF NOT EXISTS "IDX_account_id" ON "store_credit_transaction_group" (code, account_id) WHERE deleted_at IS NULL;`);
19
- this.addSql(`alter table if exists "store_credit_transaction_group" add constraint "store_credit_transaction_group_account_id_foreign" foreign key ("account_id") references "store_credit_account" ("id") on update cascade;`);
20
- this.addSql(`alter table if exists "store_credit_account" drop column if exists "code";`);
21
- this.addSql(`alter table if exists "store_credit_account_transaction" add column if not exists "transaction_group_id" text null;`);
22
- this.addSql(`alter table if exists "store_credit_account_transaction" add constraint "store_credit_account_transaction_transaction_group_id_foreign" foreign key ("transaction_group_id") references "store_credit_transaction_group" ("id") on update cascade on delete set null;`);
23
- this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_store_credit_account_transaction_transaction_group_id" ON "store_credit_account_transaction" (transaction_group_id) WHERE deleted_at IS NULL;`);
24
- }
25
- }
26
- exports.Migration20250722080351 = Migration20250722080351;
27
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWlncmF0aW9uMjAyNTA3MjIwODAzNTEuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9zdG9yZS1jcmVkaXQvbWlncmF0aW9ucy9NaWdyYXRpb24yMDI1MDcyMjA4MDM1MS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSx5RUFBcUU7QUFFckUsTUFBYSx1QkFBd0IsU0FBUSxzQkFBUztJQUUzQyxLQUFLLENBQUMsRUFBRTtRQUNmLElBQUksQ0FBQyxNQUFNLENBQUMscUpBQXFKLENBQUMsQ0FBQztRQUVuSyxJQUFJLENBQUMsTUFBTSxDQUFDLGdFQUFnRSxDQUFDLENBQUM7UUFFOUUsSUFBSSxDQUFDLE1BQU0sQ0FBQyx5RkFBeUYsQ0FBQyxDQUFDO1FBRXZHLElBQUksQ0FBQyxNQUFNLENBQUMsbUZBQW1GLENBQUMsQ0FBQztRQUNqRyxJQUFJLENBQUMsTUFBTSxDQUFDLHdHQUF3RyxDQUFDLENBQUM7SUFDeEgsQ0FBQztJQUVRLEtBQUssQ0FBQyxJQUFJO1FBQ2pCLElBQUksQ0FBQyxNQUFNLENBQUMsa1dBQWtXLENBQUMsQ0FBQztRQUNoWCxJQUFJLENBQUMsTUFBTSxDQUFDLHlKQUF5SixDQUFDLENBQUM7UUFDdkssSUFBSSxDQUFDLE1BQU0sQ0FBQyx1SkFBdUosQ0FBQyxDQUFDO1FBQ3JLLElBQUksQ0FBQyxNQUFNLENBQUMsdUpBQXVKLENBQUMsQ0FBQztRQUNySyxJQUFJLENBQUMsTUFBTSxDQUFDLHFJQUFxSSxDQUFDLENBQUM7UUFFbkosSUFBSSxDQUFDLE1BQU0sQ0FBQyxrTkFBa04sQ0FBQyxDQUFDO1FBRWhPLElBQUksQ0FBQyxNQUFNLENBQUMsNEVBQTRFLENBQUMsQ0FBQztRQUUxRixJQUFJLENBQUMsTUFBTSxDQUFDLHFIQUFxSCxDQUFDLENBQUM7UUFDbkksSUFBSSxDQUFDLE1BQU0sQ0FBQyx1UUFBdVEsQ0FBQyxDQUFDO1FBQ3JSLElBQUksQ0FBQyxNQUFNLENBQUMsK0tBQStLLENBQUMsQ0FBQztJQUMvTCxDQUFDO0NBRUY7QUE3QkQsMERBNkJDIn0=
@@ -1,28 +0,0 @@
1
- import { TransactionType } from "../../../types";
2
- declare const _default: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
3
- id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
4
- amount: import("@medusajs/framework/utils").BigNumberProperty;
5
- type: import("@medusajs/framework/utils").EnumProperty<typeof TransactionType>;
6
- reference: import("@medusajs/framework/utils").TextProperty;
7
- reference_id: import("@medusajs/framework/utils").TextProperty;
8
- note: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
9
- account: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
10
- id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
11
- code: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
12
- currency_code: import("@medusajs/framework/utils").TextProperty;
13
- customer_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
14
- metadata: import("@medusajs/framework/utils").NullableModifier<NoInfer<Record<string, unknown>>, import("@medusajs/framework/utils").JSONProperty<NoInfer<Record<string, unknown>>>>;
15
- transactions: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, {
16
- readonly tableName: "store_credit_account_transaction";
17
- readonly name: "AccountTransaction";
18
- }>>;
19
- }>, {
20
- readonly tableName: "store_credit_account";
21
- readonly name: "StoreCreditAccount";
22
- }>, undefined>;
23
- metadata: import("@medusajs/framework/utils").NullableModifier<NoInfer<Record<string, unknown>>, import("@medusajs/framework/utils").JSONProperty<NoInfer<Record<string, unknown>>>>;
24
- }>, {
25
- readonly tableName: "store_credit_account_transaction";
26
- readonly name: "AccountTransaction";
27
- }>;
28
- export default _default;
@@ -1,21 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const utils_1 = require("@medusajs/framework/utils");
7
- const types_1 = require("../../../types");
8
- const store_credit_account_1 = __importDefault(require("./store-credit-account"));
9
- exports.default = utils_1.model.define({ tableName: "store_credit_account_transaction", name: "AccountTransaction" }, {
10
- id: utils_1.model.id({ prefix: "sc_trx" }).primaryKey(),
11
- amount: utils_1.model.bigNumber(),
12
- type: utils_1.model.enum(types_1.TransactionType),
13
- reference: utils_1.model.text(),
14
- reference_id: utils_1.model.text(),
15
- note: utils_1.model.text().nullable(),
16
- account: utils_1.model.belongsTo(() => store_credit_account_1.default, {
17
- mappedBy: "transactions",
18
- }),
19
- metadata: utils_1.model.json().nullable(),
20
- });
21
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWNjb3VudC10cmFuc2FjdGlvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy9tb2R1bGVzL3N0b3JlLWNyZWRpdC9tb2RlbHMvYWNjb3VudC10cmFuc2FjdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLHFEQUFrRDtBQUNsRCwwQ0FBaUQ7QUFDakQsa0ZBQXdEO0FBRXhELGtCQUFlLGFBQUssQ0FBQyxNQUFNLENBQ3pCLEVBQUUsU0FBUyxFQUFFLGtDQUFrQyxFQUFFLElBQUksRUFBRSxvQkFBb0IsRUFBRSxFQUM3RTtJQUNFLEVBQUUsRUFBRSxhQUFLLENBQUMsRUFBRSxDQUFDLEVBQUUsTUFBTSxFQUFFLFFBQVEsRUFBRSxDQUFDLENBQUMsVUFBVSxFQUFFO0lBRS9DLE1BQU0sRUFBRSxhQUFLLENBQUMsU0FBUyxFQUFFO0lBQ3pCLElBQUksRUFBRSxhQUFLLENBQUMsSUFBSSxDQUFDLHVCQUFlLENBQUM7SUFDakMsU0FBUyxFQUFFLGFBQUssQ0FBQyxJQUFJLEVBQUU7SUFDdkIsWUFBWSxFQUFFLGFBQUssQ0FBQyxJQUFJLEVBQUU7SUFDMUIsSUFBSSxFQUFFLGFBQUssQ0FBQyxJQUFJLEVBQUUsQ0FBQyxRQUFRLEVBQUU7SUFFN0IsT0FBTyxFQUFFLGFBQUssQ0FBQyxTQUFTLENBQUMsR0FBRyxFQUFFLENBQUMsOEJBQWtCLEVBQUU7UUFDakQsUUFBUSxFQUFFLGNBQWM7S0FDekIsQ0FBQztJQUVGLFFBQVEsRUFBRSxhQUFLLENBQUMsSUFBSSxFQUFFLENBQUMsUUFBUSxFQUFFO0NBQ2xDLENBQ0YsQ0FBQyJ9
@@ -1,2 +0,0 @@
1
- export { default as AccountTransaction } from "./account-transaction";
2
- export { default as StoreCreditAccount } from "./store-credit-account";