Skip to content

Commit

Permalink
Merge pull request #45 from hotwax/develop
Browse files Browse the repository at this point in the history
Merge develop into main for v1.3.0 release
  • Loading branch information
mridulpathak authored Jan 25, 2024
2 parents 094f219 + c2fb37b commit 9d954ab
Show file tree
Hide file tree
Showing 22 changed files with 1,365 additions and 65 deletions.
190 changes: 177 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,28 +50,29 @@ Make sure to setup following configuration data with respect to your environment
<!-- Note: By default the sendPath local directory structure is created in runtime://datamanager directory.
For using any other directory update the value of mantle.content.root preferenceKey -->
<moqui.service.message.SystemMessageType systemMessageTypeId="OMSFulfillmentFeed"
description="Create OMS Fulfillment Feed System Message"
parentTypeId="LocalFeedFile"
consumeServiceName="co.hotwax.shopify.system.ShopifySystemMessageServices.consume#FulfillmentFeed"
receivePath="/home/${sftpUsername}/hotwax/shopify/FulfilledOrderItems"
receiveFilePattern=".*Fulfillment.*\.json"
receiveResponseEnumId="MsgRrMove"
receiveMovePath=""
sendPath="${contentRoot}/Shopify/OMSFulfillmentFeed"/>
description="Create OMS Fulfillment Feed System Message"
parentTypeId="LocalFeedFile"
consumeServiceName="co.hotwax.shopify.system.ShopifySystemMessageServices.consume#FulfillmentFeed"
receivePath="/home/${sftpUsername}/hotwax/shopify/FulfilledOrderItems"
receiveFilePattern=".*Fulfillment.*\.json"
receiveResponseEnumId="MsgRrMove"
receiveMovePath=""
sendPath="${contentRoot}/Shopify/OMSFulfillmentFeed">
<parameters parameterName="consumeSmrId" parameterValue="" systemMessageRemoteId=""/>
</moqui.service.message.SystemMessageType>
<!-- SystemMessageType record for sending Shopify Fulfillment Ack Feed (sendPath = sftp directory) -->
<moqui.service.message.SystemMessageType systemMessageTypeId="SendShopifyFulfillmentAck" description="Send Shopify Fulfillment Ack Feed"
parentTypeId="LocalFeedFile"
sendServiceName="co.hotwax.ofbiz.SystemMessageServices.send#SystemMessageFileSftp"
sendPath=""
receivePath="${contentRoot}/shopify/ShopifyFulfillmentAckFeed/ShopifyFulfillmentFeed-${dateTime}.json"/>
parentTypeId="LocalFeedFile"
sendServiceName="co.hotwax.ofbiz.SystemMessageServices.send#SystemMessageFileSftp"
sendPath=""
receivePath="${contentRoot}/shopify/ShopifyFulfillmentAckFeed/ShopifyFulfillmentFeed-${dateTime}.json"/>
<!-- ServiceJob data for polling OMS Fulfilled Items Feed -->
<moqui.service.job.ServiceJob jobName="poll_SystemMessageSftp_OMSFulfillmentFeed" description="Poll OMS Fulfilled Items Feed"
serviceName="org.moqui.sftp.SftpMessageServices.poll#SystemMessageFileSftp" cronExpression="0 0 * * * ?" paused="Y">
<parameters parameterName="systemMessageTypeId" parameterValue="OMSFulfillmentFeed"/>
<parameters parameterName="systemMessageRemoteId" parameterValue=""/>
<parameters parameterName="consumeSmrId" parameterValue=""/>
</moqui.service.job.ServiceJob>
<!-- ServiceJob data to send Shopify Fulfillment Ack Feed -->
Expand Down Expand Up @@ -352,6 +353,120 @@ You could configure following default parameters and any additional parameters a
</moqui.service.job.ServiceJob>
```

#### Bulk Order Headers Query

```aidl
<!-- SystemMessageType record for bulk order headers query to Shopify -->
<moqui.service.message.SystemMessageType systemMessageTypeId="BulkOrderHeadersQuery"
description="Bulk Order Headers Query System Message"
parentTypeId="ShopifyBulkQuery"
sendServiceName="co.hotwax.shopify.system.ShopifySystemMessageServices.send#BulkQuerySystemMessage"
sendPath="component://shopify-connector/template/graphQL/BulkOrderHeadersQuery.ftl"
consumeServiceName="co.hotwax.shopify.system.ShopifySystemMessageServices.consume#BulkOperationResult"
receivePath="${contentRoot}/shopify/BulkOrderHeadersQuery/BulkOperationResult-${systemMessageId}-${remoteMessageId}-${nowDate}.jsonl">
<parameters parameterName="consumeSmrId" parameterValue="" systemMessageRemoteId=""/>
</moqui.service.message.SystemMessageType>
<!-- SystemMessageType record for sending bulk order headers query result to SFTP -->
<moqui.service.message.SystemMessageType systemMessageTypeId="SendBulkOrderHeadersQueryResult"
description="Send Bulk Order Headers Query Result"
parentTypeId="LocalFeedFile"
sendServiceName="co.hotwax.ofbiz.SystemMessageServices.send#SystemMessageFileSftp"
sendPath=""/>
<!-- Enumeration to create relation between BulkOrderHeadersQuery and SendBulkOrderHeadersQueryResult SystemMessageType(s) -->
<moqui.basic.Enumeration description="Send Bulk Order Headers Query Result" enumId="SendBulkOrderHeadersQueryResult" enumTypeId="ShopifyMessageTypeEnum"/>
<moqui.basic.Enumeration description="Bulk Order Headers Query" enumId="BulkOrderHeadersQuery" enumTypeId="ShopifyMessageTypeEnum" relatedEnumId="SendBulkOrderHeadersQueryResult" relatedEnumTypeId="ShopifyMessageTypeEnum"/>
<!-- ServiceJob data for queuing bulk order headers query -->
<moqui.service.job.ServiceJob jobName="queue_BulkQuerySystemMessage_BulkOrderHeadersQuery" description="Queue bulk order headers query"
serviceName="co.hotwax.shopify.system.ShopifySystemMessageServices.queue#BulkQuerySystemMessage" cronExpression="0 0/15 * * * ?" paused="Y">
<parameters parameterName="systemMessageTypeId" parameterValue="BulkOrderHeadersQuery"/>
<parameters parameterName="systemMessageRemoteId" parameterValue=""/>
<parameters parameterName="filterQuery" parameterValue=""/>
<parameters parameterName="fromDate" parameterValue=""/>
<parameters parameterName="thruDate" parameterValue=""/>
<parameters parameterName="fromDateLabel" parameterValue=""/>
<parameters parameterName="thruDateLabel" parameterValue=""/>
</moqui.service.job.ServiceJob>
```

### Bulk Order Items Query

```aidl
<!-- SystemMessageType record for bulk order items query to Shopify -->
<moqui.service.message.SystemMessageType systemMessageTypeId="BulkOrderItemsQuery"
description="Bulk Order Items Query System Message"
parentTypeId="ShopifyBulkQuery"
sendServiceName="co.hotwax.shopify.system.ShopifySystemMessageServices.send#BulkQuerySystemMessage"
sendPath="component://shopify-connector/template/graphQL/BulkOrderItemsQuery.ftl"
consumeServiceName="co.hotwax.shopify.system.ShopifySystemMessageServices.consume#BulkOperationResult"
receivePath="${contentRoot}/shopify/BulkOrderItemsQuery/BulkOperationResult-${systemMessageId}-${remoteMessageId}-${nowDate}.jsonl">
<parameters parameterName="consumeSmrId" parameterValue="" systemMessageRemoteId=""/>
</moqui.service.message.SystemMessageType>
<!-- SystemMessageType record for sending bulk order items query result to SFTP -->
<moqui.service.message.SystemMessageType systemMessageTypeId="SendBulkOrderItemsQueryResult"
description="Send Bulk Order Items Query Result"
parentTypeId="LocalFeedFile"
sendServiceName="co.hotwax.ofbiz.SystemMessageServices.send#SystemMessageFileSftp"
sendPath=""/>
<!-- Enumeration to create relation between BulkOrderItemsQuery and SendBulkOrderItemsQueryResult SystemMessageType(s) -->
<moqui.basic.Enumeration description="Send Bulk Order Items Query Result" enumId="SendBulkOrderItemsQueryResult" enumTypeId="ShopifyMessageTypeEnum"/>
<moqui.basic.Enumeration description="Bulk Order Items Query" enumId="BulkOrderItemsQuery" enumTypeId="ShopifyMessageTypeEnum" relatedEnumId="SendBulkOrderItemsQueryResult" relatedEnumTypeId="ShopifyMessageTypeEnum"/>
<!-- ServiceJob data for queuing bulk updated order items query -->
<moqui.service.job.ServiceJob jobName="queue_BulkQuerySystemMessage_BulkOrderItemsQuery" description="Queue bulk order items query"
serviceName="co.hotwax.shopify.system.ShopifySystemMessageServices.queue#BulkQuerySystemMessage" cronExpression="0 0/15 * * * ?" paused="Y">
<parameters parameterName="systemMessageTypeId" parameterValue="BulkOrderItemsQuery"/>
<parameters parameterName="systemMessageRemoteId" parameterValue=""/>
<parameters parameterName="filterQuery" parameterValue=""/>
<parameters parameterName="fromDate" parameterValue=""/>
<parameters parameterName="thruDate" parameterValue=""/>
<parameters parameterName="fromDateLabel" parameterValue=""/>
<parameters parameterName="thruDateLabel" parameterValue=""/>
</moqui.service.job.ServiceJob>
```

### Bulk Order Custom Attributes Query

```aidl
<!-- SystemMessageType record for bulk order custom attributes query to Shopify -->
<moqui.service.message.SystemMessageType systemMessageTypeId="BulkOrderCustomAttributesQuery"
description="Bulk Order Custom Attributes Query System Message"
parentTypeId="ShopifyBulkQuery"
sendServiceName="co.hotwax.shopify.system.ShopifySystemMessageServices.send#BulkQuerySystemMessage"
sendPath="component://shopify-connector/template/graphQL/BulkOrderCustomAttributesQuery.ftl"
consumeServiceName="co.hotwax.shopify.system.ShopifySystemMessageServices.consume#BulkOperationResult"
receivePath="${contentRoot}/shopify/BulkOrderCustomAttributesQuery/BulkOperationResult-${systemMessageId}-${remoteMessageId}-${nowDate}.jsonl">
<parameters parameterName="consumeSmrId" parameterValue="" systemMessageRemoteId=""/>
</moqui.service.message.SystemMessageType>
<!-- SystemMessageType record for sending bulk order custom attributes query result to SFTP -->
<moqui.service.message.SystemMessageType systemMessageTypeId="SendBulkOrderCustomAttributesQueryResult"
description="Send Bulk Order Custom Attributes Query Result"
parentTypeId="LocalFeedFile"
sendServiceName="co.hotwax.ofbiz.SystemMessageServices.send#SystemMessageFileSftp"
sendPath=""/>
<!-- Enumeration to create relation between BulkOrderCustomAttributesQuery and SendBulkOrderCustomAttributesQueryResult SystemMessageType(s) -->
<moqui.basic.Enumeration description="Send Bulk Order Custom Attributes Query Result" enumId="SendBulkOrderCustomAttributesQueryResult" enumTypeId="ShopifyMessageTypeEnum"/>
<moqui.basic.Enumeration description="Bulk Order Custom Attributes Query" enumId="BulkOrderCustomAttributesQuery" enumTypeId="ShopifyMessageTypeEnum" relatedEnumId="SendBulkOrderCustomAttributesQueryResult" relatedEnumTypeId="ShopifyMessageTypeEnum"/>
<!-- ServiceJob data for queuing bulk order custom attributes query -->
<moqui.service.job.ServiceJob jobName="queue_BulkQuerySystemMessage_BulkOrderCustomAttributesQuery" description="Queue bulk order custom attributes query"
serviceName="co.hotwax.shopify.system.ShopifySystemMessageServices.queue#BulkQuerySystemMessage" cronExpression="0 0/15 * * * ?" paused="Y">
<parameters parameterName="systemMessageTypeId" parameterValue="BulkOrderCustomAttributesQuery"/>
<parameters parameterName="systemMessageRemoteId" parameterValue=""/>
<parameters parameterName="filterQuery" parameterValue=""/>
<parameters parameterName="fromDate" parameterValue=""/>
<parameters parameterName="thruDate" parameterValue=""/>
<parameters parameterName="fromDateLabel" parameterValue=""/>
<parameters parameterName="thruDateLabel" parameterValue=""/>
</moqui.service.job.ServiceJob>
```

## Shopify Webhook Integration

Set of services and configuration to integrate with Shopify Webhook GraphQL API.
Expand Down Expand Up @@ -452,4 +567,53 @@ Folliowing configuration is added to MoquiConf.xml,
<!-- Enumeration for mapping BulkOperationsFinish SystemMessageType to bulk_operations/finish shopify webhook topic -->
<moqui.basic.Enumeration description="Shopify Bulk Operation Finish Webhook" enumId="BulkOperationsFinish"
enumTypeId="ShopifyMessageTypeEnum" enumCode="bulk_operations/finish"/>
```

