@pinelab/vendure-plugin-qls-fulfillment 1.0.0-beta.14 → 1.0.0-beta.15
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
package/dist/custom-fields.js
CHANGED
|
@@ -82,6 +82,9 @@ let QlsOrderService = class QlsOrderService {
|
|
|
82
82
|
if (!order) {
|
|
83
83
|
throw new Error(`No order with id ${orderId} not found`);
|
|
84
84
|
}
|
|
85
|
+
if (order.customFields.syncedToQls) {
|
|
86
|
+
throw new core_2.UserInputError(`Order '${order.code}' has already been synced to QLS`);
|
|
87
|
+
}
|
|
85
88
|
try {
|
|
86
89
|
// Check if all products are available in QLS
|
|
87
90
|
const qlsProducts = order.lines.map((line) => {
|
|
@@ -133,6 +136,9 @@ let QlsOrderService = class QlsOrderService {
|
|
|
133
136
|
...(additionalOrderFields ?? {}),
|
|
134
137
|
};
|
|
135
138
|
const result = await client.createFulfillmentOrder(qlsOrder);
|
|
139
|
+
await this.orderService.updateCustomFields(ctx, orderId, {
|
|
140
|
+
syncedToQls: true,
|
|
141
|
+
});
|
|
136
142
|
core_2.Logger.info(`Successfully created order '${order.code}' in QLS with id '${result.id}'`, constants_1.loggerCtx);
|
|
137
143
|
await this.orderService.addNoteToOrder(ctx, {
|
|
138
144
|
id: orderId,
|