@medusajs/order 0.1.3-snapshot-20240607093839 → 0.1.3-snapshot-20240701122250

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. package/dist/index.d.ts +2 -1
  2. package/dist/index.js +7 -2
  3. package/dist/index.js.map +1 -1
  4. package/dist/joiner-config.d.ts +1 -3
  5. package/dist/joiner-config.js +4 -42
  6. package/dist/joiner-config.js.map +1 -1
  7. package/dist/migrations/Migration20240604100512.d.ts +4 -0
  8. package/dist/migrations/Migration20240604100512.js +364 -0
  9. package/dist/migrations/Migration20240604100512.js.map +1 -0
  10. package/dist/models/claim-item-image.d.ts +18 -0
  11. package/dist/models/claim-item-image.js +108 -0
  12. package/dist/models/claim-item-image.js.map +1 -0
  13. package/dist/models/claim-item.d.ts +28 -0
  14. package/dist/models/claim-item.js +156 -0
  15. package/dist/models/claim-item.js.map +1 -0
  16. package/dist/models/claim.d.ts +35 -0
  17. package/dist/models/claim.js +196 -0
  18. package/dist/models/claim.js.map +1 -0
  19. package/dist/models/exchange-item.d.ts +23 -0
  20. package/dist/models/exchange-item.js +138 -0
  21. package/dist/models/exchange-item.js.map +1 -0
  22. package/dist/models/exchange.d.ts +33 -0
  23. package/dist/models/exchange.js +189 -0
  24. package/dist/models/exchange.js.map +1 -0
  25. package/dist/models/index.d.ts +7 -0
  26. package/dist/models/index.js +15 -1
  27. package/dist/models/index.js.map +1 -1
  28. package/dist/models/line-item-adjustment.d.ts +2 -1
  29. package/dist/models/line-item-adjustment.js +1 -1
  30. package/dist/models/line-item-adjustment.js.map +1 -1
  31. package/dist/models/line-item-tax-line.d.ts +2 -1
  32. package/dist/models/line-item-tax-line.js +1 -1
  33. package/dist/models/line-item-tax-line.js.map +1 -1
  34. package/dist/models/line-item.d.ts +1 -1
  35. package/dist/models/line-item.js +3 -3
  36. package/dist/models/line-item.js.map +1 -1
  37. package/dist/models/order-change-action.d.ts +13 -3
  38. package/dist/models/order-change-action.js +94 -0
  39. package/dist/models/order-change-action.js.map +1 -1
  40. package/dist/models/order-change.d.ts +14 -3
  41. package/dist/models/order-change.js +107 -3
  42. package/dist/models/order-change.js.map +1 -1
  43. package/dist/models/order-item.d.ts +3 -3
  44. package/dist/models/order-item.js +7 -7
  45. package/dist/models/order-item.js.map +1 -1
  46. package/dist/models/order-shipping-method.d.ts +12 -3
  47. package/dist/models/order-shipping-method.js +83 -7
  48. package/dist/models/order-shipping-method.js.map +1 -1
  49. package/dist/models/order-summary.d.ts +3 -2
  50. package/dist/models/order-summary.js +7 -4
  51. package/dist/models/order-summary.js.map +1 -1
  52. package/dist/models/order.d.ts +3 -3
  53. package/dist/models/order.js +1 -1
  54. package/dist/models/order.js.map +1 -1
  55. package/dist/models/return-item.d.ts +28 -0
  56. package/dist/models/return-item.js +170 -0
  57. package/dist/models/return-item.js.map +1 -0
  58. package/dist/models/return-reason.d.ts +3 -3
  59. package/dist/models/return-reason.js.map +1 -1
  60. package/dist/models/return.d.ts +38 -0
  61. package/dist/models/return.js +213 -0
  62. package/dist/models/return.js.map +1 -0
  63. package/dist/models/shipping-method-adjustment.d.ts +2 -1
  64. package/dist/models/shipping-method-adjustment.js +1 -1
  65. package/dist/models/shipping-method-adjustment.js.map +1 -1
  66. package/dist/models/shipping-method-tax-line.d.ts +2 -1
  67. package/dist/models/shipping-method-tax-line.js +1 -1
  68. package/dist/models/shipping-method-tax-line.js.map +1 -1
  69. package/dist/models/shipping-method.js +1 -1
  70. package/dist/models/shipping-method.js.map +1 -1
  71. package/dist/models/tax-line.js.map +1 -1
  72. package/dist/models/transaction.d.ts +11 -2
  73. package/dist/models/transaction.js +80 -1
  74. package/dist/models/transaction.js.map +1 -1
  75. package/dist/repositories/claim.d.ts +8 -0
  76. package/dist/repositories/claim.js +11 -0
  77. package/dist/repositories/claim.js.map +1 -0
  78. package/dist/repositories/exchange.d.ts +8 -0
  79. package/dist/repositories/exchange.js +11 -0
  80. package/dist/repositories/exchange.js.map +1 -0
  81. package/dist/repositories/index.d.ts +3 -1
  82. package/dist/repositories/index.js +7 -16
  83. package/dist/repositories/index.js.map +1 -1
  84. package/dist/repositories/order.d.ts +0 -3
  85. package/dist/repositories/order.js +2 -83
  86. package/dist/repositories/order.js.map +1 -1
  87. package/dist/repositories/return.d.ts +8 -0
  88. package/dist/repositories/return.js +11 -0
  89. package/dist/repositories/return.js.map +1 -0
  90. package/dist/services/actions/cancel-fulfillment.d.ts +2 -0
  91. package/dist/services/actions/cancel-fulfillment.js +32 -0
  92. package/dist/services/actions/cancel-fulfillment.js.map +1 -0
  93. package/dist/services/actions/create-claim.d.ts +2 -0
  94. package/dist/services/actions/create-claim.js +229 -0
  95. package/dist/services/actions/create-claim.js.map +1 -0
  96. package/dist/services/actions/create-exchange.d.ts +2 -0
  97. package/dist/services/actions/create-exchange.js +194 -0
  98. package/dist/services/actions/create-exchange.js.map +1 -0
  99. package/dist/services/actions/create-return.d.ts +2 -0
  100. package/dist/services/actions/create-return.js +98 -0
  101. package/dist/services/actions/create-return.js.map +1 -0
  102. package/dist/services/actions/index.d.ts +7 -0
  103. package/dist/services/actions/index.js +24 -0
  104. package/dist/services/actions/index.js.map +1 -0
  105. package/dist/services/actions/receive-return.d.ts +2 -0
  106. package/dist/services/actions/receive-return.js +75 -0
  107. package/dist/services/actions/receive-return.js.map +1 -0
  108. package/dist/services/actions/register-fulfillment.d.ts +2 -0
  109. package/dist/services/actions/register-fulfillment.js +30 -0
  110. package/dist/services/actions/register-fulfillment.js.map +1 -0
  111. package/dist/services/actions/register-shipment.d.ts +2 -0
  112. package/dist/services/actions/register-shipment.js +38 -0
  113. package/dist/services/actions/register-shipment.js.map +1 -0
  114. package/dist/services/order-change-service.d.ts +6 -6
  115. package/dist/services/order-change-service.js +4 -3
  116. package/dist/services/order-change-service.js.map +1 -1
  117. package/dist/services/order-module-service.d.ts +101 -64
  118. package/dist/services/order-module-service.js +458 -295
  119. package/dist/services/order-module-service.js.map +1 -1
  120. package/dist/services/order-service.d.ts +4 -4
  121. package/dist/services/order-service.js +1 -1
  122. package/dist/services/order-service.js.map +1 -1
  123. package/dist/types/index.d.ts +1 -0
  124. package/dist/types/index.js +1 -0
  125. package/dist/types/index.js.map +1 -1
  126. package/dist/types/order-change.d.ts +32 -0
  127. package/dist/types/order-change.js +34 -0
  128. package/dist/types/order-change.js.map +1 -0
  129. package/dist/types/utils/index.d.ts +25 -1
  130. package/dist/types/utils/index.js.map +1 -1
  131. package/dist/utils/actions/cancel-item-fulfillment.js +2 -0
  132. package/dist/utils/actions/cancel-item-fulfillment.js.map +1 -1
  133. package/dist/utils/actions/cancel-return.js +2 -0
  134. package/dist/utils/actions/cancel-return.js.map +1 -1
  135. package/dist/utils/actions/fulfill-item.js +2 -0
  136. package/dist/utils/actions/fulfill-item.js.map +1 -1
  137. package/dist/utils/actions/index.d.ts +1 -0
  138. package/dist/utils/actions/index.js +1 -0
  139. package/dist/utils/actions/index.js.map +1 -1
  140. package/dist/utils/actions/item-add.js +10 -7
  141. package/dist/utils/actions/item-add.js.map +1 -1
  142. package/dist/utils/actions/item-remove.js +6 -4
  143. package/dist/utils/actions/item-remove.js.map +1 -1
  144. package/dist/utils/actions/receive-damaged-return-item.js +2 -0
  145. package/dist/utils/actions/receive-damaged-return-item.js.map +1 -1
  146. package/dist/utils/actions/receive-return-item.js +2 -0
  147. package/dist/utils/actions/receive-return-item.js.map +1 -1
  148. package/dist/utils/actions/return-item.js +2 -0
  149. package/dist/utils/actions/return-item.js.map +1 -1
  150. package/dist/utils/actions/ship-item.js +2 -0
  151. package/dist/utils/actions/ship-item.js.map +1 -1
  152. package/dist/utils/actions/shipping-add.js +6 -2
  153. package/dist/utils/actions/shipping-add.js.map +1 -1
  154. package/dist/utils/actions/write-off-item.js +2 -0
  155. package/dist/utils/actions/write-off-item.js.map +1 -1
  156. package/dist/utils/apply-order-changes.d.ts +14 -0
  157. package/dist/utils/apply-order-changes.js +74 -0
  158. package/dist/utils/apply-order-changes.js.map +1 -0
  159. package/dist/utils/base-repository-find.d.ts +2 -0
  160. package/dist/utils/base-repository-find.js +117 -0
  161. package/dist/utils/base-repository-find.js.map +1 -0
  162. package/dist/utils/calculate-order-change.js +5 -1
  163. package/dist/utils/calculate-order-change.js.map +1 -1
  164. package/dist/utils/index.d.ts +3 -0
  165. package/dist/utils/index.js +3 -0
  166. package/dist/utils/index.js.map +1 -1
  167. package/dist/utils/set-action-reference.d.ts +1 -0
  168. package/dist/utils/set-action-reference.js +11 -0
  169. package/dist/utils/set-action-reference.js.map +1 -0
  170. package/dist/utils/transform-order.d.ts +3 -2
  171. package/dist/utils/transform-order.js +84 -17
  172. package/dist/utils/transform-order.js.map +1 -1
  173. package/package.json +7 -11
  174. package/dist/module-definition.d.ts +0 -2
  175. package/dist/module-definition.js +0 -9
  176. package/dist/module-definition.js.map +0 -1
  177. package/dist/scripts/bin/run-seed.d.ts +0 -3
  178. package/dist/scripts/bin/run-seed.js +0 -49
  179. package/dist/scripts/bin/run-seed.js.map +0 -1