## Shopify Refund/Return API Integration

Set of services and configurations to integrate with Shopify GraphQL Refund/Return API.

### Core Services
1. **get#ReturnLineItemsByRefund**: Integrates with Shopify GraphQL Refund API to return a list of return line items.
2. **get#RefundLineItems**: Integrates with Shopify GraphQL Refund API to get associated refund line items.

### Supported flows

#### Get return reason for synced refunds

This flow aims to fetch the return reasons associated to return line items for a refund.
It polls an SFTP server to read a json file containing list of Shopify refundIds. For this list it fetches return reasons for each refund and pushes the return reason json feed to SFTP.
Related configurations,

```aidl
<!-- SystemMessageType record for importing OMS Synced Refunds Feed -->
<moqui.service.message.SystemMessageType systemMessageTypeId="OMSSyncedRefundsFeed"
description="Create OMS Synced Refunds Feed System Message"
parentTypeId="LocalFeedFile"
consumeServiceName="co.hotwax.shopify.system.ShopifySystemMessageServices.consume#SyncedRefundsFeed"
receivePath=""
receiveResponseEnumId="MsgRrMove"
receiveMovePath=""
sendPath="${contentRoot}/shopify/SyncedRefundsFeed">
<parameters parameterName="consumeSmrId" parameterValue="" systemMessageRemoteId=""/>
</moqui.service.message.SystemMessageType>
<!-- SystemMessageType record for sending Shopify Return Reason Feed (sendPath = sftp directory) -->
<moqui.service.message.SystemMessageType systemMessageTypeId="SendShopifyReturnReasonFeed"
description="Send Shopify Return Reason Feed"
parentTypeId="LocalFeedFile"
sendServiceName="co.hotwax.ofbiz.SystemMessageServices.send#SystemMessageFileSftp"
sendPath=""
receivePath="${contentRoot}/shopify/ShopifyReturnReasonFeed/ShopifyReturnReasonFeed-${dateTime}.json"/>
<!-- Enumeration to create relation between OMSSyncedRefundsFeed and SendShopifyReturnReasonFeed SystemMessageType(s) -->
<moqui.basic.Enumeration description="Send Bulk Order Custom Attributes Query Result" enumId="SendShopifyReturnReasonFeed" enumTypeId="ShopifyMessageTypeEnum"/>
<moqui.basic.Enumeration description="Bulk Order Custom Attributes Query" enumId="OMSSyncedRefundsFeed" enumTypeId="ShopifyMessageTypeEnum" relatedEnumId="SendShopifyReturnReasonFeed" relatedEnumTypeId="ShopifyMessageTypeEnum"/>
<!-- ServiceJob data for polling OMS Synced Refunds Feed -->
<moqui.service.job.ServiceJob jobName="poll_SystemMessageFileSftp_OMSSyncedRefundsFeed" description="Poll OMS Synced Refunds Feed"
serviceName="co.hotwax.ofbiz.SystemMessageServices.poll#SystemMessageFileSftp" cronExpression="0 0 * * * ?" paused="Y">
<parameters parameterName="systemMessageTypeId" parameterValue="OMSSyncedRefundsFeed"/>
<parameters parameterName="systemMessageRemoteId" parameterValue=""/>
</moqui.service.job.ServiceJob>
```
2 changes: 1 addition & 1 deletion component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ under the License.
-->

