@pinelab/vendure-plugin-qls-fulfillment 1.0.0-beta.12 → 1.0.0-beta.14
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.
package/dist/custom-fields.d.ts
CHANGED
|
@@ -3,6 +3,10 @@ declare module '@vendure/core' {
|
|
|
3
3
|
interface CustomProductVariantFields {
|
|
4
4
|
qlsProductId?: string;
|
|
5
5
|
}
|
|
6
|
+
interface CustomOrderFields {
|
|
7
|
+
qlsServicePointId?: string;
|
|
8
|
+
qlsServicePointDetails?: string;
|
|
9
|
+
}
|
|
6
10
|
}
|
|
7
11
|
export declare const variantCustomFields: CustomFieldConfig[];
|
|
8
12
|
export declare const orderCustomFields: CustomFieldConfig[];
|
package/dist/custom-fields.js
CHANGED
|
@@ -23,6 +23,28 @@ exports.orderCustomFields = [
|
|
|
23
23
|
readonly: false,
|
|
24
24
|
ui: { tab: 'QLS' },
|
|
25
25
|
},
|
|
26
|
+
{
|
|
27
|
+
name: 'syncedToQls',
|
|
28
|
+
type: 'boolean',
|
|
29
|
+
label: [
|
|
30
|
+
{ value: 'Created in QLS', languageCode: core_1.LanguageCode.en },
|
|
31
|
+
{ value: 'Aangemaakt in QLS', languageCode: core_1.LanguageCode.nl },
|
|
32
|
+
],
|
|
33
|
+
description: [
|
|
34
|
+
{
|
|
35
|
+
value: 'Uncheck this to be able to push the order to QLS again',
|
|
36
|
+
languageCode: core_1.LanguageCode.en,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
value: 'Vink dit uit om de order opnieuw naar QLS te sturen',
|
|
40
|
+
languageCode: core_1.LanguageCode.nl,
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
nullable: true,
|
|
44
|
+
public: true,
|
|
45
|
+
readonly: false,
|
|
46
|
+
ui: { tab: 'QLS' },
|
|
47
|
+
},
|
|
26
48
|
{
|
|
27
49
|
name: 'qlsServicePointDetails',
|
|
28
50
|
type: 'string',
|
|
@@ -115,12 +115,12 @@ let QlsOrderService = class QlsOrderService {
|
|
|
115
115
|
const qlsOrder = {
|
|
116
116
|
customer_reference: order.code,
|
|
117
117
|
processable: new Date().toISOString(), // Processable starting now
|
|
118
|
-
servicepoint_code:
|
|
118
|
+
servicepoint_code: order.customFields?.qlsServicePointId,
|
|
119
119
|
delivery_options: additionalOrderFields?.delivery_options ?? [],
|
|
120
120
|
total_price: order.totalWithTax,
|
|
121
121
|
receiver_contact: {
|
|
122
122
|
name: order.shippingAddress.fullName || customerName,
|
|
123
|
-
companyname: order.shippingAddress.company,
|
|
123
|
+
companyname: order.shippingAddress.company ?? customerName,
|
|
124
124
|
street: order.shippingAddress.streetLine1,
|
|
125
125
|
housenumber: order.shippingAddress.streetLine2,
|
|
126
126
|
postalcode: order.shippingAddress.postalCode,
|
|
@@ -183,7 +183,7 @@ let QlsOrderService = class QlsOrderService {
|
|
|
183
183
|
action: 'push-order',
|
|
184
184
|
ctx: ctx.serialize(),
|
|
185
185
|
orderId,
|
|
186
|
-
}, { retries:
|
|
186
|
+
}, { retries: 3 });
|
|
187
187
|
}
|
|
188
188
|
async getServicePoints(ctx, input) {
|
|
189
189
|
const client = await (0, qls_client_1.getQlsClient)(ctx, this.options);
|
|
@@ -225,7 +225,7 @@ let QlsProductService = class QlsProductService {
|
|
|
225
225
|
action: 'sync-products',
|
|
226
226
|
ctx: ctx.serialize(),
|
|
227
227
|
productVariantIds,
|
|
228
|
-
}, { retries:
|
|
228
|
+
}, { retries: 1 });
|
|
229
229
|
}
|
|
230
230
|
/**
|
|
231
231
|
* Update the stock level for a variant based on the given available stock
|