@medusajs/order 0.1.3-snapshot-20240607093839 → 0.1.3-snapshot-20240703074611
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.ts +2 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/joiner-config.d.ts +1 -3
- package/dist/joiner-config.js +4 -42
- package/dist/joiner-config.js.map +1 -1
- package/dist/migrations/Migration20240604100512.d.ts +4 -0
- package/dist/migrations/Migration20240604100512.js +364 -0
- package/dist/migrations/Migration20240604100512.js.map +1 -0
- package/dist/models/claim-item-image.d.ts +18 -0
- package/dist/models/claim-item-image.js +108 -0
- package/dist/models/claim-item-image.js.map +1 -0
- package/dist/models/claim-item.d.ts +28 -0
- package/dist/models/claim-item.js +156 -0
- package/dist/models/claim-item.js.map +1 -0
- package/dist/models/claim.d.ts +35 -0
- package/dist/models/claim.js +196 -0
- package/dist/models/claim.js.map +1 -0
- package/dist/models/exchange-item.d.ts +23 -0
- package/dist/models/exchange-item.js +138 -0
- package/dist/models/exchange-item.js.map +1 -0
- package/dist/models/exchange.d.ts +33 -0
- package/dist/models/exchange.js +189 -0
- package/dist/models/exchange.js.map +1 -0
- package/dist/models/index.d.ts +7 -0
- package/dist/models/index.js +15 -1
- package/dist/models/index.js.map +1 -1
- package/dist/models/line-item-adjustment.d.ts +2 -1
- package/dist/models/line-item-adjustment.js +1 -1
- package/dist/models/line-item-adjustment.js.map +1 -1
- package/dist/models/line-item-tax-line.d.ts +2 -1
- package/dist/models/line-item-tax-line.js +1 -1
- package/dist/models/line-item-tax-line.js.map +1 -1
- package/dist/models/line-item.d.ts +1 -1
- package/dist/models/line-item.js +3 -3
- package/dist/models/line-item.js.map +1 -1
- package/dist/models/order-change-action.d.ts +13 -3
- package/dist/models/order-change-action.js +94 -0
- package/dist/models/order-change-action.js.map +1 -1
- package/dist/models/order-change.d.ts +14 -3
- package/dist/models/order-change.js +107 -3
- package/dist/models/order-change.js.map +1 -1
- package/dist/models/order-item.d.ts +3 -3
- package/dist/models/order-item.js +7 -7
- package/dist/models/order-item.js.map +1 -1
- package/dist/models/order-shipping-method.d.ts +12 -3
- package/dist/models/order-shipping-method.js +83 -7
- package/dist/models/order-shipping-method.js.map +1 -1
- package/dist/models/order-summary.d.ts +3 -2
- package/dist/models/order-summary.js +7 -4
- package/dist/models/order-summary.js.map +1 -1
- package/dist/models/order.d.ts +3 -3
- package/dist/models/order.js +1 -1
- package/dist/models/order.js.map +1 -1
- package/dist/models/return-item.d.ts +28 -0
- package/dist/models/return-item.js +170 -0
- package/dist/models/return-item.js.map +1 -0
- package/dist/models/return-reason.d.ts +3 -3
- package/dist/models/return-reason.js.map +1 -1
- package/dist/models/return.d.ts +38 -0
- package/dist/models/return.js +213 -0
- package/dist/models/return.js.map +1 -0
- package/dist/models/shipping-method-adjustment.d.ts +2 -1
- package/dist/models/shipping-method-adjustment.js +1 -1
- package/dist/models/shipping-method-adjustment.js.map +1 -1
- package/dist/models/shipping-method-tax-line.d.ts +2 -1
- package/dist/models/shipping-method-tax-line.js +1 -1
- package/dist/models/shipping-method-tax-line.js.map +1 -1
- package/dist/models/shipping-method.js +1 -1
- package/dist/models/shipping-method.js.map +1 -1
- package/dist/models/tax-line.js.map +1 -1
- package/dist/models/transaction.d.ts +11 -2
- package/dist/models/transaction.js +80 -1
- package/dist/models/transaction.js.map +1 -1
- package/dist/repositories/claim.d.ts +8 -0
- package/dist/repositories/claim.js +11 -0
- package/dist/repositories/claim.js.map +1 -0
- package/dist/repositories/exchange.d.ts +8 -0
- package/dist/repositories/exchange.js +11 -0
- package/dist/repositories/exchange.js.map +1 -0
- package/dist/repositories/index.d.ts +3 -1
- package/dist/repositories/index.js +7 -16
- package/dist/repositories/index.js.map +1 -1
- package/dist/repositories/order.d.ts +0 -3
- package/dist/repositories/order.js +2 -83
- package/dist/repositories/order.js.map +1 -1
- package/dist/repositories/return.d.ts +8 -0
- package/dist/repositories/return.js +11 -0
- package/dist/repositories/return.js.map +1 -0
- package/dist/services/actions/cancel-fulfillment.d.ts +2 -0
- package/dist/services/actions/cancel-fulfillment.js +32 -0
- package/dist/services/actions/cancel-fulfillment.js.map +1 -0
- package/dist/services/actions/create-claim.d.ts +2 -0
- package/dist/services/actions/create-claim.js +229 -0
- package/dist/services/actions/create-claim.js.map +1 -0
- package/dist/services/actions/create-exchange.d.ts +2 -0
- package/dist/services/actions/create-exchange.js +194 -0
- package/dist/services/actions/create-exchange.js.map +1 -0
- package/dist/services/actions/create-return.d.ts +2 -0
- package/dist/services/actions/create-return.js +98 -0
- package/dist/services/actions/create-return.js.map +1 -0
- package/dist/services/actions/index.d.ts +7 -0
- package/dist/services/actions/index.js +24 -0
- package/dist/services/actions/index.js.map +1 -0
- package/dist/services/actions/receive-return.d.ts +2 -0
- package/dist/services/actions/receive-return.js +75 -0
- package/dist/services/actions/receive-return.js.map +1 -0
- package/dist/services/actions/register-fulfillment.d.ts +2 -0
- package/dist/services/actions/register-fulfillment.js +30 -0
- package/dist/services/actions/register-fulfillment.js.map +1 -0
- package/dist/services/actions/register-shipment.d.ts +2 -0
- package/dist/services/actions/register-shipment.js +38 -0
- package/dist/services/actions/register-shipment.js.map +1 -0
- package/dist/services/order-change-service.d.ts +6 -6
- package/dist/services/order-change-service.js +4 -3
- package/dist/services/order-change-service.js.map +1 -1
- package/dist/services/order-module-service.d.ts +101 -64
- package/dist/services/order-module-service.js +458 -295
- package/dist/services/order-module-service.js.map +1 -1
- package/dist/services/order-service.d.ts +4 -4
- package/dist/services/order-service.js +1 -1
- package/dist/services/order-service.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/order-change.d.ts +32 -0
- package/dist/types/order-change.js +34 -0
- package/dist/types/order-change.js.map +1 -0
- package/dist/types/utils/index.d.ts +25 -1
- package/dist/types/utils/index.js.map +1 -1
- package/dist/utils/actions/cancel-item-fulfillment.js +2 -0
- package/dist/utils/actions/cancel-item-fulfillment.js.map +1 -1
- package/dist/utils/actions/cancel-return.js +2 -0
- package/dist/utils/actions/cancel-return.js.map +1 -1
- package/dist/utils/actions/fulfill-item.js +2 -0
- package/dist/utils/actions/fulfill-item.js.map +1 -1
- package/dist/utils/actions/index.d.ts +1 -0
- package/dist/utils/actions/index.js +1 -0
- package/dist/utils/actions/index.js.map +1 -1
- package/dist/utils/actions/item-add.js +10 -7
- package/dist/utils/actions/item-add.js.map +1 -1
- package/dist/utils/actions/item-remove.js +6 -4
- package/dist/utils/actions/item-remove.js.map +1 -1
- package/dist/utils/actions/receive-damaged-return-item.js +2 -0
- package/dist/utils/actions/receive-damaged-return-item.js.map +1 -1
- package/dist/utils/actions/receive-return-item.js +2 -0
- package/dist/utils/actions/receive-return-item.js.map +1 -1
- package/dist/utils/actions/return-item.js +2 -0
- package/dist/utils/actions/return-item.js.map +1 -1
- package/dist/utils/actions/ship-item.js +2 -0
- package/dist/utils/actions/ship-item.js.map +1 -1
- package/dist/utils/actions/shipping-add.js +6 -2
- package/dist/utils/actions/shipping-add.js.map +1 -1
- package/dist/utils/actions/write-off-item.js +2 -0
- package/dist/utils/actions/write-off-item.js.map +1 -1
- package/dist/utils/apply-order-changes.d.ts +14 -0
- package/dist/utils/apply-order-changes.js +74 -0
- package/dist/utils/apply-order-changes.js.map +1 -0
- package/dist/utils/base-repository-find.d.ts +2 -0
- package/dist/utils/base-repository-find.js +117 -0
- package/dist/utils/base-repository-find.js.map +1 -0
- package/dist/utils/calculate-order-change.js +5 -1
- package/dist/utils/calculate-order-change.js.map +1 -1
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/set-action-reference.d.ts +1 -0
- package/dist/utils/set-action-reference.js +11 -0
- package/dist/utils/set-action-reference.js.map +1 -0
- package/dist/utils/transform-order.d.ts +3 -2
- package/dist/utils/transform-order.js +84 -17
- package/dist/utils/transform-order.js.map +1 -1
- package/package.json +7 -11
- package/dist/module-definition.d.ts +0 -2
- package/dist/module-definition.js +0 -9
- package/dist/module-definition.js.map +0 -1
- package/dist/scripts/bin/run-seed.d.ts +0 -3
- package/dist/scripts/bin/run-seed.js +0 -49
- package/dist/scripts/bin/run-seed.js.map +0 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
@@ -14,9 +14,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
15
|
};
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
|
17
|
+
exports.moduleDefinition = void 0;
|
18
|
+
const _services_1 = require("./services");
|
19
|
+
const service = _services_1.OrderModuleService;
|
20
|
+
exports.moduleDefinition = {
|
21
|
+
service,
|
22
|
+
};
|
18
23
|
__exportStar(require("./models"), exports);
|
19
24
|
__exportStar(require("./services"), exports);
|
20
25
|
__exportStar(require("./types"), exports);
|
21
|
-
exports.default =
|
26
|
+
exports.default = exports.moduleDefinition;
|
22
27
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,yCAA8C;AAE9C,MAAM,OAAO,GAAG,8BAAkB,CAAA;AAErB,QAAA,gBAAgB,GAAkB;IAC7C,OAAO;CACR,CAAA;AAED,2CAAwB;AACxB,6CAA0B;AAC1B,0CAAuB;AAEvB,kBAAe,wBAAgB,CAAA"}
|
package/dist/joiner-config.d.ts
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
import { ModuleJoinerConfig } from "@medusajs/types";
|
2
1
|
import { MapToConfig } from "@medusajs/utils";
|
3
|
-
export declare const
|
2
|
+
export declare const joinerConfig: Omit<import("@medusajs/types").ModuleJoinerConfig, "serviceName" | "primaryKeys" | "alias" | "linkableKeys"> & Required<Pick<import("@medusajs/types").ModuleJoinerConfig, "serviceName" | "primaryKeys" | "alias" | "linkableKeys">>;
|
4
3
|
export declare const entityNameToLinkableKeysMap: MapToConfig;
|
5
|
-
export declare const joinerConfig: ModuleJoinerConfig;
|
package/dist/joiner-config.js
CHANGED
@@ -1,46 +1,8 @@
|
|
1
1
|
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.
|
7
|
-
const modules_sdk_1 = require("@medusajs/modules-sdk");
|
3
|
+
exports.entityNameToLinkableKeysMap = exports.joinerConfig = void 0;
|
8
4
|
const utils_1 = require("@medusajs/utils");
|
9
|
-
|
10
|
-
|
11
|
-
exports.
|
12
|
-
order_id: order_1.default.name,
|
13
|
-
order_item_id: _models_1.LineItem.name,
|
14
|
-
return_reason_id: _models_1.ReturnReason.name,
|
15
|
-
return_reason_value: _models_1.ReturnReason.name,
|
16
|
-
};
|
17
|
-
const entityLinkableKeysMap = {};
|
18
|
-
Object.entries(exports.LinkableKeys).forEach(([key, value]) => {
|
19
|
-
entityLinkableKeysMap[value] ??= [];
|
20
|
-
entityLinkableKeysMap[value].push({
|
21
|
-
mapTo: key,
|
22
|
-
valueFrom: key.split("_").pop(),
|
23
|
-
});
|
24
|
-
});
|
25
|
-
exports.entityNameToLinkableKeysMap = entityLinkableKeysMap;
|
26
|
-
exports.joinerConfig = {
|
27
|
-
serviceName: modules_sdk_1.Modules.ORDER,
|
28
|
-
primaryKeys: ["id"],
|
29
|
-
linkableKeys: exports.LinkableKeys,
|
30
|
-
alias: [
|
31
|
-
{
|
32
|
-
name: ["order", "orders"],
|
33
|
-
args: {
|
34
|
-
entity: order_1.default.name,
|
35
|
-
},
|
36
|
-
},
|
37
|
-
{
|
38
|
-
name: ["return_reason", "return_reasons"],
|
39
|
-
args: {
|
40
|
-
entity: _models_1.ReturnReason.name,
|
41
|
-
methodSuffix: (0, utils_1.pluralize)(_models_1.ReturnReason.name),
|
42
|
-
},
|
43
|
-
},
|
44
|
-
],
|
45
|
-
};
|
5
|
+
// TODO: review configuration
|
6
|
+
exports.joinerConfig = (0, utils_1.defineJoinerConfig)(utils_1.Modules.ORDER);
|
7
|
+
exports.entityNameToLinkableKeysMap = (0, utils_1.buildEntitiesNameToLinkableKeysMap)(exports.joinerConfig.linkableKeys);
|
46
8
|
//# sourceMappingURL=joiner-config.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"joiner-config.js","sourceRoot":"","sources":["../src/joiner-config.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"joiner-config.js","sourceRoot":"","sources":["../src/joiner-config.ts"],"names":[],"mappings":";;;AAAA,2CAKwB;AAExB,6BAA6B;AAChB,QAAA,YAAY,GAAG,IAAA,0BAAkB,EAAC,eAAO,CAAC,KAAK,CAAC,CAAA;AAEhD,QAAA,2BAA2B,GACtC,IAAA,0CAAkC,EAAC,oBAAY,CAAC,YAAY,CAAC,CAAA"}
|
@@ -0,0 +1,364 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Migration20240604100512 = void 0;
|
4
|
+
const migrations_1 = require("@mikro-orm/migrations");
|
5
|
+
class Migration20240604100512 extends migrations_1.Migration {
|
6
|
+
async up() {
|
7
|
+
const sql = `
|
8
|
+
ALTER TABLE "order_change"
|
9
|
+
ADD COLUMN if NOT exists "change_type" TEXT NULL;
|
10
|
+
|
11
|
+
ALTER TABLE "order_change"
|
12
|
+
ADD COLUMN if NOT exists "deleted_at" timestamptz NULL;
|
13
|
+
|
14
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_change_change_type" ON "order_change" (
|
15
|
+
change_type
|
16
|
+
);
|
17
|
+
|
18
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_change_deleted_at" ON "order_change" (
|
19
|
+
deleted_at
|
20
|
+
);
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
ALTER TABLE "order_transaction"
|
26
|
+
ADD COLUMN if NOT exists "return_id" TEXT NULL;
|
27
|
+
|
28
|
+
ALTER TABLE "order_transaction"
|
29
|
+
ADD COLUMN if NOT exists "claim_id" TEXT NULL;
|
30
|
+
|
31
|
+
ALTER TABLE "order_transaction"
|
32
|
+
ADD COLUMN if NOT exists "exchange_id" TEXT NULL;
|
33
|
+
|
34
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_transaction_return_id" ON "order_transaction" (
|
35
|
+
return_id
|
36
|
+
)
|
37
|
+
WHERE return_id IS NOT NULL AND deleted_at IS NOT NULL;
|
38
|
+
|
39
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_transaction_claim_id" ON "order_transaction" (
|
40
|
+
claim_id
|
41
|
+
)
|
42
|
+
WHERE claim_id IS NOT NULL AND deleted_at IS NOT NULL;
|
43
|
+
|
44
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_transaction_exchange_id" ON "order_transaction" (
|
45
|
+
exchange_id
|
46
|
+
)
|
47
|
+
WHERE exchange_id IS NOT NULL AND deleted_at IS NOT NULL;
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
ALTER TABLE "order_shipping"
|
52
|
+
ADD COLUMN if NOT exists "return_id" TEXT NULL;
|
53
|
+
|
54
|
+
ALTER TABLE "order_shipping"
|
55
|
+
ADD COLUMN if NOT exists "claim_id" TEXT NULL;
|
56
|
+
|
57
|
+
ALTER TABLE "order_shipping"
|
58
|
+
ADD COLUMN if NOT exists "exchange_id" TEXT NULL;
|
59
|
+
|
60
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_shipping_return_id" ON "order_shipping" (
|
61
|
+
return_id
|
62
|
+
)
|
63
|
+
WHERE return_id IS NOT NULL AND deleted_at IS NOT NULL;
|
64
|
+
|
65
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_shipping_claim_id" ON "order_shipping" (
|
66
|
+
claim_id
|
67
|
+
)
|
68
|
+
WHERE claim_id IS NOT NULL AND deleted_at IS NOT NULL;
|
69
|
+
|
70
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_shipping_exchange_id" ON "order_shipping" (
|
71
|
+
exchange_id
|
72
|
+
)
|
73
|
+
WHERE exchange_id IS NOT NULL AND deleted_at IS NOT NULL;
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
ALTER TABLE "order_change"
|
79
|
+
ADD COLUMN if NOT exists "return_id" TEXT NULL;
|
80
|
+
|
81
|
+
ALTER TABLE "order_change"
|
82
|
+
ADD COLUMN if NOT exists "claim_id" TEXT NULL;
|
83
|
+
|
84
|
+
ALTER TABLE "order_change"
|
85
|
+
ADD COLUMN if NOT exists "exchange_id" TEXT NULL;
|
86
|
+
|
87
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_change_return_id" ON "order_change" (
|
88
|
+
return_id
|
89
|
+
)
|
90
|
+
WHERE return_id IS NOT NULL AND deleted_at IS NOT NULL;
|
91
|
+
|
92
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_change_claim_id" ON "order_change" (
|
93
|
+
claim_id
|
94
|
+
)
|
95
|
+
WHERE claim_id IS NOT NULL AND deleted_at IS NOT NULL;
|
96
|
+
|
97
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_change_exchange_id" ON "order_change" (
|
98
|
+
exchange_id
|
99
|
+
)
|
100
|
+
WHERE exchange_id IS NOT NULL AND deleted_at IS NOT NULL;
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
ALTER TABLE "order_change_action"
|
105
|
+
ADD COLUMN if NOT exists "deleted_at" timestamptz NULL;
|
106
|
+
|
107
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_change_action_deleted_at" ON "order_change_action" (
|
108
|
+
deleted_at
|
109
|
+
);
|
110
|
+
|
111
|
+
ALTER TABLE "order_change_action"
|
112
|
+
ADD COLUMN if NOT exists "return_id" TEXT NULL;
|
113
|
+
|
114
|
+
ALTER TABLE "order_change_action"
|
115
|
+
ADD COLUMN if NOT exists "claim_id" TEXT NULL;
|
116
|
+
|
117
|
+
ALTER TABLE "order_change_action"
|
118
|
+
ADD COLUMN if NOT exists "exchange_id" TEXT NULL;
|
119
|
+
|
120
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_change_action_return_id" ON "order_change_action" (
|
121
|
+
return_id
|
122
|
+
)
|
123
|
+
WHERE return_id IS NOT NULL AND deleted_at IS NOT NULL;
|
124
|
+
|
125
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_change_action_claim_id" ON "order_change_action" (
|
126
|
+
claim_id
|
127
|
+
)
|
128
|
+
WHERE claim_id IS NOT NULL AND deleted_at IS NOT NULL;
|
129
|
+
|
130
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_change_action_exchange_id" ON "order_change_action" (
|
131
|
+
exchange_id
|
132
|
+
)
|
133
|
+
WHERE exchange_id IS NOT NULL AND deleted_at IS NOT NULL;
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
CREATE TYPE return_status_enum AS ENUM (
|
138
|
+
'requested',
|
139
|
+
'received',
|
140
|
+
'partially_received',
|
141
|
+
'canceled'
|
142
|
+
);
|
143
|
+
|
144
|
+
CREATE TABLE IF NOT EXISTS "return" (
|
145
|
+
"id" TEXT NOT NULL,
|
146
|
+
"order_id" TEXT NOT NULL,
|
147
|
+
"claim_id" TEXT NULL,
|
148
|
+
"exchange_id" TEXT NULL,
|
149
|
+
"order_version" INTEGER NOT NULL,
|
150
|
+
"display_id" SERIAL,
|
151
|
+
"status" return_status_enum NOT NULL DEFAULT 'requested',
|
152
|
+
"no_notification" boolean NULL,
|
153
|
+
"refund_amount" NUMERIC NULL,
|
154
|
+
"raw_refund_amount" JSONB NULL,
|
155
|
+
"metadata" jsonb NULL,
|
156
|
+
"created_at" timestamptz NOT NULL DEFAULT now(),
|
157
|
+
"updated_at" timestamptz NOT NULL DEFAULT now(),
|
158
|
+
"deleted_at" timestamptz NULL,
|
159
|
+
"received_at" timestamptz NULL,
|
160
|
+
"canceled_at" timestamptz NULL,
|
161
|
+
CONSTRAINT "return_pkey" PRIMARY KEY ("id")
|
162
|
+
);
|
163
|
+
|
164
|
+
CREATE INDEX IF NOT EXISTS "IDX_return_order_id" ON "return" (
|
165
|
+
order_id
|
166
|
+
)
|
167
|
+
WHERE deleted_at IS NOT NULL;
|
168
|
+
|
169
|
+
CREATE INDEX IF NOT EXISTS "IDX_return_claim_id" ON "return" (
|
170
|
+
claim_id
|
171
|
+
)
|
172
|
+
WHERE claim_id IS NOT NULL AND deleted_at IS NOT NULL;
|
173
|
+
|
174
|
+
CREATE INDEX IF NOT EXISTS "IDX_return_exchange_id" ON "return" (
|
175
|
+
exchange_id
|
176
|
+
)
|
177
|
+
WHERE exchange_id IS NOT NULL AND deleted_at IS NOT NULL;
|
178
|
+
|
179
|
+
CREATE INDEX IF NOT EXISTS "IDX_return_display_id" ON "return" (
|
180
|
+
display_id
|
181
|
+
)
|
182
|
+
WHERE deleted_at IS NOT NULL;
|
183
|
+
|
184
|
+
|
185
|
+
CREATE TABLE IF NOT EXISTS "return_item" (
|
186
|
+
"id" TEXT NOT NULL,
|
187
|
+
"return_id" TEXT NOT NULL,
|
188
|
+
"reason_id" TEXT NULL,
|
189
|
+
"item_id" TEXT NOT NULL,
|
190
|
+
"quantity" NUMERIC NOT NULL,
|
191
|
+
"raw_quantity" JSONB NOT NULL,
|
192
|
+
"received_quantity" NUMERIC NOT NULL DEFAULT 0,
|
193
|
+
"raw_received_quantity" JSONB NOT NULL,
|
194
|
+
"note" TEXT NULL,
|
195
|
+
"metadata" JSONB NULL,
|
196
|
+
"created_at" timestamptz NOT NULL DEFAULT now(),
|
197
|
+
"updated_at" timestamptz NOT NULL DEFAULT now(),
|
198
|
+
"deleted_at" timestamptz NULL,
|
199
|
+
CONSTRAINT "return_item_pkey" PRIMARY KEY ("id")
|
200
|
+
);
|
201
|
+
|
202
|
+
CREATE INDEX IF NOT EXISTS "IDX_return_item_deleted_at" ON "return_item" ("deleted_at")
|
203
|
+
WHERE deleted_at IS NOT NULL;
|
204
|
+
|
205
|
+
CREATE INDEX IF NOT EXISTS "IDX_return_item_return_id" ON "return_item" ("return_id")
|
206
|
+
WHERE deleted_at IS NOT NULL;
|
207
|
+
|
208
|
+
CREATE INDEX IF NOT EXISTS "IDX_return_item_item_id" ON "return_item" ("item_id")
|
209
|
+
WHERE deleted_at IS NOT NULL;
|
210
|
+
|
211
|
+
CREATE INDEX IF NOT EXISTS "IDX_return_item_reason_id" ON "return_item" ("reason_id")
|
212
|
+
WHERE deleted_at IS NOT NULL;
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
CREATE TABLE IF NOT EXISTS "order_exchange" (
|
217
|
+
"id" TEXT NOT NULL,
|
218
|
+
"order_id" TEXT NOT NULL,
|
219
|
+
"return_id" TEXT NULL,
|
220
|
+
"order_version" INTEGER NOT NULL,
|
221
|
+
"display_id" SERIAL,
|
222
|
+
"no_notification" BOOLEAN NULL,
|
223
|
+
"allow_backorder" BOOLEAN NOT NULL DEFAULT FALSE,
|
224
|
+
"difference_due" NUMERIC NULL,
|
225
|
+
"raw_difference_due" JSONB NULL,
|
226
|
+
"metadata" JSONB NULL,
|
227
|
+
"created_at" timestamptz NOT NULL DEFAULT now(),
|
228
|
+
"updated_at" timestamptz NOT NULL DEFAULT now(),
|
229
|
+
"deleted_at" timestamptz NULL,
|
230
|
+
"canceled_at" timestamptz NULL,
|
231
|
+
CONSTRAINT "order_exchange_pkey" PRIMARY KEY ("id")
|
232
|
+
);
|
233
|
+
|
234
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_exchange_display_id" ON "order_exchange" ("display_id")
|
235
|
+
WHERE deleted_at IS NOT NULL;
|
236
|
+
|
237
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_exchange_deleted_at" ON "order_exchange" ("deleted_at")
|
238
|
+
WHERE deleted_at IS NOT NULL;
|
239
|
+
|
240
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_exchange_order_id" ON "order_exchange" ("order_id")
|
241
|
+
WHERE deleted_at IS NOT NULL;
|
242
|
+
|
243
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_exchange_return_id" ON "order_exchange" ("return_id")
|
244
|
+
WHERE return_id IS NOT NULL AND deleted_at IS NOT NULL;
|
245
|
+
|
246
|
+
|
247
|
+
CREATE TABLE IF NOT EXISTS "order_exchange_item" (
|
248
|
+
"id" TEXT NOT NULL,
|
249
|
+
"exchange_id" TEXT NOT NULL,
|
250
|
+
"item_id" TEXT NOT NULL,
|
251
|
+
"quantity" NUMERIC NOT NULL,
|
252
|
+
"raw_quantity" JSONB NOT NULL,
|
253
|
+
"note" TEXT NULL,
|
254
|
+
"metadata" JSONB NULL,
|
255
|
+
"created_at" timestamptz NOT NULL DEFAULT now(),
|
256
|
+
"updated_at" timestamptz NOT NULL DEFAULT now(),
|
257
|
+
"deleted_at" timestamptz NULL,
|
258
|
+
CONSTRAINT "order_exchange_item_pkey" PRIMARY KEY ("id")
|
259
|
+
);
|
260
|
+
|
261
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_exchange_item_deleted_at" ON "order_exchange_item" ("deleted_at")
|
262
|
+
WHERE deleted_at IS NOT NULL;
|
263
|
+
|
264
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_exchange_item_exchange_id" ON "order_exchange_item" ("exchange_id")
|
265
|
+
WHERE deleted_at IS NOT NULL;
|
266
|
+
|
267
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_exchange_item_item_id" ON "order_exchange_item" ("item_id")
|
268
|
+
WHERE deleted_at IS NOT NULL;
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
CREATE TYPE order_claim_type_enum AS ENUM (
|
273
|
+
'refund',
|
274
|
+
'replace'
|
275
|
+
);
|
276
|
+
|
277
|
+
CREATE TABLE IF NOT EXISTS "order_claim" (
|
278
|
+
"id" TEXT NOT NULL,
|
279
|
+
"order_id" TEXT NOT NULL,
|
280
|
+
"return_id" TEXT NULL,
|
281
|
+
"order_version" INTEGER NOT NULL,
|
282
|
+
"display_id" SERIAL,
|
283
|
+
"type" order_claim_type_enum NOT NULL,
|
284
|
+
"no_notification" BOOLEAN NULL,
|
285
|
+
"refund_amount" NUMERIC NULL,
|
286
|
+
"raw_refund_amount" JSONB NULL,
|
287
|
+
"metadata" JSONB NULL,
|
288
|
+
"created_at" timestamptz NOT NULL DEFAULT now(),
|
289
|
+
"updated_at" timestamptz NOT NULL DEFAULT now(),
|
290
|
+
"deleted_at" timestamptz NULL,
|
291
|
+
"canceled_at" timestamptz NULL,
|
292
|
+
CONSTRAINT "order_claim_pkey" PRIMARY KEY ("id")
|
293
|
+
);
|
294
|
+
|
295
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_claim_display_id" ON "order_claim" ("display_id")
|
296
|
+
WHERE deleted_at IS NOT NULL;
|
297
|
+
|
298
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_claim_deleted_at" ON "order_claim" ("deleted_at")
|
299
|
+
WHERE deleted_at IS NOT NULL;
|
300
|
+
|
301
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_claim_order_id" ON "order_claim" ("order_id")
|
302
|
+
WHERE deleted_at IS NOT NULL;
|
303
|
+
|
304
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_claim_return_id" ON "order_claim" ("return_id")
|
305
|
+
WHERE return_id IS NOT NULL AND deleted_at IS NOT NULL;
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
CREATE TYPE claim_reason_enum AS ENUM (
|
310
|
+
'missing_item',
|
311
|
+
'wrong_item',
|
312
|
+
'production_failure',
|
313
|
+
'other'
|
314
|
+
);
|
315
|
+
|
316
|
+
CREATE TABLE IF NOT EXISTS "order_claim_item" (
|
317
|
+
"id" TEXT NOT NULL,
|
318
|
+
"claim_id" TEXT NOT NULL,
|
319
|
+
"item_id" TEXT NOT NULL,
|
320
|
+
"is_additional_item" BOOLEAN NOT NULL DEFAULT FALSE,
|
321
|
+
"reason" claim_reason_enum NULL,
|
322
|
+
"quantity" NUMERIC NOT NULL,
|
323
|
+
"raw_quantity" JSONB NOT NULL,
|
324
|
+
"note" TEXT NULL,
|
325
|
+
"metadata" JSONB NULL,
|
326
|
+
"created_at" timestamptz NOT NULL DEFAULT now(),
|
327
|
+
"updated_at" timestamptz NOT NULL DEFAULT now(),
|
328
|
+
"deleted_at" timestamptz NULL,
|
329
|
+
CONSTRAINT "order_claim_item_pkey" PRIMARY KEY ("id")
|
330
|
+
);
|
331
|
+
|
332
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_claim_item_deleted_at" ON "order_claim_item" ("deleted_at")
|
333
|
+
WHERE deleted_at IS NOT NULL;
|
334
|
+
|
335
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_claim_item_claim_id" ON "order_claim_item" ("claim_id")
|
336
|
+
WHERE deleted_at IS NOT NULL;
|
337
|
+
|
338
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_claim_item_item_id" ON "order_claim_item" ("item_id")
|
339
|
+
WHERE deleted_at IS NOT NULL;
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
CREATE TABLE IF NOT EXISTS "order_claim_item_image" (
|
344
|
+
"id" TEXT NOT NULL,
|
345
|
+
"claim_item_id" TEXT NOT NULL,
|
346
|
+
"url" TEXT NOT NULL,
|
347
|
+
"metadata" JSONB NULL,
|
348
|
+
"created_at" timestamptz NOT NULL DEFAULT now(),
|
349
|
+
"updated_at" timestamptz NOT NULL DEFAULT now(),
|
350
|
+
"deleted_at" timestamptz NULL,
|
351
|
+
CONSTRAINT "order_claim_item_image_pkey" PRIMARY KEY ("id")
|
352
|
+
);
|
353
|
+
|
354
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_claim_item_image_claim_item_id" ON "order_claim_item_image" ("claim_item_id")
|
355
|
+
WHERE "deleted_at" IS NOT NULL;
|
356
|
+
|
357
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_claim_item_image_deleted_at" ON "order_claim_item_image" ("deleted_at")
|
358
|
+
WHERE "deleted_at" IS NOT NULL;
|
359
|
+
`;
|
360
|
+
this.addSql(sql);
|
361
|
+
}
|
362
|
+
}
|
363
|
+
exports.Migration20240604100512 = Migration20240604100512;
|
364
|
+
//# sourceMappingURL=Migration20240604100512.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Migration20240604100512.js","sourceRoot":"","sources":["../../src/migrations/Migration20240604100512.ts"],"names":[],"mappings":";;;AAAA,sDAAiD;AAEjD,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,MAAM,GAAG,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgWX,CAAA;QACD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAClB,CAAC;CACF;AArWD,0DAqWC"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { DAL } from "@medusajs/types";
|
2
|
+
import { OptionalProps, Rel } from "@mikro-orm/core";
|
3
|
+
import ClaimItem from "./claim-item";
|
4
|
+
type OptionalClaimItemImageProps = DAL.EntityDateColumns;
|
5
|
+
export default class ClaimItemImage {
|
6
|
+
[OptionalProps]?: OptionalClaimItemImageProps;
|
7
|
+
id: string;
|
8
|
+
claim_item_id: string;
|
9
|
+
item: Rel<ClaimItem>;
|
10
|
+
url: string;
|
11
|
+
metadata: Record<string, unknown> | null;
|
12
|
+
created_at: Date;
|
13
|
+
updated_at: Date;
|
14
|
+
deleted_at: Date | null;
|
15
|
+
onCreate(): void;
|
16
|
+
onInit(): void;
|
17
|
+
}
|
18
|
+
export {};
|
@@ -0,0 +1,108 @@
|
|
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 claim_item_1 = __importDefault(require("./claim-item"));
|
18
|
+
const ClaimItemImageDeletedAtIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
19
|
+
tableName: "order_claim_item_image",
|
20
|
+
columns: "deleted_at",
|
21
|
+
where: "deleted_at IS NOT NULL",
|
22
|
+
});
|
23
|
+
const ClaimItemIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
24
|
+
tableName: "order_claim_item_image",
|
25
|
+
columns: ["claim_item_id"],
|
26
|
+
where: "deleted_at IS NOT NULL",
|
27
|
+
});
|
28
|
+
let ClaimItemImage = class ClaimItemImage {
|
29
|
+
constructor() {
|
30
|
+
this.metadata = null;
|
31
|
+
this.deleted_at = null;
|
32
|
+
}
|
33
|
+
onCreate() {
|
34
|
+
this.id = (0, utils_1.generateEntityId)(this.id, "climg");
|
35
|
+
this.claim_item_id = this.item?.id;
|
36
|
+
}
|
37
|
+
onInit() {
|
38
|
+
this.id = (0, utils_1.generateEntityId)(this.id, "climg");
|
39
|
+
this.claim_item_id = this.item?.id;
|
40
|
+
}
|
41
|
+
};
|
42
|
+
__decorate([
|
43
|
+
(0, core_1.PrimaryKey)({ columnType: "text" }),
|
44
|
+
__metadata("design:type", String)
|
45
|
+
], ClaimItemImage.prototype, "id", void 0);
|
46
|
+
__decorate([
|
47
|
+
(0, core_1.ManyToOne)({
|
48
|
+
entity: () => claim_item_1.default,
|
49
|
+
mapToPk: true,
|
50
|
+
fieldName: "claim_item_id",
|
51
|
+
columnType: "text",
|
52
|
+
}),
|
53
|
+
ClaimItemIdIndex.MikroORMIndex(),
|
54
|
+
__metadata("design:type", String)
|
55
|
+
], ClaimItemImage.prototype, "claim_item_id", void 0);
|
56
|
+
__decorate([
|
57
|
+
(0, core_1.ManyToOne)(() => claim_item_1.default, {
|
58
|
+
persist: false,
|
59
|
+
}),
|
60
|
+
__metadata("design:type", Object)
|
61
|
+
], ClaimItemImage.prototype, "item", void 0);
|
62
|
+
__decorate([
|
63
|
+
(0, core_1.Property)({ columnType: "text" }),
|
64
|
+
__metadata("design:type", String)
|
65
|
+
], ClaimItemImage.prototype, "url", void 0);
|
66
|
+
__decorate([
|
67
|
+
(0, core_1.Property)({ columnType: "jsonb", nullable: true }),
|
68
|
+
__metadata("design:type", Object)
|
69
|
+
], ClaimItemImage.prototype, "metadata", void 0);
|
70
|
+
__decorate([
|
71
|
+
(0, core_1.Property)({
|
72
|
+
onCreate: () => new Date(),
|
73
|
+
columnType: "timestamptz",
|
74
|
+
defaultRaw: "now()",
|
75
|
+
}),
|
76
|
+
__metadata("design:type", Date)
|
77
|
+
], ClaimItemImage.prototype, "created_at", void 0);
|
78
|
+
__decorate([
|
79
|
+
(0, core_1.Property)({
|
80
|
+
onCreate: () => new Date(),
|
81
|
+
onUpdate: () => new Date(),
|
82
|
+
columnType: "timestamptz",
|
83
|
+
defaultRaw: "now()",
|
84
|
+
}),
|
85
|
+
__metadata("design:type", Date)
|
86
|
+
], ClaimItemImage.prototype, "updated_at", void 0);
|
87
|
+
__decorate([
|
88
|
+
(0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
|
89
|
+
ClaimItemImageDeletedAtIndex.MikroORMIndex(),
|
90
|
+
__metadata("design:type", Object)
|
91
|
+
], ClaimItemImage.prototype, "deleted_at", void 0);
|
92
|
+
__decorate([
|
93
|
+
(0, core_1.BeforeCreate)(),
|
94
|
+
__metadata("design:type", Function),
|
95
|
+
__metadata("design:paramtypes", []),
|
96
|
+
__metadata("design:returntype", void 0)
|
97
|
+
], ClaimItemImage.prototype, "onCreate", null);
|
98
|
+
__decorate([
|
99
|
+
(0, core_1.OnInit)(),
|
100
|
+
__metadata("design:type", Function),
|
101
|
+
__metadata("design:paramtypes", []),
|
102
|
+
__metadata("design:returntype", void 0)
|
103
|
+
], ClaimItemImage.prototype, "onInit", null);
|
104
|
+
ClaimItemImage = __decorate([
|
105
|
+
(0, core_1.Entity)({ tableName: "order_claim_item_image" })
|
106
|
+
], ClaimItemImage);
|
107
|
+
exports.default = ClaimItemImage;
|
108
|
+
//# sourceMappingURL=claim-item-image.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"claim-item-image.js","sourceRoot":"","sources":["../../src/models/claim-item-image.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,2CAGwB;AACxB,0CASwB;AACxB,8DAAoC;AAIpC,MAAM,4BAA4B,GAAG,IAAA,sCAA8B,EAAC;IAClE,SAAS,EAAE,wBAAwB;IACnC,OAAO,EAAE,YAAY;IACrB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM,gBAAgB,GAAG,IAAA,sCAA8B,EAAC;IACtD,SAAS,EAAE,wBAAwB;IACnC,OAAO,EAAE,CAAC,eAAe,CAAC;IAC1B,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAGa,IAAM,cAAc,GAApB,MAAM,cAAc;IAApB;QAwBb,aAAQ,GAAmC,IAAI,CAAA;QAmB/C,eAAU,GAAgB,IAAI,CAAA;IAahC,CAAC;IAVC,QAAQ;QACN,IAAI,CAAC,EAAE,GAAG,IAAA,wBAAgB,EAAC,IAAI,CAAC,EAAE,EAAE,OAAO,CAAC,CAAA;QAC5C,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,IAAI,EAAE,EAAE,CAAA;IACpC,CAAC;IAGD,MAAM;QACJ,IAAI,CAAC,EAAE,GAAG,IAAA,wBAAgB,EAAC,IAAI,CAAC,EAAE,EAAE,OAAO,CAAC,CAAA;QAC5C,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,IAAI,EAAE,EAAE,CAAA;IACpC,CAAC;CACF,CAAA;AApDC;IADC,IAAA,iBAAU,EAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;;0CACzB;AASV;IAPC,IAAA,gBAAS,EAAC;QACT,MAAM,EAAE,GAAG,EAAE,CAAC,oBAAS;QACvB,OAAO,EAAE,IAAI;QACb,SAAS,EAAE,eAAe;QAC1B,UAAU,EAAE,MAAM;KACnB,CAAC;IACD,gBAAgB,CAAC,aAAa,EAAE;;qDACZ;AAKrB;IAHC,IAAA,gBAAS,EAAC,GAAG,EAAE,CAAC,oBAAS,EAAE;QAC1B,OAAO,EAAE,KAAK;KACf,CAAC;;4CACkB;AAGpB;IADC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;;2CACtB;AAGX;IADC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACH;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;kDAAA;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;kDAAA;AAIhB;IAFC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACvD,4BAA4B,CAAC,aAAa,EAAE;;kDACf;AAG9B;IADC,IAAA,mBAAY,GAAE;;;;8CAId;AAGD;IADC,IAAA,aAAM,GAAE;;;;4CAIR;AAvDkB,cAAc;IADlC,IAAA,aAAM,EAAC,EAAE,SAAS,EAAE,wBAAwB,EAAE,CAAC;GAC3B,cAAc,CAwDlC;kBAxDoB,cAAc"}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { BigNumberRawValue, DAL } from "@medusajs/types";
|
2
|
+
import { ClaimReason } from "@medusajs/utils";
|
3
|
+
import { Collection, OptionalProps, Rel } from "@mikro-orm/core";
|
4
|
+
import Claim from "./claim";
|
5
|
+
import ClaimItemImage from "./claim-item-image";
|
6
|
+
import LineItem from "./line-item";
|
7
|
+
type OptionalLineItemProps = DAL.EntityDateColumns;
|
8
|
+
export default class OrderClaimItem {
|
9
|
+
[OptionalProps]?: OptionalLineItemProps;
|
10
|
+
id: string;
|
11
|
+
images: Collection<ClaimItemImage, object>;
|
12
|
+
reason: Rel<ClaimReason> | null;
|
13
|
+
quantity: Number | number;
|
14
|
+
raw_quantity: BigNumberRawValue;
|
15
|
+
claim_id: string;
|
16
|
+
claim: Rel<Claim>;
|
17
|
+
item_id: string;
|
18
|
+
item: Rel<LineItem>;
|
19
|
+
is_additional_item: boolean;
|
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 {};
|