<component xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/moqui-conf-3.xsd"
name="shopify-connector" version="1.2.0">
name="shopify-connector" version="1.3.0">
<!-- no dependencies -->
</component>
44 changes: 43 additions & 1 deletion data/ShopifyServiceJobData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ under the License.
serviceName="co.hotwax.ofbiz.SystemMessageServices.poll#SystemMessageFileSftp" cronExpression="0 0 * * * ?" paused="Y">
<parameters parameterName="systemMessageTypeId" parameterValue="OMSFulfillmentFeed"/>
<parameters parameterName="systemMessageRemoteId" parameterValue=""/>
<parameters parameterName="consumeSmrId" parameterValue=""/>
</moqui.service.job.ServiceJob>

<!-- ServiceJob data to send Shopify Fulfillment Ack Feed -->
Expand Down Expand Up @@ -105,4 +104,47 @@ under the License.
<parameters parameterName="fromDate" parameterValue=""/>
<parameters parameterName="thruDate" parameterValue=""/>
</moqui.service.job.ServiceJob>

<!-- ServiceJob data for queuing bulk order headers query -->
<moqui.service.job.ServiceJob jobName="queue_BulkQuerySystemMessage_BulkOrderHeadersQuery" description="Queue bulk order headers query"
serviceName="co.hotwax.shopify.system.ShopifySystemMessageServices.queue#BulkQuerySystemMessage" cronExpression="0 0/15 * * * ?" paused="Y">
<parameters parameterName="systemMessageTypeId" parameterValue="BulkOrderHeadersQuery"/>
<parameters parameterName="systemMessageRemoteId" parameterValue=""/>
<parameters parameterName="filterQuery" parameterValue=""/>
<parameters parameterName="fromDate" parameterValue=""/>
<parameters parameterName="thruDate" parameterValue=""/>
<parameters parameterName="fromDateLabel" parameterValue=""/>
<parameters parameterName="thruDateLabel" parameterValue=""/>
</moqui.service.job.ServiceJob>

