Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shopify: Add new sources for fulfillment orders (request accepted/rejected) #7122

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions components/shopify/sources/common/constants.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,22 @@ const EVENT_TOPIC = {
FULFILLMENT_EVENTS_DELETE: "fulfillment_events/delete",
FULFILLMENTS_CREATE: "fulfillments/create",
FULFILLMENTS_UPDATE: "fulfillments/update",
FULFILLMENT_ORDERS_CANCELLATION_REQUEST_ACCEPTED: "fulfillment_orders/cancellation_request_accepted",
FULFILLMENT_ORDERS_CANCELLATION_REQUEST_REJECTED: "fulfillment_orders/cancellation_request_rejected",
FULFILLMENT_ORDERS_CANCELLATION_REQUEST_SUBMITTED: "fulfillment_orders/cancellation_request_submitted",
FULFILLMENT_ORDERS_CANCELLED: "fulfillment_orders/cancelled",
FULFILLMENT_ORDERS_FULFILLMENT_REQUEST_ACCEPTED: "fulfillment_orders/fulfillment_request_accepted",
FULFILLMENT_ORDERS_FULFILLMENT_REQUEST_REJECTED: "fulfillment_orders/fulfillment_request_rejected",
FULFILLMENT_ORDERS_FULFILLMENT_REQUEST_SUBMITTED: "fulfillment_orders/fulfillment_request_submitted",
FULFILLMENT_ORDERS_FULFILLMENT_SERVICE_FAILED_TO_COMPLETE: "fulfillment_orders/fulfillment_service_failed_to_complete",
FULFILLMENT_ORDERS_HOLD_RELEASED: "fulfillment_orders/hold_released",
FULFILLMENT_ORDERS_LINE_ITEMS_PREPARED_FOR_LOCAL_DELIVERY: "fulfillment_orders/line_items_prepared_for_local_delivery",
FULFILLMENT_ORDERS_LINE_ITEMS_PREPARED_FOR_PICKUP: "fulfillment_orders/line_items_prepared_for_pickup",
FULFILLMENT_ORDERS_MOVED: "fulfillment_orders/moved",
FULFILLMENT_ORDERS_ORDER_ROUTING_COMPLETE: "fulfillment_orders/order_routing_complete",
FULFILLMENT_ORDERS_PLACED_ON_HOLD: "fulfillment_orders/placed_on_hold",
FULFILLMENT_ORDERS_RESCHEDULED: "fulfillment_orders/rescheduled",
FULFILLMENT_ORDERS_SCHEDULED_FULFILLMENT_ORDER_READY: "fulfillment_orders/scheduled_fulfillment_order_ready",
INVENTORY_ITEMS_CREATE: "inventory_items/create",
INVENTORY_ITEMS_DELETE: "inventory_items/delete",
INVENTORY_ITEMS_UPDATE: "inventory_items/update",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import common from "../common/webhook.mjs";
import constants from "../common/constants.mjs";

export default {
...common,
key: "shopify-fulfillment-request-accepted",
name: "Fulfillment Request Accepted (Instant)",
type: "source",
description: "Emit when a fulfillment service accepts a fulfillment request that was sent by a merchant.",
version: "0.0.1",
dedupe: "unique",
methods: {
...common.methods,
getTopic() {
return constants.EVENT_TOPIC.FULFILLMENT_ORDERS_FULFILLMENT_REQUEST_ACCEPTED;
},
generateMeta(resource) {
return {
id: resource.fulfillment_order.id,
summary: `Fulfillment request accepted for fulfillment order ${resource.fulfillment_order.id}`,
ts: Date.now(),
};
},
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import common from "../common/webhook.mjs";
import constants from "../common/constants.mjs";

export default {
...common,
key: "shopify-fulfillment-request-rejected",
name: "Fulfillment Request Rejected (Instant)",
type: "source",
description: "Emit when a fulfillment service rejects a fulfillment request that was sent by a merchant.",
version: "0.0.1",
dedupe: "unique",
methods: {
...common.methods,
getTopic() {
return constants.EVENT_TOPIC.FULFILLMENT_ORDERS_FULFILLMENT_REQUEST_REJECTED;
},
generateMeta(resource) {
return {
id: resource.fulfillment_order.id,
summary: `Fulfillment request rejected for fulfillment order ${resource.fulfillment_order.id}`,
ts: Date.now(),
};
},
},
};