Skip to content

Comments

Added: Generate Exchange Order Feed implementation#234

Open
parnikarangnekar wants to merge 19 commits intomainfrom
226-refactoring-exchange-order-processing-into-a-dedicated-exchange-feed-flow
Open

Added: Generate Exchange Order Feed implementation#234
parnikarangnekar wants to merge 19 commits intomainfrom
226-refactoring-exchange-order-processing-into-a-dedicated-exchange-feed-flow

Conversation

@parnikarangnekar
Copy link

close-#226

@gemini-code-assist
Copy link

Summary of Changes

Hello @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 Service Job: Introduced "queue_ExchangeOrderIdsFeed" in "ShopifyServiceJobData.xml" to automate the queuing of exchanged order IDs feed.
  • System Message Types: Added three new SystemMessageType definitions ("GenerateExchangedOrderIdsFeed", "GenerateExchangeFeed", "SendExchangeFeed") and corresponding enumerations in "ShopifySetupSeedData.xml" to manage the lifecycle of exchange feed generation and sending.
  • Exchange Feed Generation Service: Implemented a new service "generate#ExchangeFeed" in "ShopifySystemMessageServices.xml" which processes system messages, retrieves order and exchange data, and generates a JSON feed file.
  • New Utility Worker: A new Groovy class "ShopifyMappingWorker.groovy" was added, providing helper methods for data mapping (e.g., "getShopifyTypeMappedValue", "getFacilityId", "getProductId") and for exploding order items into individual units with their respective statuses and adjustments.
  • GraphQL Query Template: A new GraphQL template "ShippingLinesByOrderIdQuery.ftl" was added to facilitate fetching shipping line details from Shopify.

🧠 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines 450 to 453
<moqui.service.message.SystemMessageTypeParameter systemMessageTypeId="GenerateExchangeFeed"
parameterName="sendSmrId"
parameterValue=""
systemMessageRemoteId=""/>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This SystemMessageTypeParameter definition is redundant. The same parameter sendSmrId is already defined for GenerateExchangeFeed using the <parameters> sub-element on line 440. Please remove this redundant block to avoid confusion and improve maintainability.

<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."/>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

jGenerator.writeEndArray()
}
} catch (IOException e) {
logger.error("Error preparing Return and Exchange Feed file", e)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The error message here seems to be a copy-paste from another service. It should refer to 'Exchange Feed' instead of 'Return and Exchange Feed'.

                    logger.error("Error preparing Exchange Feed file", e)

@parnikarangnekar parnikarangnekar force-pushed the 226-refactoring-exchange-order-processing-into-a-dedicated-exchange-feed-flow branch from 0572b8e to 3d07ea8 Compare December 29, 2025 11:05
@hotwax hotwax deleted a comment from gemini-code-assist bot Dec 30, 2025
@hotwax hotwax deleted a comment from gemini-code-assist bot Dec 30, 2025
@gurveenbagga gurveenbagga changed the title Added generate exchange feed service and it's system message data Added: Generate Exchange Order Feed implementation Dec 30, 2025
receivePath="${contentRoot}/shopify/ReturnedOrderIdsFeed/ExchangedOrderIdsFeed-${dateTime}-${systemMessageId}.json"/>

<!-- SystemMessageType record for generating Exchange Order Feed -->
<moqui.service.message.SystemMessageType systemMessageTypeId="GenerateExchangeFeed"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GenerateExchangeFeed -> GenerateExchangeOrderFeed

<moqui.service.message.SystemMessageType systemMessageTypeId="GenerateExchangeFeed"
description="Generate Exchange Feed"
parentTypeId="LocalFeedFile"
sendPath="${contentRoot}/shopify/ReturnsAndExchangeFeed/ExchangeFeed-${dateTime}-${systemMessageId}.json"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ReturnsAndExchangeFeed -> ExchangeOrderFeed/ExchangeOrderFeed-${dateTime}-${systemMessageId}.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor Exchange Order Processing from return exchange v2 feed into a dedicated Create Exchange Order Feed Flow

3 participants