<!-- ServiceJob data for queuing bulk updated order items query -->
<moqui.service.job.ServiceJob jobName="queue_BulkQuerySystemMessage_BulkOrderItemsQuery" description="Queue bulk order items query"
serviceName="co.hotwax.shopify.system.ShopifySystemMessageServices.queue#BulkQuerySystemMessage" cronExpression="0 0/15 * * * ?" paused="Y">
<parameters parameterName="systemMessageTypeId" parameterValue="BulkOrderItemsQuery"/>
<parameters parameterName="systemMessageRemoteId" parameterValue=""/>
<parameters parameterName="filterQuery" parameterValue=""/>
<parameters parameterName="fromDate" parameterValue=""/>
<parameters parameterName="thruDate" parameterValue=""/>
<parameters parameterName="fromDateLabel" parameterValue=""/>
<parameters parameterName="thruDateLabel" parameterValue=""/>
</moqui.service.job.ServiceJob>

<!-- ServiceJob data for queuing bulk order custom attributes query -->
<moqui.service.job.ServiceJob jobName="queue_BulkQuerySystemMessage_BulkOrderCustomAttributesQuery" description="Queue bulk order custom attributes query"
serviceName="co.hotwax.shopify.system.ShopifySystemMessageServices.queue#BulkQuerySystemMessage" cronExpression="0 0/15 * * * ?" paused="Y">
<parameters parameterName="systemMessageTypeId" parameterValue="BulkOrderCustomAttributesQuery"/>
<parameters parameterName="systemMessageRemoteId" parameterValue=""/>
<parameters parameterName="filterQuery" parameterValue=""/>
<parameters parameterName="fromDate" parameterValue=""/>
<parameters parameterName="thruDate" parameterValue=""/>
<parameters parameterName="fromDateLabel" parameterValue=""/>
<parameters parameterName="thruDateLabel" parameterValue=""/>
</moqui.service.job.ServiceJob>

<!-- ServiceJob data for polling OMS Synced Refunds Feed -->
<moqui.service.job.ServiceJob jobName="poll_SystemMessageFileSftp_OMSSyncedRefundsFeed" description="Poll OMS Synced Refunds Feed"
serviceName="co.hotwax.ofbiz.SystemMessageServices.poll#SystemMessageFileSftp" cronExpression="0 0 * * * ?" paused="Y">
<parameters parameterName="systemMessageTypeId" parameterValue="OMSSyncedRefundsFeed"/>
<parameters parameterName="systemMessageRemoteId" parameterValue=""/>
</moqui.service.job.ServiceJob>
</entity-facade-xml>
Loading

0 comments on commit 9d954ab

Please sign in to comment.