Added: Generate Exchange Order Feed implementation#234
Added: Generate Exchange Order Feed implementation#234parnikarangnekar wants to merge 19 commits intomainfrom
Conversation
Summary of ChangesHello @parnikarangnekar, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the Shopify connector by introducing a comprehensive mechanism for generating and managing exchange order feeds. It establishes new system message types and a scheduled job to initiate the feed generation process, alongside a dedicated service that orchestrates the retrieval of order and exchange data from Shopify and outputs it into a structured JSON format. The changes also include a new Groovy utility class to streamline data mapping and item processing, and a GraphQL template for querying shipping line information. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new service to generate an exchange feed, along with the necessary system message data and a new Groovy worker class. The changes are well-structured, but I've identified several areas for improvement, primarily related to code duplication, logging, and error handling. There are some copy-paste errors in the new service definition that lead to incorrect or misleading log messages. I've also pointed out a critical issue in the new Groovy worker regarding catching Throwable and some minor style inconsistencies. Addressing these points will improve the maintainability and robustness of the new functionality.
data/ShopifySetupSeedData.xml
Outdated
| <moqui.service.message.SystemMessageTypeParameter systemMessageTypeId="GenerateExchangeFeed" | ||
| parameterName="sendSmrId" | ||
| parameterValue="" | ||
| systemMessageRemoteId=""/> |
There was a problem hiding this comment.
service/co/hotwax/shopify/system/ShopifySystemMessageServices.xml
Outdated
Show resolved
Hide resolved
| <set field="orders" from="org.moqui.impl.context.ContextJavaUtil.jacksonMapper.readValue(fileText, List.class)"/> | ||
|
|
||
| <if condition="!orders"> | ||
| <return type="warning" message="System message [${systemMessageId}] for Type [${systemMessage?.systemMessageTypeId}] has messageText [${systemMessage.messageText}], with ReturnedOrderIdsFeed file having incorrect data and may contain null, not generating order returns feed file."/> |
There was a problem hiding this comment.
The warning message is not generic and seems to be a copy-paste from another service. It specifically mentions 'ReturnedOrderIdsFeed file'. Please update it to be relevant to the current service, which is generate#ExchangeFeed.
<return type="warning" message="System message [${systemMessageId}] for Type [${systemMessage?.systemMessageTypeId}] has messageText [${systemMessage.messageText}], with the input feed file having incorrect data or being null, not generating the exchange feed file."/>
|
|
||
| try { | ||
| //json file | ||
| ec.logger.info("jsonFilePath:" +jsonFilePath) |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
| jGenerator.writeEndArray() | ||
| } | ||
| } catch (IOException e) { | ||
| logger.error("Error preparing Return and Exchange Feed file", e) |
0572b8e to
3d07ea8
Compare
data/ShopifySetupSeedData.xml
Outdated
| receivePath="${contentRoot}/shopify/ReturnedOrderIdsFeed/ExchangedOrderIdsFeed-${dateTime}-${systemMessageId}.json"/> | ||
|
|
||
| <!-- SystemMessageType record for generating Exchange Order Feed --> | ||
| <moqui.service.message.SystemMessageType systemMessageTypeId="GenerateExchangeFeed" |
There was a problem hiding this comment.
GenerateExchangeFeed -> GenerateExchangeOrderFeed
…ExchangesByOrderIDQuery.ftl
data/ShopifySetupSeedData.xml
Outdated
| <moqui.service.message.SystemMessageType systemMessageTypeId="GenerateExchangeFeed" | ||
| description="Generate Exchange Feed" | ||
| parentTypeId="LocalFeedFile" | ||
| sendPath="${contentRoot}/shopify/ReturnsAndExchangeFeed/ExchangeFeed-${dateTime}-${systemMessageId}.json" |
There was a problem hiding this comment.
ReturnsAndExchangeFeed -> ExchangeOrderFeed/ExchangeOrderFeed-${dateTime}-${systemMessageId}.json
…-cancellation-transformation-logic' of https://github.com/hotwax/mantle-shopify-connector into 226-refactoring-exchange-order-processing-into-a-dedicated-exchange-feed-flow
This reverts commit c6df1bf.
…o handle"" This reverts commit b1c7dca.
… ToDos to handle""" This reverts commit a04c70d.
close-#226