@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
@@ -14,25 +14,61 @@ 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 _types_1 = require("../types");
18
+ const claim_1 = __importDefault(require("./claim"));
19
+ const exchange_1 = __importDefault(require("./exchange"));
17
20
  const order_1 = __importDefault(require("./order"));
18
21
  const order_change_action_1 = __importDefault(require("./order-change-action"));
22
+ const return_1 = __importDefault(require("./return"));
19
23
  const OrderIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
20
24
  tableName: "order_change",
21
25
  columns: "order_id",
26
+ where: "deleted_at IS NOT NULL",
27
+ });
28
+ const ReturnIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
29
+ tableName: "order_change",
30
+ columns: "return_id",
31
+ where: "return_id IS NOT NULL AND deleted_at IS NOT NULL",
32
+ });
33
+ const OrderClaimIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
34
+ tableName: "order_change",
35
+ columns: "claim_id",
36
+ where: "claim_id IS NOT NULL AND deleted_at IS NOT NULL",
37
+ });
38
+ const OrderExchangeIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
39
+ tableName: "order_change",
40
+ columns: "exchange_id",
41
+ where: "exchange_id IS NOT NULL AND deleted_at IS NOT NULL",
22
42
  });
23
43
  const OrderChangeStatusIndex = (0, utils_1.createPsqlIndexStatementHelper)({
24
44
  tableName: "order_change",
25
45
  columns: "status",
46
+ where: "deleted_at IS NOT NULL",
47
+ });
48
+ const OrderChangeTypeIndex = (0, utils_1.createPsqlIndexStatementHelper)({
49
+ tableName: "order_change",
50
+ columns: "change_type",
51
+ where: "deleted_at IS NOT NULL",
52
+ });
53
+ const DeletedAtIndex = (0, utils_1.createPsqlIndexStatementHelper)({
54
+ tableName: "order_change",
55
+ columns: "deleted_at",
56
+ where: "deleted_at IS NOT NULL",
26
57
  });
27
58
  const VersionIndex = (0, utils_1.createPsqlIndexStatementHelper)({
28
59
  tableName: "order_change",
29
60
  columns: ["order_id", "version"],
61
+ where: "deleted_at IS NOT NULL",
30
62
  });
