@reactionary/source 0.2.18 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(npx nx build:*)",
|
|
5
|
+
"Bash(npx tsc:*)",
|
|
6
|
+
"Bash(npx nx lint:*)",
|
|
7
|
+
"Bash(npx nx test:*)",
|
|
8
|
+
"Bash(npx nx run:*)",
|
|
9
|
+
"Bash(npx ts-node:*)",
|
|
10
|
+
"Bash(npx tsx:*)",
|
|
11
|
+
"Bash(grep:*)",
|
|
12
|
+
"Bash(pnpm list:*)",
|
|
13
|
+
"Bash(npx nx affected:build:*)",
|
|
14
|
+
"Bash(npx nx affected:lint:*)",
|
|
15
|
+
"Bash(cat:*)",
|
|
16
|
+
"Bash(npx nx show projects:*)",
|
|
17
|
+
"Bash(npx nx g:*)",
|
|
18
|
+
"Bash(pnpm add:*)",
|
|
19
|
+
"Bash(npx nx show project:*)",
|
|
20
|
+
"Bash(npx nx reset:*)",
|
|
21
|
+
"WebSearch",
|
|
22
|
+
"Bash(node:*)",
|
|
23
|
+
"Bash(npm view:*)"
|
|
24
|
+
],
|
|
25
|
+
"deny": [],
|
|
26
|
+
"ask": []
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reactionary/examples-node",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "src/index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@reactionary/core": "0.
|
|
8
|
-
"@reactionary/provider-commercetools": "0.
|
|
9
|
-
"@reactionary/provider-algolia": "0.
|
|
10
|
-
"@reactionary/provider-medusa": "0.
|
|
11
|
-
"@reactionary/provider-meilisearch": "0.
|
|
7
|
+
"@reactionary/core": "0.3.0",
|
|
8
|
+
"@reactionary/provider-commercetools": "0.3.0",
|
|
9
|
+
"@reactionary/provider-algolia": "0.3.0",
|
|
10
|
+
"@reactionary/provider-medusa": "0.3.0",
|
|
11
|
+
"@reactionary/provider-meilisearch": "0.3.0"
|
|
12
12
|
},
|
|
13
13
|
"type": "module"
|
|
14
14
|
}
|
|
@@ -10,7 +10,7 @@ const testData = {
|
|
|
10
10
|
email: 'eileen.harvey@example.com',
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
describe.each([PrimaryProvider.MEILISEARCH])(
|
|
13
|
+
describe.each([PrimaryProvider.COMMERCETOOLS, PrimaryProvider.MEILISEARCH])(
|
|
14
14
|
'Order Search Capability - %s',
|
|
15
15
|
(provider) => {
|
|
16
16
|
let client: ReturnType<typeof createClient>;
|
package/package.json
CHANGED
|
@@ -77,19 +77,20 @@ export class CommercetoolsOrderSearchProvider extends OrderSearchProvider {
|
|
|
77
77
|
|
|
78
78
|
if (payload.search.orderStatus) {
|
|
79
79
|
const orderStatusWhere = payload.search.orderStatus.map(x => {
|
|
80
|
+
let mappedStatus = 'Open';
|
|
80
81
|
if (x === 'AwaitingPayment') {
|
|
81
|
-
|
|
82
|
+
mappedStatus = `Open`
|
|
82
83
|
}
|
|
83
84
|
if (x === 'ReleasedToFulfillment') {
|
|
84
|
-
|
|
85
|
+
mappedStatus = `Confirmed`
|
|
85
86
|
}
|
|
86
87
|
if (x === 'Shipped') {
|
|
87
|
-
|
|
88
|
+
mappedStatus = `Complete`
|
|
88
89
|
}
|
|
89
90
|
if (x === 'Cancelled') {
|
|
90
|
-
|
|
91
|
+
mappedStatus = `Cancelled`
|
|
91
92
|
}
|
|
92
|
-
return `orderState="${
|
|
93
|
+
return `orderState="${mappedStatus}"`
|
|
93
94
|
}).join(' OR ');
|
|
94
95
|
where.push(orderStatusWhere);
|
|
95
96
|
}
|
|
@@ -173,7 +174,14 @@ export class CommercetoolsOrderSearchProvider extends OrderSearchProvider {
|
|
|
173
174
|
) {
|
|
174
175
|
orderStatus = 'Shipped';
|
|
175
176
|
}
|
|
176
|
-
|
|
177
|
+
let inventoryStatus: OrderSearchResultItem['inventoryStatus'];
|
|
178
|
+
|
|
179
|
+
if (orderStatus === 'Shipped') {
|
|
180
|
+
inventoryStatus = 'Allocated'
|
|
181
|
+
} else {
|
|
182
|
+
inventoryStatus = 'NotAllocated'
|
|
183
|
+
}
|
|
184
|
+
|
|
177
185
|
const totalAmount: MonetaryAmount = {
|
|
178
186
|
currency: body.totalPrice ? body.totalPrice.currencyCode as Currency : this.context.languageContext.currencyCode,
|
|
179
187
|
value: body.totalPrice ? body.totalPrice.centAmount / 100 : 0
|