@@ -0,0 +1,189 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const utils_1 = require("@medusajs/utils");
16
+ const core_1 = require("@mikro-orm/core");
17
+ const _models_1 = require(".");
18
+ const order_1 = __importDefault(require("./order"));
19
+ const order_shipping_method_1 = __importDefault(require("./order-shipping-method"));
20
+ const return_1 = __importDefault(require("./return"));
21
+ const DisplayIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
22
+ tableName: "order_exchange",
23
+ columns: "display_id",
24
+ where: "deleted_at IS NOT NULL",
25
+ });
26
+ const OrderExchangeDeletedAtIndex = (0, utils_1.createPsqlIndexStatementHelper)({
27
+ tableName: "order_exchange",
28
+ columns: "deleted_at",
29
+ where: "deleted_at IS NOT NULL",
30
+ });
31
+ const OrderIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
32
+ tableName: "order_exchange",
33
+ columns: ["order_id"],
34
+ where: "deleted_at IS NOT NULL",
35
+ });
36
+ const ReturnIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
37
+ tableName: "order_exchange",
38
+ columns: "return_id",
39
+ where: "return_id IS NOT NULL AND deleted_at IS NOT NULL",
40
+ });
41
+ let OrderExchange = class OrderExchange {
42
+ constructor() {
43
+ this.return_id = null;
44
+ this.no_notification = null;
45
+ this.allow_backorder = false;
46
+ this.additional_items = new core_1.Collection(this);
47
+ this.shipping_methods = new core_1.Collection(this);
48
+ this.transactions = new core_1.Collection(this);
49
+ this.metadata = null;
50
+ this.deleted_at = null;
51
+ this.canceled_at = null;
52
+ }
53
+ onCreate() {
54
+ this.id = (0, utils_1.generateEntityId)(this.id, "oexc");
55
+ }
56
+ onInit() {
57
+ this.id = (0, utils_1.generateEntityId)(this.id, "oexc");
58
+ }
59
+ };
60
+ __decorate([
61
+ (0, core_1.PrimaryKey)({ columnType: "text" }),
62
+ __metadata("design:type", String)
63
+ ], OrderExchange.prototype, "id", void 0);
64
+ __decorate([
65
+ (0, core_1.ManyToOne)({
66
+ entity: () => order_1.default,
67
+ mapToPk: true,
68
+ fieldName: "order_id",
69
+ columnType: "text",
70
+ }),
71
+ OrderIdIndex.MikroORMIndex(),
72
+ __metadata("design:type", String)
73
+ ], OrderExchange.prototype, "order_id", void 0);
74
+ __decorate([
75
+ (0, core_1.ManyToOne)(() => order_1.default, {
76
+ persist: false,
77
+ }),
78
+ __metadata("design:type", Object)
79
+ ], OrderExchange.prototype, "order", void 0);
80
+ __decorate([
81
+ (0, core_1.OneToOne)({
82
+ entity: () => return_1.default,
83
+ mappedBy: (ret) => ret.exchange,
84
+ cascade: ["soft-remove"],
85
+ fieldName: "return_id",
86
+ nullable: true,
87
+ owner: true,
88
+ }),
89
+ __metadata("design:type", Object)
90
+ ], OrderExchange.prototype, "return", void 0);
91
+ __decorate([
92
+ (0, core_1.Property)({ columnType: "text", nullable: true }),
93
+ ReturnIdIndex.MikroORMIndex(),
94
+ __metadata("design:type", Object)
95
+ ], OrderExchange.prototype, "return_id", void 0);
96
+ __decorate([
97
+ (0, core_1.Property)({
98
+ columnType: "integer",
99
+ }),
100
+ __metadata("design:type", Number)
101
+ ], OrderExchange.prototype, "order_version", void 0);
102
+ __decorate([
103
+ (0, core_1.Property)({ autoincrement: true, primary: false }),
104
+ DisplayIdIndex.MikroORMIndex(),
105
+ __metadata("design:type", Number)
106
+ ], OrderExchange.prototype, "display_id", void 0);
107
+ __decorate([
108
+ (0, core_1.Property)({ columnType: "boolean", nullable: true }),
109
+ __metadata("design:type", Object)
110
+ ], OrderExchange.prototype, "no_notification", void 0);
111
+ __decorate([
112
+ (0, utils_1.MikroOrmBigNumberProperty)({
113
+ nullable: true,
114
+ }),
115
+ __metadata("design:type", Object)
116
+ ], OrderExchange.prototype, "difference_due", void 0);
117
+ __decorate([
118
+ (0, core_1.Property)({ columnType: "jsonb", nullable: true }),
119
+ __metadata("design:type", Object)
120
+ ], OrderExchange.prototype, "raw_difference_due", void 0);
121
+ __decorate([
122
+ (0, core_1.Property)({ columnType: "boolean", default: false }),
123
+ __metadata("design:type", Boolean)
124
+ ], OrderExchange.prototype, "allow_backorder", void 0);
125
+ __decorate([
126
+ (0, core_1.OneToMany)(() => _models_1.ExchangeItem, (item) => item.exchange, {
127
+ cascade: [core_1.Cascade.PERSIST],
128
+ }),
129
+ __metadata("design:type", Object)
130
+ ], OrderExchange.prototype, "additional_items", void 0);
131
+ __decorate([
132
+ (0, core_1.OneToMany)(() => order_shipping_method_1.default, (shippingMethod) => shippingMethod.exchange, {
133
+ cascade: [core_1.Cascade.PERSIST],
134
+ }),
135
+ __metadata("design:type", Object)
136
+ ], OrderExchange.prototype, "shipping_methods", void 0);
137
+ __decorate([
138
+ (0, core_1.OneToMany)(() => _models_1.Transaction, (transaction) => transaction.exchange, {
139
+ cascade: [core_1.Cascade.PERSIST],
140
+ }),
141
+ __metadata("design:type", Object)
142
+ ], OrderExchange.prototype, "transactions", void 0);
143
+ __decorate([
144
+ (0, core_1.Property)({ columnType: "jsonb", nullable: true }),
145
+ __metadata("design:type", Object)
146
+ ], OrderExchange.prototype, "metadata", void 0);
147
+ __decorate([
148
+ (0, core_1.Property)({
149
+ onCreate: () => new Date(),
150
+ columnType: "timestamptz",
151
+ defaultRaw: "now()",
152
+ }),
153
+ __metadata("design:type", Date)
154
+ ], OrderExchange.prototype, "created_at", void 0);
155
+ __decorate([
156
+ (0, core_1.Property)({
157
+ onCreate: () => new Date(),
158
+ onUpdate: () => new Date(),
159
+ columnType: "timestamptz",
160
+ defaultRaw: "now()",
161
+ }),
162
+ __metadata("design:type", Date)
163
+ ], OrderExchange.prototype, "updated_at", void 0);
164
+ __decorate([
165
+ (0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
166
+ OrderExchangeDeletedAtIndex.MikroORMIndex(),
167
+ __metadata("design:type", Object)
168
+ ], OrderExchange.prototype, "deleted_at", void 0);
169
+ __decorate([
170
+ (0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
171
+ __metadata("design:type", Object)
172
+ ], OrderExchange.prototype, "canceled_at", void 0);
173
+ __decorate([
174
+ (0, core_1.BeforeCreate)(),
175
+ __metadata("design:type", Function),
176
+ __metadata("design:paramtypes", []),
177
+ __metadata("design:returntype", void 0)
178
+ ], OrderExchange.prototype, "onCreate", null);
179
+ __decorate([
180
+ (0, core_1.OnInit)(),
181
+ __metadata("design:type", Function),
182
+ __metadata("design:paramtypes", []),
183
+ __metadata("design:returntype", void 0)
184
+ ], OrderExchange.prototype, "onInit", null);
185
+ OrderExchange = __decorate([
186
+ (0, core_1.Entity)({ tableName: "order_exchange" })
187
+ ], OrderExchange);
188
+ exports.default = OrderExchange;
189
+ //# sourceMappingURL=exchange.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exchange.js","sourceRoot":"","sources":["../../src/models/exchange.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,2CAKwB;AACxB,0CAawB;AACxB,qCAAmD;AACnD,oDAA2B;AAC3B,oFAAyD;AACzD,sDAA6B;AAI7B,MAAM,cAAc,GAAG,IAAA,sCAA8B,EAAC;IACpD,SAAS,EAAE,gBAAgB;IAC3B,OAAO,EAAE,YAAY;IACrB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM,2BAA2B,GAAG,IAAA,sCAA8B,EAAC;IACjE,SAAS,EAAE,gBAAgB;IAC3B,OAAO,EAAE,YAAY;IACrB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM,YAAY,GAAG,IAAA,sCAA8B,EAAC;IAClD,SAAS,EAAE,gBAAgB;IAC3B,OAAO,EAAE,CAAC,UAAU,CAAC;IACrB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM,aAAa,GAAG,IAAA,sCAA8B,EAAC;IACnD,SAAS,EAAE,gBAAgB;IAC3B,OAAO,EAAE,WAAW;IACpB,KAAK,EAAE,kDAAkD;CAC1D,CAAC,CAAA;AAGa,IAAM,aAAa,GAAnB,MAAM,aAAa;IAAnB;QAgCb,cAAS,GAAkB,IAAI,CAAA;QAY/B,oBAAe,GAAmB,IAAI,CAAA;QAWtC,oBAAe,GAAY,KAAK,CAAA;QAKhC,qBAAgB,GAAG,IAAI,iBAAU,CAAoB,IAAI,CAAC,CAAA;QAS1D,qBAAgB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AAI,EAAE,CAAC;;+CACH;AAO/C;IALC,IAAA,eAAQ,EAAC;QACR,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;QAC1B,UAAU,EAAE,aAAa;QACzB,UAAU,EAAE,OAAO;KACpB,CAAC;8BACU,IAAI;iDAAA;AAQhB;IANC,IAAA,eAAQ,EAAC;QACR,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;QAC1B,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;QAC1B,UAAU,EAAE,aAAa;QACzB,UAAU,EAAE,OAAO;KACpB,CAAC;8BACU,IAAI;iDAAA;AAIhB;IAFC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACvD,2BAA2B,CAAC,aAAa,EAAE;;iDACd;AAG9B;IADC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACzB;AAG/B;IADC,IAAA,mBAAY,GAAE;;;;6CAGd;AAGD;IADC,IAAA,aAAM,GAAE;;;;2CAGR;AA7GkB,aAAa;IADjC,IAAA,aAAM,EAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;GACnB,aAAa,CA8GjC;kBA9GoB,aAAa"}
@@ -1,4 +1,9 @@
1
1
  export { default as Address } from "./address";
2
+ export { default as OrderClaim } from "./claim";
3
+ export { default as ClaimItem } from "./claim-item";
4
+ export { default as ClaimItemImage } from "./claim-item-image";
5
+ export { default as OrderExchange } from "./exchange";
6
+ export { default as ExchangeItem } from "./exchange-item";
2
7
  export { default as LineItem } from "./line-item";
3
8
  export { default as LineItemAdjustment } from "./line-item-adjustment";
4
9
  export { default as LineItemTaxLine } from "./line-item-tax-line";
@@ -8,6 +13,8 @@ export { default as OrderChangeAction } from "./order-change-action";
8
13
  export { default as OrderItem } from "./order-item";
9
14
  export { default as OrderShippingMethod } from "./order-shipping-method";
10
15
  export { default as OrderSummary } from "./order-summary";
16
+ export { default as Return } from "./return";
17
+ export { default as ReturnItem } from "./return-item";
11
18
  export { default as ReturnReason } from "./return-reason";
12
19
  export { default as ShippingMethod } from "./shipping-method";
13
20
  export { default as ShippingMethodAdjustment } from "./shipping-method-adjustment";
@@ -3,9 +3,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Transaction = exports.ShippingMethodTaxLine = exports.ShippingMethodAdjustment = exports.ShippingMethod = exports.ReturnReason = exports.OrderSummary = exports.OrderShippingMethod = exports.OrderItem = exports.OrderChangeAction = exports.OrderChange = exports.Order = exports.LineItemTaxLine = exports.LineItemAdjustment = exports.LineItem = exports.Address = void 0;
6
+ exports.Transaction = exports.ShippingMethodTaxLine = exports.ShippingMethodAdjustment = exports.ShippingMethod = exports.ReturnReason = exports.ReturnItem = exports.Return = exports.OrderSummary = exports.OrderShippingMethod = exports.OrderItem = exports.OrderChangeAction = exports.OrderChange = exports.Order = exports.LineItemTaxLine = exports.LineItemAdjustment = exports.LineItem = exports.ExchangeItem = exports.OrderExchange = exports.ClaimItemImage = exports.ClaimItem = exports.OrderClaim = exports.Address = void 0;
7
7
  var address_1 = require("./address");
8
8
  Object.defineProperty(exports, "Address", { enumerable: true, get: function () { return __importDefault(address_1).default; } });
9
+ var claim_1 = require("./claim");
10
+ Object.defineProperty(exports, "OrderClaim", { enumerable: true, get: function () { return __importDefault(claim_1).default; } });
11
+ var claim_item_1 = require("./claim-item");
12
+ Object.defineProperty(exports, "ClaimItem", { enumerable: true, get: function () { return __importDefault(claim_item_1).default; } });
13
+ var claim_item_image_1 = require("./claim-item-image");
14
+ Object.defineProperty(exports, "ClaimItemImage", { enumerable: true, get: function () { return __importDefault(claim_item_image_1).default; } });
15
+ var exchange_1 = require("./exchange");
16
+ Object.defineProperty(exports, "OrderExchange", { enumerable: true, get: function () { return __importDefault(exchange_1).default; } });
17
+ var exchange_item_1 = require("./exchange-item");
18
+ Object.defineProperty(exports, "ExchangeItem", { enumerable: true, get: function () { return __importDefault(exchange_item_1).default; } });
9
19
  var line_item_1 = require("./line-item");
10
20
  Object.defineProperty(exports, "LineItem", { enumerable: true, get: function () { return __importDefault(line_item_1).default; } });
11
21
  var line_item_adjustment_1 = require("./line-item-adjustment");
@@ -24,6 +34,10 @@ var order_shipping_method_1 = require("./order-shipping-method");
24
34
  Object.defineProperty(exports, "OrderShippingMethod", { enumerable: true, get: function () { return __importDefault(order_shipping_method_1).default; } });
25
35
  var order_summary_1 = require("./order-summary");
26
36
  Object.defineProperty(exports, "OrderSummary", { enumerable: true, get: function () { return __importDefault(order_summary_1).default; } });
37
+ var return_1 = require("./return");
38
+ Object.defineProperty(exports, "Return", { enumerable: true, get: function () { return __importDefault(return_1).default; } });
39
+ var return_item_1 = require("./return-item");
40
+ Object.defineProperty(exports, "ReturnItem", { enumerable: true, get: function () { return __importDefault(return_item_1).default; } });
27
41
  var return_reason_1 = require("./return-reason");
28
42
  Object.defineProperty(exports, "ReturnReason", { enumerable: true, get: function () { return __importDefault(return_reason_1).default; } });
29
43
  var shipping_method_1 = require("./shipping-method");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;;;;;AAAA,qCAA8C;AAArC,mHAAA,OAAO,OAAW;AAC3B,yCAAiD;AAAxC,sHAAA,OAAO,OAAY;AAC5B,+DAAsE;AAA7D,2IAAA,OAAO,OAAsB;AACtC,2DAAiE;AAAxD,sIAAA,OAAO,OAAmB;AACnC,iCAA0C;AAAjC,+GAAA,OAAO,OAAS;AACzB,+CAAuD;AAA9C,4HAAA,OAAO,OAAe;AAC/B,6DAAoE;AAA3D,yIAAA,OAAO,OAAqB;AACrC,2CAAmD;AAA1C,wHAAA,OAAO,OAAa;AAC7B,iEAAwE;AAA/D,6IAAA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AAA7C,2HAAA,OAAO,OAAe"}
@@ -1,7 +1,8 @@
1
+ import { Rel } from "@mikro-orm/core";
1
2
  import AdjustmentLine from "./adjustment-line";
2
3
  import LineItem from "./line-item";
3
4
  export default class LineItemAdjustment extends AdjustmentLine {
4
- item: LineItem;
5
+ item: Rel<LineItem>;
5
6
  item_id: string;
6
7
  onCreate(): void;
7
8
  onInit(): void;
@@ -34,7 +34,7 @@ __decorate([
34
34
  (0, core_1.ManyToOne)(() => line_item_1.default, {
35
35
  persist: false,
36
36
  }),
37
- __metadata("design:type", line_item_1.default)
37
+ __metadata("design:type", Object)
38
38
  ], LineItemAdjustment.prototype, "item", void 0);
39
39
  __decorate([
40
40
  (0, core_1.ManyToOne)({
@@ -1 +1 @@
1
- {"version":3,"file":"line-item-adjustment.js","sourceRoot":"","sources":["../../src/models/line-item-adjustment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,2CAGwB;AACxB,0CAAyE;AACzE,wEAA8C;AAC9C,4DAAkC;AAElC,MAAM,WAAW,GAAG,IAAA,sCAA8B,EAAC;IACjD,SAAS,EAAE,4BAA4B;IACvC,OAAO,EAAE,SAAS;CACnB,CAAC,CAAA;AAGa,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,yBAAc;IAiB5D,QAAQ;QACN,IAAI,CAAC,EAAE,GAAG,IAAA,wBAAgB,EAAC,IAAI,CAAC,EAAE,EAAE,UAAU,CAAC,CAAA;QAC/C,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,IAAI,EAAE,EAAE,CAAA;IAChC,CAAC;IAGD,MAAM;QACJ,IAAI,CAAC,EAAE,GAAG,IAAA,wBAAgB,EAAC,IAAI,CAAC,EAAE,EAAE,UAAU,CAAC,CAAA;QAC/C,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,IAAI,EAAE,EAAE,CAAA;IAChC,CAAC;CACF,CAAA;AAvBC;IAHC,IAAA,gBAAS,EAAC,GAAG,EAAE,CAAC,mBAAQ,EA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E,CAAC,mBAAQ,EAAE;QACzB,OAAO,EAAE,KAAK;KACf,CAAC;;gDACiB;AAUnB;IARC,IAAA,gBAAS,EAAC;QACT,MAAM,EAAE,GAAG,EAAE,CAAC,mBAAQ;QACtB,UAAU,EAAE,MAAM;QAClB,SAAS,EAAE,SAAS;QACpB,QAAQ,EAAE,SAAS;QACnB,OAAO,EAAE,IAAI;KACd,CAAC;IACD,WAAW,CAAC,aAAa,EAAE;;mDACb;AAGf;IADC,IAAA,mBAAY,GAAE;;;;kDAId;AAGD;IADC,IAAA,aAAM,GAAE;;;;gDAIR;AA1BkB,kBAAkB;IADtC,IAAA,aAAM,EAAC,EAAE,SAAS,EAAE,4BAA4B,EAAE,CAAC;GAC/B,kBAAkB,CA2BtC;kBA3BoB,kBAAkB"}
@@ -1,7 +1,8 @@
1
+ import { Rel } from "@mikro-orm/core";
1
2
  import LineItem from "./line-item";
2
3
  import TaxLine from "./tax-line";
3
4
  export default class LineItemTaxLine extends TaxLine {
4
- item: LineItem;
5
+ item: Rel<LineItem>;
5
6
  item_id: string;
6
7
  onCreate(): void;
7
8
  onInit(): void;
@@ -35,7 +35,7 @@ __decorate([
35
35
  fieldName: "item_id",
36
36
  persist: false,
37
37
  }),
38
- __metadata("design:type", line_item_1.default)
38
+ __metadata("design:type", Object)
39
39
  ], LineItemTaxLine.prototype, "item", void 0);
40
40
  __decorate([
41
41
  (0, core_1.ManyToOne)({
@@ -1 +1 @@
1
- {"version":3,"file":"line-item-tax-line.js","sourceRoot":"","sources":["../../src/models/line-item-tax-line.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,2CAGwB;AACxB,0CAMwB;AACxB,4DAAkC;AAClC,0DAAgC;AAEhC,MAAM,WAAW,GAAG,IAAA,sCAA8B,EAAC;IACjD,SAAS,EAAE,0BAA0B;IACrC,OAAO,EAAE,SAAS;CACnB,CAAC,CAAA;AAGa,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,kBAAO;IAkBlD,QAAQ;Q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AC,CAAA;AAGa,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,kBAAO;IAkBlD,QAAQ;QACN,IAAI,CAAC,EAAE,GAAG,IAAA,wBAAgB,EAAC,IAAI,CAAC,EAAE,EAAE,UAAU,CAAC,CAAA;QAC/C,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,IAAI,EAAE,EAAE,CAAA;IAChC,CAAC;IAGD,MAAM;QACJ,IAAI,CAAC,EAAE,GAAG,IAAA,wBAAgB,EAAC,IAAI,CAAC,EAAE,EAAE,UAAU,CAAC,CAAA;QAC/C,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,IAAI,EAAE,EAAE,CAAA;IAChC,CAAC;CACF,CAAA;AAvBC;IAJC,IAAA,gBAAS,EAAC,GAAG,EAAE,CAAC,mBAAQ,EAAE;QACzB,SAAS,EAAE,SAAS;QACpB,OAAO,EAAE,KAAK;KACf,CAAC;;6CACiB;AAUnB;IARC,IAAA,gBAAS,EAAC;QACT,MAAM,EAAE,GAAG,EAAE,CAAC,mBAAQ;QACtB,UAAU,EAAE,MAAM;QAClB,SAAS,EAAE,SAAS;QACpB,OAAO,EAAE,CAAC,cAAO,CAAC,OAAO,EAAE,cAAO,CAAC,MAAM,CAAC;QAC1C,OAAO,EAAE,IAAI;KACd,CAAC;IACD,WAAW,CAAC,aAAa,EAAE;;gDACb;AAGf;IADC,IAAA,mBAAY,GAAE;;;;+CAId;AAGD;IADC,IAAA,aAAM,GAAE;;;;6CAIR;AA3BkB,eAAe;IADnC,IAAA,aAAM,EAAC,EAAE,SAAS,EAAE,0BAA0B,EAAE,CAAC;GAC7B,eAAe,CA4BnC;kBA5BoB,eAAe"}
@@ -3,7 +3,7 @@ import { BigNumber } from "@medusajs/utils";
3
3
  import { Collection, OptionalProps } from "@mikro-orm/core";
4
4
  import LineItemAdjustment from "./line-item-adjustment";
5
5
  import LineItemTaxLine from "./line-item-tax-line";
6
- type OptionalLineItemProps = "is_discoutable" | "is_tax_inclusive" | "compare_at_unit_price" | "requires_shipping" | DAL.EntityDateColumns;
6
+ type OptionalLineItemProps = DAL.EntityDateColumns;
7
7
  export default class LineItem {
8
8
  [OptionalProps]?: OptionalLineItemProps;
9
9
  id: string;
@@ -130,15 +130,15 @@ __decorate([
130
130
  ], LineItem.prototype, "variant_option_values", void 0);
131
131
  __decorate([
132
132
  (0, core_1.Property)({ columnType: "boolean" }),
133
- __metadata("design:type", Object)
133
+ __metadata("design:type", Boolean)
134
134
  ], LineItem.prototype, "requires_shipping", void 0);
135
135
  __decorate([
136
136
  (0, core_1.Property)({ columnType: "boolean" }),
137
- __metadata("design:type", Object)
137
+ __metadata("design:type", Boolean)
138
138
  ], LineItem.prototype, "is_discountable", void 0);
139
139
  __decorate([
140
140
  (0, core_1.Property)({ columnType: "boolean" }),
141
- __metadata("design:type", Object)
141
+ __metadata("design:type", Boolean)
142
142
  ], LineItem.prototype, "is_tax_inclusive", void 0);
143
143
  __decorate([
144
144
  (0, utils_1.MikroOrmBigNumberProperty)({
@@ -1 +1 @@
1
- {"version":3,"file":"line-item.js","sourceRoot":"","sources":["../../src/models/line-item.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,2CAKwB;AACxB,0CAUwB;AACxB,kFAAuD;AACvD,8EAAkD;AASlD,MAAM,cAAc,GAAG,IAAA,sCAA8B,EAAC;IACpD,SAAS,EAAE,iBAAiB;IAC5B,OAAO,EAAE,YAAY;CACtB,CAAC,CAAA;AAEF,MAAM,cAAc,GAAG,IAAA,sCAA8B,EAAC;IACpD,SAAS,EAAE,iBAAiB;IAC5B,OAAO,EAAE,YAAY;CACtB,CAAC,CAAA;AAGa,IAAM,QAAQ,GAAd,MAAM,QAAQ;IAAd;QAUb,aAAQ,GAAkB,IAAI,CAAA;QAG9B,cAAS,GAAkB,IAAI,CAAA;QAO/B,eAAU,GAAkB,IAAI,CAAA;QAOhC,eAAU,GAAkB,IAAI,CAAA;QAGhC,kBAAa,GAAkB,IAAI,CAAA;QAGnC,wBAAmB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CAAC;8BACU,IAAI;4CAAA;AAGhB;IADC,IAAA,mBAAY,GAAE;;;;wCAGd;AAGD;IADC,IAAA,aAAM,GAAE;;;;sCAGR;AAxHkB,QAAQ;IAD5B,IAAA,aAAM,EAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;GACpB,QAAQ,CAyH5B;kBAzHoB,QAAQ"}
@@ -1,18 +1,27 @@
1
1
  import { BigNumberRawValue, DAL } from "@medusajs/types";
2
2
  import { BigNumber } from "@medusajs/utils";
3
- import { OptionalProps } from "@mikro-orm/core";
3
+ import { OptionalProps, Rel } from "@mikro-orm/core";
4
+ import OrderClaim from "./claim";
5
+ import OrderExchange from "./exchange";
4
6
  import Order from "./order";
5
7
  import OrderChange from "./order-change";
8
+ import Return from "./return";
6
9
  type OptionalLineItemProps = DAL.EntityDateColumns;
7
10
  export default class OrderChangeAction {
8
11
  [OptionalProps]?: OptionalLineItemProps;
9
12
  id: string;
10
13
  ordering: number;
11
14
  order_id: string | null;
12
- order: Order | null;
15
+ order: Rel<Order> | null;
16
+ return_id: string | null;
17
+ return: Return;
18
+ claim_id: string | null;
19
+ claim: OrderClaim;
20
+ exchange_id: string | null;
21
+ exchange: OrderExchange;
13
22
  version: number | null;
14
23
  order_change_id: string | null;
15
- order_change: OrderChange | null;
24
+ order_change: Rel<OrderChange> | null;
16
25
  reference: string | null;
17
26
  reference_id: string | null;
18
27
  action: string;
@@ -23,6 +32,7 @@ export default class OrderChangeAction {
23
32
  applied: boolean;
24
33
  created_at: Date;
25
34
  updated_at: Date;
35
+ deleted_at: Date | null;
26
36
  onCreate(): void;
27
37
  onInit(): void;
28
38
  }
@@ -14,24 +14,53 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  const utils_1 = require("@medusajs/utils");
16
16
  const core_1 = require("@mikro-orm/core");
17
+ const claim_1 = __importDefault(require("./claim"));
18
+ const exchange_1 = __importDefault(require("./exchange"));
17
19
  const order_1 = __importDefault(require("./order"));
18
20
  const order_change_1 = __importDefault(require("./order-change"));
21
+ const return_1 = __importDefault(require("./return"));
19
22
  const OrderChangeIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
20
23
  tableName: "order_change_action",
21
24
  columns: "order_change_id",
25
+ where: "deleted_at IS NOT NULL",
22
26
  });
23
27
  const OrderIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
24
28
  tableName: "order_change_action",
25
29
  columns: "order_id",
30
+ where: "deleted_at IS NOT NULL",
31
+ });
32
+ const ReturnIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
33
+ tableName: "order_change_action",
34
+ columns: "return_id",
35
+ where: "return_id IS NOT NULL AND deleted_at IS NOT NULL",
36
+ });
37
+ const OrderClaimIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
38
+ tableName: "order_change_action",
39
+ columns: "claim_id",
40
+ where: "claim_id IS NOT NULL AND deleted_at IS NOT NULL",
41
+ });
42
+ const OrderExchangeIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
43
+ tableName: "order_change_action",
44
+ columns: "exchange_id",
45
+ where: "exchange_id IS NOT NULL AND deleted_at IS NOT NULL",
46
+ });
47
+ const DeletedAtIndex = (0, utils_1.createPsqlIndexStatementHelper)({
48
+ tableName: "order_change_action",
49
+ columns: "deleted_at",
50
+ where: "deleted_at IS NOT NULL",
26
51
  });
27
52
  const ActionOrderingIndex = (0, utils_1.createPsqlIndexStatementHelper)({
28
53
  tableName: "order_change_action",
29
54
  columns: "ordering",
55
+ where: "deleted_at IS NOT NULL",
30
56
  });
31
57
  let OrderChangeAction = class OrderChangeAction {
32
58
  constructor() {
33
59
  this.order_id = null;
34
60
  this.order = null;
61
+ this.return_id = null;
62
+ this.claim_id = null;
63
+ this.exchange_id = null;
35
64
  this.version = null;
36
65
  this.order_change = null;
37
66
  this.reference = null;
@@ -41,16 +70,25 @@ let OrderChangeAction = class OrderChangeAction {
41
70
  this.raw_amount = null;
42
71
  this.internal_note = null;
43
72
  this.applied = false;
73
+ this.deleted_at = null;
44
74
  }
45
75
  onCreate() {
46
76
  this.id = (0, utils_1.generateEntityId)(this.id, "ordchact");
47
77
  this.order_id ??= this.order?.id ?? this.order_change?.order_id ?? null;
78
+ this.return_id ??= this.return?.id ?? this.order_change?.return_id ?? null;
79
+ this.claim_id ??= this.claim?.id ?? this.order_change?.claim_id ?? null;
80
+ this.exchange_id ??=
81
+ this.exchange?.id ?? this.order_change?.exchange_id ?? null;
48
82
  this.order_change_id ??= this.order_change?.id ?? null;
49
83
  this.version ??= this.order_change?.version ?? null;
50
84
  }
51
85
  onInit() {
52
86
  this.id = (0, utils_1.generateEntityId)(this.id, "ordchact");
53
87
  this.order_id ??= this.order?.id ?? this.order_change?.order_id ?? null;
88
+ this.return_id ??= this.return?.id ?? this.order_change?.return_id ?? null;
89
+ this.claim_id ??= this.claim?.id ?? this.order_change?.claim_id ?? null;
90
+ this.exchange_id ??=
91
+ this.exchange?.id ?? this.order_change?.exchange_id ?? null;
54
92
  this.order_change_id ??= this.order_change?.id ?? null;
55
93
  this.version ??= this.order_change?.version ?? null;
56
94
  }
@@ -83,6 +121,57 @@ __decorate([
83
121
  }),
84
122
  __metadata("design:type", Object)
85
123
  ], OrderChangeAction.prototype, "order", void 0);
124
+ __decorate([
125
+ (0, core_1.ManyToOne)({
126
+ entity: () => return_1.default,
127
+ mapToPk: true,
128
+ fieldName: "return_id",
129
+ columnType: "text",
130
+ nullable: true,
131
+ }),
132
+ ReturnIdIndex.MikroORMIndex(),
133
+ __metadata("design:type", Object)
134
+ ], OrderChangeAction.prototype, "return_id", void 0);
135
+ __decorate([
136
+ (0, core_1.ManyToOne)(() => return_1.default, {
137
+ persist: false,
138
+ }),
139
+ __metadata("design:type", return_1.default)
140
+ ], OrderChangeAction.prototype, "return", void 0);
141
+ __decorate([
142
+ (0, core_1.ManyToOne)({
143
+ entity: () => claim_1.default,
144
+ mapToPk: true,
145
+ fieldName: "claim_id",
146
+ columnType: "text",
147
+ nullable: true,
148
+ }),
149
+ OrderClaimIdIndex.MikroORMIndex(),
150
+ __metadata("design:type", Object)
151
+ ], OrderChangeAction.prototype, "claim_id", void 0);
152
+ __decorate([
153
+ (0, core_1.ManyToOne)(() => claim_1.default, {
154
+ persist: false,
155
+ }),
156
+ __metadata("design:type", claim_1.default)
157
+ ], OrderChangeAction.prototype, "claim", void 0);
158
+ __decorate([
159
+ (0, core_1.ManyToOne)({
160
+ entity: () => exchange_1.default,
161
+ mapToPk: true,
162
+ fieldName: "exchange_id",
163
+ columnType: "text",
164
+ nullable: true,
165
+ }),
166
+ OrderExchangeIdIndex.MikroORMIndex(),
167
+ __metadata("design:type", Object)
168
+ ], OrderChangeAction.prototype, "exchange_id", void 0);
169
+ __decorate([
170
+ (0, core_1.ManyToOne)(() => exchange_1.default, {
171
+ persist: false,
172
+ }),
173
+ __metadata("design:type", exchange_1.default)
174
+ ], OrderChangeAction.prototype, "exchange", void 0);
86
175
  __decorate([
87
176
  (0, core_1.Property)({ columnType: "integer", nullable: true }),
88
177
  __metadata("design:type", Object)
@@ -167,6 +256,11 @@ __decorate([
167
256
  }),
168
257
  __metadata("design:type", Date)
169
258
  ], OrderChangeAction.prototype, "updated_at", void 0);
259
+ __decorate([
260
+ (0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
261
+ DeletedAtIndex.MikroORMIndex(),
262
+ __metadata("design:type", Object)
263
+ ], OrderChangeAction.prototype, "deleted_at", void 0);
170
264
  __decorate([
171
265
  (0, core_1.BeforeCreate)(),
172
266
  __metadata("design:type", Function),
@@ -1 +1 @@
1
- {"version":3,"file":"order-change-action.js","sourceRoot":"","sources":["../../src/models/order-change-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,2CAKwB;AACxB,0CAQwB;AACxB,oDAA2B;AAC3B,kEAAwC;AAIxC,MAAM,kBAAkB,GAAG,IAAA,sCAA8B,EAAC;IACxD,SAAS,EAAE,qBAAqB;IAChC,OAAO,EAAE,iBAAiB;CAC3B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AAM,GAAE;;;;+CAMR;AAhHkB,iBAAiB;IADrC,IAAA,aAAM,EAAC,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC;GACxB,iBAAiB,CAiHrC;kBAjHoB,iBAAiB"}
1
+ {"version":3,"file":"order-change-action.js","sourceRoot":"","sources":["../../src/models/order-change-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,2CAKwB;AACxB,0CASwB;AACxB,oDAAgC;AAChC,0DAAsC;AACtC,oDAA2B;AAC3B,kEAAwC;AACxC,sDAA6B;AAI7B,MAAM,kBAAkB,GAAG,IAAA,sCAA8B,EAAC;IACxD,SAAS,EAAE,qBAAqB;IAChC,OAAO,EAAE,iBAAiB;IAC1B,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM,YAAY,GAAG,IAAA,sCAA8B,EAAC;IAClD,SAAS,EAAE,qBAAqB;IAChC,OAAO,EAAE,UAAU;IACnB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM,aAAa,GAAG,IAAA,sCAA8B,EAAC;IACnD,SAAS,EAAE,qBAAqB;IAChC,OAAO,EAAE,WAAW;IACpB,KAAK,EAAE,kDAAkD;CAC1D,CAAC,CAAA;AAEF,MAAM,iBAAiB,GAAG,IAAA,sCAA8B,EAAC;IACvD,SAAS,EAAE,qBAAqB;IAChC,OAAO,EAAE,UAAU;IACnB,KAAK,EAAE,iDAAiD;CACzD,CAAC,CAAA;AAEF,MAAM,oBAAoB,GAAG,IAAA,sCAA8B,EAAC;IAC1D,SAAS,EAAE,qBAAqB;IAChC,OAAO,EAAE,aAAa;IACtB,KAAK,EAAE,oDAAoD;CAC5D,CAAC,CAAA;AAEF,MAAM,cAAc,GAAG,IAAA,sCAA8B,EAAC;IACpD,SAAS,EAAE,qBAAqB;IAChC,OAAO,EAAE,YAAY;IACrB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM,mBAAmB,GAAG,IAAA,sCAA8B,EAA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;KACpB,CAAC;;kDACsB;AAOxB;IALC,IAAA,eAAQ,EAAC;QACR,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;QAC1B,UAAU,EAAE,aAAa;QACzB,UAAU,EAAE,OAAO;KACpB,CAAC;8BACU,IAAI;qDAAA;AAQhB;IANC,IAAA,eAAQ,EAAC;QACR,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;QAC1B,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;QAC1B,UAAU,EAAE,aAAa;QACzB,UAAU,EAAE,OAAO;KACpB,CAAC;8BACU,IAAI;qDAAA;AAIhB;IAFC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACvD,cAAc,CAAC,aAAa,EAAE;;qDACD;AAG9B;IADC,IAAA,mBAAY,GAAE;;;;iDAUd;AAGD;IADC,IAAA,aAAM,GAAE;;;;+CAUR;AAzKkB,iBAAiB;IADrC,IAAA,aAAM,EAAC,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC;GACxB,iBAAiB,CA0KrC;kBA1KoB,iBAAiB"}
@@ -1,15 +1,25 @@
1
1
  import { DAL } from "@medusajs/types";
2
- import { OrderChangeStatus } from "@medusajs/utils";
3
- import { Collection, OptionalProps } from "@mikro-orm/core";
2
+ import { Collection, OptionalProps, Rel } from "@mikro-orm/core";
3
+ import { OrderChangeStatus, OrderChangeType } from "../types";
4
+ import OrderClaim from "./claim";
5
+ import OrderExchange from "./exchange";
4
6
  import Order from "./order";
5
7
  import OrderChangeAction from "./order-change-action";
8
+ import Return from "./return";
6
9
  type OptionalLineItemProps = DAL.EntityDateColumns;
7
10
  export default class OrderChange {
8
11
  [OptionalProps]?: OptionalLineItemProps;
9
12
  id: string;
10
13
  order_id: string;
11
- order: Order;
14
+ order: Rel<Order>;
15
+ return_id: string | null;
16
+ return: Rel<Return>;
17
+ claim_id: string | null;
18
+ claim: OrderClaim;
19
+ exchange_id: string | null;
20
+ exchange: OrderExchange;
12
21
  version: number;
22
+ change_type: OrderChangeType | null;
13
23
  actions: Collection<OrderChangeAction, object>;
14
24
  description: string | null;
15
25
  status: OrderChangeStatus;
@@ -27,6 +37,7 @@ export default class OrderChange {
27
37
  canceled_at?: Date;
28
38
  created_at: Date;
29
39
  updated_at: Date;
40
+ deleted_at: Date | null;
30
41
  onCreate(): void;
31
42
  onInit(): void;
32
43
  }