@porulle/plugin-channel-connector 0.77.0 → 0.78.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.
package/dist/service.js CHANGED
@@ -4645,8 +4645,10 @@ export class ChannelConnectorService {
4645
4645
  if (!remoteStatus.ok) {
4646
4646
  return this.transitionExport(orgId, created.value.id, "failed", requireUserId(actor), remoteStatus.error.message, remoteStatus.error.retriable === true ? "transient" : "definitive");
4647
4647
  }
4648
- if (remoteStatus.value.status === "confirmed") {
4649
- return this.transitionExport(orgId, created.value.id, "confirmed", requireUserId(actor), "Remote order confirmed.");
4648
+ // `fulfilled` is a received order too: WooCommerce completes virtual and downloadable orders on
4649
+ // arrival, and an export waiting for `confirmed` would wait forever.
4650
+ if (remoteStatus.value.status === "confirmed" || remoteStatus.value.status === "fulfilled") {
4651
+ return this.transitionExport(orgId, created.value.id, "confirmed", requireUserId(actor), remoteStatus.value.status === "fulfilled" ? "Remote order received and completed by the store." : "Remote order confirmed.");
4650
4652
  }
4651
4653
  if (remoteStatus.value.status === "failed" || remoteStatus.value.status === "cancelled") {
4652
4654
  return this.transitionExport(orgId, created.value.id, "failed", requireUserId(actor), `Remote order status: ${remoteStatus.value.status}.`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@porulle/plugin-channel-connector",
3
- "version": "0.77.0",
3
+ "version": "0.78.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -22,7 +22,7 @@
22
22
  "dependencies": {
23
23
  "@hono/zod-openapi": "^1.2.2",
24
24
  "hono": "^4.12.5",
25
- "@porulle/core": "0.77.0"
25
+ "@porulle/core": "0.78.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/node": "^24.5.2",
package/src/service.ts CHANGED
@@ -5843,13 +5843,15 @@ export class ChannelConnectorService {
5843
5843
  remoteStatus.error.retriable === true ? "transient" : "definitive",
5844
5844
  );
5845
5845
  }
5846
- if (remoteStatus.value.status === "confirmed") {
5846
+ // `fulfilled` is a received order too: WooCommerce completes virtual and downloadable orders on
5847
+ // arrival, and an export waiting for `confirmed` would wait forever.
5848
+ if (remoteStatus.value.status === "confirmed" || remoteStatus.value.status === "fulfilled") {
5847
5849
  return this.transitionExport(
5848
5850
  orgId,
5849
5851
  created.value.id,
5850
5852
  "confirmed",
5851
5853
  requireUserId(actor),
5852
- "Remote order confirmed.",
5854
+ remoteStatus.value.status === "fulfilled" ? "Remote order received and completed by the store." : "Remote order confirmed.",
5853
5855
  );
5854
5856
  }
5855
5857
  if (remoteStatus.value.status === "failed" || remoteStatus.value.status === "cancelled") {