31
63
  let OrderChange = class OrderChange {
32
64
  constructor() {
65
+ this.return_id = null;
66
+ this.claim_id = null;
67
+ this.exchange_id = null;
68
+ this.change_type = null;
33
69
  this.actions = new core_1.Collection(this);
34
70
  this.description = null;
35
- this.status = utils_1.OrderChangeStatus.PENDING;
71
+ this.status = _types_1.OrderChangeStatus.PENDING;
36
72
  this.internal_note = null;
37
73
  this.requested_by = null; // customer or user ID
38
74
  this.requested_at = null;
@@ -42,14 +78,21 @@ let OrderChange = class OrderChange {
42
78
  this.declined_reason = null;
43
79
  this.metadata = null;
44
80
  this.canceled_by = null;
81
+ this.deleted_at = null;
45
82
  }
46
83
  onCreate() {
47
84
  this.id = (0, utils_1.generateEntityId)(this.id, "ordch");
48
85
  this.order_id ??= this.order?.id;
86
+ this.return_id ??= this.return?.id;
87
+ this.claim_id ??= this.claim?.id;
88
+ this.exchange_id ??= this.exchange?.id;
49
89
  }
50
90
  onInit() {
51
91
  this.id = (0, utils_1.generateEntityId)(this.id, "ordch");
52
92
  this.order_id ??= this.order?.id;
93
+ this.return_id ??= this.return?.id;
94
+ this.claim_id ??= this.claim?.id;
95
+ this.exchange_id ??= this.exchange?.id;
53
96
  }
54
97
  };
55
98
  __decorate([
@@ -71,13 +114,69 @@ __decorate([
71
114
  (0, core_1.ManyToOne)(() => order_1.default, {
72
115
  persist: false,
73
116
  }),
74
- __metadata("design:type", order_1.default)
117
+ __metadata("design:type", Object)
75
118
  ], OrderChange.prototype, "order", void 0);
119
+ __decorate([
120
+ (0, core_1.ManyToOne)({
121
+ entity: () => return_1.default,
122
+ mapToPk: true,
123
+ fieldName: "return_id",
124
+ columnType: "text",
125
+ nullable: true,
126
+ }),
127
+ ReturnIdIndex.MikroORMIndex(),
128
+ __metadata("design:type", Object)
129
+ ], OrderChange.prototype, "return_id", void 0);
130
+ __decorate([
131
+ (0, core_1.ManyToOne)(() => return_1.default, {
132
+ persist: false,
133
+ }),
134
+ __metadata("design:type", Object)
135
+ ], OrderChange.prototype, "return", void 0);
136
+ __decorate([
137
+ (0, core_1.ManyToOne)({
138
+ entity: () => claim_1.default,
139
+ mapToPk: true,
140
+ fieldName: "claim_id",
141
+ columnType: "text",
142
+ nullable: true,
143
+ }),
144
+ OrderClaimIdIndex.MikroORMIndex(),
145
+ __metadata("design:type", Object)
146
+ ], OrderChange.prototype, "claim_id", void 0);
147
+ __decorate([
148
+ (0, core_1.ManyToOne)(() => claim_1.default, {
149
+ persist: false,
150
+ }),
151
+ __metadata("design:type", claim_1.default)
152
+ ], OrderChange.prototype, "claim", void 0);
153
+ __decorate([
154
+ (0, core_1.ManyToOne)({
155
+ entity: () => exchange_1.default,
156
+ mapToPk: true,
157
+ fieldName: "exchange_id",
158
+ columnType: "text",
159
+ nullable: true,
160
+ }),
161
+ OrderExchangeIdIndex.MikroORMIndex(),
162
+ __metadata("design:type", Object)
163
+ ], OrderChange.prototype, "exchange_id", void 0);
164
+ __decorate([
165
+ (0, core_1.ManyToOne)(() => exchange_1.default, {
166
+ persist: false,
167
+ }),
168
+ __metadata("design:type", exchange_1.default)
169
+ ], OrderChange.prototype, "exchange", void 0);
76
170
  __decorate([
77
171
  (0, core_1.Property)({ columnType: "integer" }),
78
172
  VersionIndex.MikroORMIndex(),
79
173
  __metadata("design:type", Number)
80
174
  ], OrderChange.prototype, "version", void 0);
175
+ __decorate([
176
+ (0, core_1.Enum)({ items: () => _types_1.OrderChangeType, nullable: true }),
177
+ OrderChangeTypeIndex.MikroORMIndex(),
178
+ __metadata("design:type", Object)
179
+ ], OrderChange.prototype, "change_type", void 0);
81
180
  __decorate([
82
181
  (0, core_1.OneToMany)(() => order_change_action_1.default, (action) => action.order_change, {
83
182
  cascade: [core_1.Cascade.PERSIST, "sotf-remove"],
@@ -92,7 +191,7 @@ __decorate([
92
191
  __metadata("design:type", Object)
93
192
  ], OrderChange.prototype, "description", void 0);
94
193
  __decorate([
95
- (0, core_1.Enum)({ items: () => utils_1.OrderChangeStatus, default: utils_1.OrderChangeStatus.PENDING }),
194
+ (0, core_1.Enum)({ items: () => _types_1.OrderChangeStatus, default: _types_1.OrderChangeStatus.PENDING }),
96
195
  OrderChangeStatusIndex.MikroORMIndex(),
97
196
  __metadata("design:type", String)
98
197
  ], OrderChange.prototype, "status", void 0);
@@ -173,6 +272,11 @@ __decorate([
173
272
  }),
174
273
  __metadata("design:type", Date)
175
274
  ], OrderChange.prototype, "updated_at", void 0);
275
+ __decorate([
276
+ (0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
277
+ DeletedAtIndex.MikroORMIndex(),
278
+ __metadata("design:type", Object)
279
+ ], OrderChange.prototype, "deleted_at", void 0);
176
280
  __decorate([
177
281
  (0, core_1.BeforeCreate)(),
178
282
  __metadata("design:type", Function),
@@ -1 +1 @@
1
- {"version":3,"file":"order-change.js","sourceRoot":"","sources":["../../src/models/order-change.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,2CAIwB;AACxB,0CAYwB;A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6 @@
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
4
  import LineItem from "./line-item";
5
5
  import Order from "./order";
6
6
  type OptionalLineItemProps = DAL.EntityDateColumns;
@@ -8,10 +8,10 @@ export default class OrderItem {
8
8
  [OptionalProps]?: OptionalLineItemProps;
9
9
  id: string;
10
10
  order_id: string;
11
+ order: Rel<Order>;
11
12
  version: number;
12
- order: Order;
13
13
  item_id: string;
14
- item: LineItem;
14
+ item: Rel<LineItem>;
15
15
  quantity: BigNumber | number;
16
16
  raw_quantity: BigNumberRawValue;
17
17
  fulfilled_quantity: BigNumber | number;
@@ -74,17 +74,17 @@ __decorate([
74
74
  OrderIdIndex.MikroORMIndex(),
75
75
  __metadata("design:type", String)
76
76
  ], OrderItem.prototype, "order_id", void 0);
77
- __decorate([
78
- (0, core_1.Property)({ columnType: "integer" }),
79
- OrderVersionIndex.MikroORMIndex(),
80
- __metadata("design:type", Number)
81
- ], OrderItem.prototype, "version", void 0);
82
77
  __decorate([
83
78
  (0, core_1.ManyToOne)(() => order_1.default, {
84
79
  persist: false,
85
80
  }),
86
- __metadata("design:type", order_1.default)
81
+ __metadata("design:type", Object)
87
82
  ], OrderItem.prototype, "order", void 0);
83
+ __decorate([
84
+ (0, core_1.Property)({ columnType: "integer" }),
85
+ OrderVersionIndex.MikroORMIndex(),
86
+ __metadata("design:type", Number)
87
+ ], OrderItem.prototype, "version", void 0);
88
88
  __decorate([
89
89
  (0, core_1.ManyToOne)({
90
90
  entity: () => line_item_1.default,
@@ -99,7 +99,7 @@ __decorate([
99
99
  (0, core_1.ManyToOne)(() => line_item_1.default, {
100
100
  persist: false,
101
101
  }),
102
- __metadata("design:type", line_item_1.default)
102
+ __metadata("design:type", Object)
103
103
  ], OrderItem.prototype, "item", void 0);
104
104
  __decorate([
105
105
  (0, utils_1.MikroOrm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ADC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;;2DACS;AAG3C;IADC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACH;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;6CAAA;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;6CAAA;AAIhB;IAFC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACvD,cAAc,CAAC,aAAa,EAAE;;6CACD;AAG9B;IADC,IAAA,mBAAY,GAAE;;;;yCAMd;AAGD;IADC,IAAA,aAAM,GAAE;;;;uCAMR;AApHkB,SAAS;IAD7B,IAAA,aAAM,EAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;GACf,SAAS,CAqH7B;kBArHoB,SAAS"}
@@ -1,16 +1,25 @@
1
1
  import { DAL } from "@medusajs/types";
2
- import { OptionalProps } from "@mikro-orm/core";
2
+ import { OptionalProps, Rel } from "@mikro-orm/core";
3
+ import Claim from "./claim";
4
+ import Exchange from "./exchange";
3
5
  import Order from "./order";
6
+ import Return from "./return";
4
7
  import ShippingMethod from "./shipping-method";
5
8
  type OptionalShippingMethodProps = DAL.EntityDateColumns;
6
9
  export default class OrderShippingMethod {
7
10
  [OptionalProps]?: OptionalShippingMethodProps;
8
11
  id: string;
9
12
  order_id: string;
13
+ order: Rel<Order>;
14
+ return_id: string | null;
15
+ return: Rel<Return>;
16
+ exchange_id: string | null;
17
+ exchange: Rel<Exchange>;
18
+ claim_id: string | null;
19
+ claim: Rel<Claim>;
10
20
  version: number;
11
- order: Order;
12
21
  shipping_method_id: string;
13
- shipping_method: ShippingMethod;
22
+ shipping_method: Rel<ShippingMethod>;
14
23
  created_at: Date;
15
24
  updated_at: Date;
16
25
  deleted_at: Date | null;
@@ -14,13 +14,31 @@ 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"));
20
+ const return_1 = __importDefault(require("./return"));
18
21
  const shipping_method_1 = __importDefault(require("./shipping-method"));
19
22
  const OrderIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
20
23
  tableName: "order_shipping",
21
24
  columns: ["order_id"],
22
25
  where: "deleted_at IS NOT NULL",
23
26
  });
27
+ const ReturnIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
28
+ tableName: "order_shipping",
29
+ columns: "return_id",
30
+ where: "return_id IS NOT NULL AND deleted_at IS NOT NULL",
31
+ });
32
+ const ExchangeIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
33
+ tableName: "order_shipping",
34
+ columns: ["exchange_id"],
35
+ where: "exchange_id IS NOT NULL AND deleted_at IS NOT NULL",
36
+ });
37
+ const ClaimIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
38
+ tableName: "order_shipping",
39
+ columns: ["claim_id"],
40
+ where: "claim_id IS NOT NULL AND deleted_at IS NOT NULL",
41
+ });
24
42
  const OrderVersionIndex = (0, utils_1.createPsqlIndexStatementHelper)({
25
43
  tableName: "order_shipping",
26
44
  columns: ["version"],
@@ -38,17 +56,24 @@ const DeletedAtIndex = (0, utils_1.createPsqlIndexStatementHelper)({
38
56
  });
39
57
  let OrderShippingMethod = class OrderShippingMethod {
40
58
  constructor() {
59
+ this.return_id = null;
41
60
  this.deleted_at = null;
42
61
  }
43
62
  onCreate() {
44
63
  this.id = (0, utils_1.generateEntityId)(this.id, "ordspmv");
45
64
  this.order_id ??= this.order?.id;
65
+ this.return_id ??= this.return?.id;
66
+ this.claim_id ??= this.claim?.id;
67
+ this.exchange_id ??= this.exchange?.id;
46
68
  this.shipping_method_id ??= this.shipping_method?.id;
47
69
  this.version ??= this.order?.version;
48
70
  }
49
71
  onInit() {
50
72
  this.id = (0, utils_1.generateEntityId)(this.id, "ordspmv");
51
73
  this.order_id ??= this.order?.id;
74
+ this.return_id ??= this.return?.id;
75
+ this.claim_id ??= this.claim?.id;
76
+ this.exchange_id ??= this.exchange?.id;
52
77
  this.shipping_method_id ??= this.shipping_method?.id;
53
78
  this.version ??= this.order?.version;
54
79
  }
@@ -67,17 +92,68 @@ __decorate([
67
92
  OrderIdIndex.MikroORMIndex(),
68
93
  __metadata("design:type", String)
69
94
  ], OrderShippingMethod.prototype, "order_id", void 0);
70
- __decorate([
71
- (0, core_1.Property)({ columnType: "integer" }),
72
- OrderVersionIndex.MikroORMIndex(),
73
- __metadata("design:type", Number)
74
- ], OrderShippingMethod.prototype, "version", void 0);
75
95
  __decorate([
76
96
  (0, core_1.ManyToOne)(() => order_1.default, {
77
97
  persist: false,
78
98
  }),
79
- __metadata("design:type", order_1.default)
99
+ __metadata("design:type", Object)
80
100
  ], OrderShippingMethod.prototype, "order", void 0);
101
+ __decorate([
102
+ (0, core_1.ManyToOne)({
103
+ entity: () => return_1.default,
104
+ mapToPk: true,
105
+ fieldName: "return_id",
106
+ columnType: "text",
107
+ nullable: true,
108
+ }),
109
+ ReturnIdIndex.MikroORMIndex(),
110
+ __metadata("design:type", Object)
111
+ ], OrderShippingMethod.prototype, "return_id", void 0);
112
+ __decorate([
113
+ (0, core_1.ManyToOne)(() => return_1.default, {
114
+ persist: false,
115
+ }),
116
+ __metadata("design:type", Object)
117
+ ], OrderShippingMethod.prototype, "return", void 0);
118
+ __decorate([
119
+ (0, core_1.ManyToOne)({
120
+ entity: () => exchange_1.default,
121
+ mapToPk: true,
122
+ fieldName: "exchange_id",
123
+ columnType: "text",
124
+ nullable: true,
125
+ }),
126
+ ExchangeIdIndex.MikroORMIndex(),
127
+ __metadata("design:type", Object)
128
+ ], OrderShippingMethod.prototype, "exchange_id", void 0);
129
+ __decorate([
130
+ (0, core_1.ManyToOne)(() => exchange_1.default, {
131
+ persist: false,
132
+ }),
133
+ __metadata("design:type", Object)
134
+ ], OrderShippingMethod.prototype, "exchange", void 0);
135
+ __decorate([
136
+ (0, core_1.ManyToOne)({
137
+ entity: () => claim_1.default,
138
+ mapToPk: true,
139
+ fieldName: "claim_id",
140
+ columnType: "text",
141
+ nullable: true,
142
+ }),
143
+ ClaimIdIndex.MikroORMIndex(),
144
+ __metadata("design:type", Object)
145
+ ], OrderShippingMethod.prototype, "claim_id", void 0);
146
+ __decorate([
147
+ (0, core_1.ManyToOne)(() => claim_1.default, {
148
+ persist: false,
149
+ }),
150
+ __metadata("design:type", Object)
151
+ ], OrderShippingMethod.prototype, "claim", void 0);
152
+ __decorate([
153
+ (0, core_1.Property)({ columnType: "integer" }),
154
+ OrderVersionIndex.MikroORMIndex(),
155
+ __metadata("design:type", Number)
156
+ ], OrderShippingMethod.prototype, "version", void 0);
81
157
  __decorate([
82
158
  (0, core_1.ManyToOne)({
83
159
  entity: () => shipping_method_1.default,
@@ -92,7 +168,7 @@ __decorate([
92
168
  (0, core_1.ManyToOne)(() => shipping_method_1.default, {
93
169
  persist: false,
94
170
  }),
95
- __metadata("design:type", shipping_method_1.default)
171
+ __metadata("design:type", Object)
96
172
  ], OrderShippingMethod.prototype, "shipping_method", void 0);
97
173
  __decorate([
98
174
  (0, core_1.Property)({
@@ -1 +1 @@
1
- {"version":3,"file":"order-shipping-method.js","sourceRoot":"","sources":["../../src/models/order-shipping-method.ts"],"names":[],"m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EAAE;QAC1B,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;QAC1B,UAAU,EAAE,aAAa;QACzB,UAAU,EAAE,OAAO;KACpB,CAAC;8BACU,IAAI;uDAAA;AAIhB;IAFC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACvD,cAAc,CAAC,aAAa,EAAE;;uDACD;AAG9B;IADC,IAAA,mBAAY,GAAE;;;;mDASd;AAGD;IADC,IAAA,aAAM,GAAE;;;;iDASR;AA1HkB,mBAAmB;IADvC,IAAA,aAAM,EAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;GACnB,mBAAmB,CA2HvC;kBA3HoB,mBAAmB"}
@@ -1,5 +1,6 @@
1
1
  import { BigNumber } from "@medusajs/utils";
2
- import { Order } from ".";
2
+ import { Rel } from "@mikro-orm/core";
3
+ import Order from "./order";
3
4
  type OrderSummaryTotals = {
4
5
  total: BigNumber;
5
6
  subtotal: BigNumber;
@@ -25,7 +26,7 @@ type OrderSummaryTotals = {
25
26
  export default class OrderSummary {
26
27
  id: string;
27
28
  order_id: string;
28
- order: Order;
29
+ order: Rel<Order>;
29
30
  version: number;
30
31
  totals: OrderSummaryTotals | null;
31
32
  created_at: Date;
@@ -8,10 +8,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
11
14
  Object.defineProperty(exports, "__esModule", { value: true });
12
15
  const utils_1 = require("@medusajs/utils");
13
16
  const core_1 = require("@mikro-orm/core");
14
- const _models_1 = require(".");
17
+ const order_1 = __importDefault(require("./order"));
15
18
  const OrderIdVersionIndex = (0, utils_1.createPsqlIndexStatementHelper)({
16
19
  tableName: "order_summary",
17
20
  columns: ["order_id", "version"],
@@ -43,7 +46,7 @@ __decorate([
43
46
  ], OrderSummary.prototype, "id", void 0);
44
47
  __decorate([
45
48
  (0, core_1.ManyToOne)({
46
- entity: () => _models_1.Order,
49
+ entity: () => order_1.default,
47
50
  columnType: "text",
48
51
  fieldName: "order_id",
49
52
  mapToPk: true,
@@ -52,10 +55,10 @@ __decorate([
52
55
  __metadata("design:type", String)
53
56
  ], OrderSummary.prototype, "order_id", void 0);
54
57
  __decorate([
55
- (0, core_1.ManyToOne)(() => _models_1.Order, {
58
+ (0, core_1.ManyToOne)(() => order_1.default, {
56
59
  persist: false,
57
60
  }),
58
- __metadata("design:type", _models_1.Order)
61
+ __metadata("design:type", Object)
59
62
  ], OrderSummary.prototype, "order", void 0);
60
63
  __decorate([
61
64
  (0, core_1.Property)({
@@ -1 +1 @@
1
- {"version":3,"file":"order-summary.js","sourceRoot":"","sources":["../../src/models/order-summary.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,2CAIwB;AACxB,0CAOwB;AACxB,qCAA+B;AA8B/B,MAAM,mBAAmB,GAAG,IAAA,sCAA8B,EAAC;IACzD,SAAS,EAAE,eAAe;IAC1B,OAAO,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC;IAChC,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM,cAAc,GAAG,IAAA,sCAA8B,EAAC;IACpD,SAAS,EAAE,OAAO;IAClB,OAAO,EAAE,YAAY;IACrB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAIa,IAAM,YAAY,GAAlB,MAAM,YAAY;IAAlB;QAsBb,YAAO,GAAW,CAAC,CAAA;QAGnB,WAAM,GAA8B,EAAwB,CAAA;QAmB5D,eAAU,GAAgB,IAAI,CAAA;IAahC,CAAC;IAVC,QAAQ;QACN,IAAI,CAAC,EAAE,GAAG,IAAA,wBAAgB,EAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,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;0CAIR;AAxDkB,YAAY;IAFhC,IAAA,aAAM,EAAC,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;IACtC,mBAAmB,CAAC,aAAa,EAAE;GACf,YAAY,CAyDhC;kBAzDoB,YAAY"}
@@ -1,6 +1,6 @@
1
1
  import { DAL } from "@medusajs/types";
2
2
  import { OrderStatus } from "@medusajs/utils";
3
- import { Collection, OptionalProps } from "@mikro-orm/core";
3
+ import { Collection, OptionalProps, Rel } from "@mikro-orm/core";
4
4
  import Address from "./address";
5
5
  import OrderItem from "./order-item";
6
6
  import OrderShippingMethod from "./order-shipping-method";
@@ -20,9 +20,9 @@ export default class Order {
20
20
  email: string | null;
21
21
  currency_code: string;
22
22
  shipping_address_id?: string | null;
23
- shipping_address?: Address | null;
23
+ shipping_address?: Rel<Address> | null;
24
24
  billing_address_id?: string | null;
25
- billing_address?: Address | null;
25
+ billing_address?: Rel<Address> | null;
26
26
  no_notification: boolean | null;
27
27
  summary: Collection<OrderSummary, object>;
28
28
  metadata: Record<string, unknown> | null;
@@ -137,7 +137,7 @@ __decorate([
137
137
  columnType: "boolean",
138
138
  }),
139
139
  IsDraftOrderIndex.MikroORMIndex(),
140
- __metadata("design:type", Object)
140
+ __metadata("design:type", Boolean)
141
141
  ], Order.prototype, "is_draft_order", void 0);
142
142
  __decorate([
143
143
  (0, core_1.Property)({ columnType: "text", nullable: true }),
@@ -1 +1 @@
1
- {"version":3,"file":"order.js","sourceRoot":"","sources":["../../src/models/order.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,2CAIwB;AACxB,0CAYwB;AACxB,wDAA+B;AAC/B,8DAAoC;AACpC,oFAAyD;AACzD,oEAA0C;AAC1C,gEAAuC;AAOvC,MAAM,cAAc,GAAG,IAAA,sCAA8B,EAAC;IACpD,SAAS,EAAE,OAAO;IAClB,OAAO,EAAE,YAAY;IACrB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM,aAAa,GAAG,IAAA,sCAA8B,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9B;IADC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACzB;AAG/B;IADC,IAAA,mBAAY,GAAE;;;;qCAGd;AAGD;IADC,IAAA,aAAM,GAAE;;;;mCAGR;AAzIkB,KAAK;IADzB,IAAA,aAAM,EAAC,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;GACV,KAAK,CA0IzB;kBA1IoB,KAAK"}
@@ -0,0 +1,28 @@
1
+ import { BigNumberRawValue, DAL } from "@medusajs/types";
2
+ import { OptionalProps } from "@mikro-orm/core";
3
+ import LineItem from "./line-item";
4
+ import Return from "./return";
5
+ import ReturnReason from "./return-reason";
6
+ type OptionalLineItemProps = DAL.EntityDateColumns;
7
+ export default class ReturnItem {
8
+ [OptionalProps]?: OptionalLineItemProps;
9
+ id: string;
10
+ reason_id: string | null;
11
+ reason: ReturnReason;
12
+ quantity: Number | number;
13
+ raw_quantity: BigNumberRawValue;
14
+ received_quantity: Number | number;
15
+ raw_received_quantity: BigNumberRawValue;
16
+ return_id: string;
17
+ return: Return;
18
+ item_id: string;
19
+ item: LineItem;
20
+ note: string;
21
+ metadata: Record<string, unknown> | null;
22
+ created_at: Date;
23
+ updated_at: Date;
24
+ deleted_at: Date | null;
25
+ onCreate(): void;
26
+ onInit(): void;
27
+ }
28
+ export {};