diff --git a/project-ideas/order-ledger/ShopifyOrderSyncDesign.md b/project-ideas/order-ledger/ShopifyOrderSyncDesign.md index 5e815a3..77db389 100644 --- a/project-ideas/order-ledger/ShopifyOrderSyncDesign.md +++ b/project-ideas/order-ledger/ShopifyOrderSyncDesign.md @@ -233,6 +233,23 @@ Following are the implementation details, ```xml + + + + + + + + ``` ### [create#PostalAddress](../oms/createPostalAddress.md) @@ -241,3 +258,5 @@ Following are the implementation details, ### [create#SalesOrder](createSalesOrder.md) ### [findOrCreate#Product](../oms/findOrCreateProduct.md) + +### [consume#OMSFeedSystemMessage](consumeOMSFeedSystemMessage.md) diff --git a/project-ideas/order-ledger/consumeOMSFeedSystemMessage.md b/project-ideas/order-ledger/consumeOMSFeedSystemMessage.md new file mode 100644 index 0000000..3214350 --- /dev/null +++ b/project-ideas/order-ledger/consumeOMSFeedSystemMessage.md @@ -0,0 +1,16 @@ +# co.hotwax.orderledger.system.FeedServices.consume#OMSFeedSystemMessage +1. Implements _org.moqui.impl.SystemMessageServices.consume#SystemMessage_. +2. Get the systemMessage record from SystemMessageAndType view entity. +3. Set filePathRef = location reference of systemMessage.messageText. +4. Get jsonList = filePath.fileText(). +5. If !jsonList return error - "System message [${systemMessageId}] for Type [${systemMessage?.systemMessageTypeId}] has messageText [${systemMessage.messageText}], with feed file having incorrect data and may contain null, not consuming the feed file." +6. Prepare error file + * Set fileName from filePathRef. + * Split fileName by "." into fileNameArray. + * Set errorFileName = fileNameArray[0] + "Error." + fileNameArray[1]. + * Set errorFilePathRef = expanded systemMessage.sendPath + "/error/" + errorFileName. + * Initiate a Json file for errorFilePathRef, we will write erroneous records with errors in this file. +7. Iterate through jsonList and for each entry call systemMessage.sendService in new transaction. + * If serviceOutput has error list then write following in error file - ["json":jsonList.entry, "error":serviceOutput.errorMessageList]. +8. Close error file. +9. Create SystemMessage - [systemMessageTypeId:"FeedErrorFile", messageText:errorFilePathRef, parentMessageId:systemMessage.systemMessageId] \ No newline at end of file diff --git a/project-ideas/product-master/ShopifyNewProductsSyncDesign.md b/project-ideas/product-master/ShopifyNewProductsSyncDesign.md index 20eb93f..16c31f8 100644 --- a/project-ideas/product-master/ShopifyNewProductsSyncDesign.md +++ b/project-ideas/product-master/ShopifyNewProductsSyncDesign.md @@ -68,6 +68,28 @@ Following are the implementation details, ## OMS API +### Seed Data +```xml + + + + + + + + + +``` + ### [create#Product](../oms/createProduct.md) ### [create#ProductAndVariants](createProductAndVariants.md) @@ -75,3 +97,5 @@ Following are the implementation details, ### [create#ProductVariant](createProductVariant.md) ### [prepare#ProductCreate](prepareProductCreate.md) + +### [consume#OMSFeedSystemMessage](../order-ledger/consumeOMSFeedSystemMessage.md) diff --git a/project-ideas/product-master/ShopifyProductUpdatesSyncDesign.md b/project-ideas/product-master/ShopifyProductUpdatesSyncDesign.md index 6815388..698219c 100644 --- a/project-ideas/product-master/ShopifyProductUpdatesSyncDesign.md +++ b/project-ideas/product-master/ShopifyProductUpdatesSyncDesign.md @@ -59,14 +59,31 @@ Following are the implementation details, ### [generate#OMSProductUpdatesFeed](generateOMSProductUpdatesFeed.md) -### map#Product -Refer implementation details in [createProduct.md](https://github.com/saastechacademy/foundation/blob/main/project-ideas/product-master/createProduct.md). +### [map#Product](mapProduct.md) -### map#ProductVariant -Refer implementation details in [createProduct.md](https://github.com/saastechacademy/foundation/blob/main/project-ideas/product-master/createProduct.md). +### [map#ProductVariant](mapProductVariant.md) ## OMS API +### Seed Data +```xml + + + + + + +``` + ### [update#Product](../oms/updateProduct.md) ### [update#ProductAndVariants](updateProductAndVariants.md) @@ -74,3 +91,5 @@ Refer implementation details in [createProduct.md](https://github.com/saastechac ### [update#ProductVariant](updateProductVariant.md) ### [prepare#ProductUpdate](prepareProductUpdate.md) + +### [consume#OMSFeedSystemMessage](../order-ledger/consumeOMSFeedSystemMessage.md)