-
Notifications
You must be signed in to change notification settings - Fork 2
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
View entity to fetch eligible records #2
Open
Shinde-nutan
wants to merge
19
commits into
hotwax:main
Choose a base branch
from
Shinde-nutan:view-entity-to-fetch-eligible-records
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+288
−1
Open
Changes from 6 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
5b01be8
Added a view to fetch the order level details of orders eligible for NS
eb61100
Merge branch 'hotwax:main' into view-entity-to-fetch-eligible-records
Shinde-nutan 32a8a8b
Added the OPP in the view entity
2c31601
Merge branch 'view-entity-to-fetch-eligible-records' of https://githu…
d46e953
Added a view to fetch the item level detail
ab82460
Remove the join of OPP from EligibleOrdersForNetSuiteView and join of…
2e5bb05
Merge branch 'hotwax:main' into view-entity-to-fetch-eligible-records
Shinde-nutan 998d0cc
Remove the alies-all for OH and OI from the respective views
ef2d195
Merge branch 'view-entity-to-fetch-eligible-records' of https://githu…
fa146ae
Added a view IntegrationTypeMappingAndEnum
210d9a2
Added a view to fetch the eligible order ids and remove the eligiblit…
3b699cf
added the communicationeventandorder view.
Shinde-nutan c26d7d2
Added comments in the viewEntity.
Shinde-nutan 8589b1a
shift the view entity into new file.
Shinde-nutan 42b511f
updated the component name
Shinde-nutan 68a40ea
Added the subselect in the EligibleOrdersForNetSuiteView to add a che…
Shinde-nutan 237bd92
added comment in subselect
Shinde-nutan 0b677aa
added the enum code in the view
Shinde-nutan 7e56cf5
Added a view entity (InvalidOrdersForNetsuite) to exculde the invalid…
Shinde-nutan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# mantle-net-suite-connector | ||
# mantle-netsuite-connector | ||
NetSuite Connector in Moqui |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/entity-definition-3.xsd"> | ||
<view-entity entity-name="EligibleOrdersForNetSuiteView" package="co.hotwax.order" group="ofbiz_transactional"> | ||
<member-entity entity-alias="OH" entity-name="org.apache.ofbiz.order.order.OrderHeader"/> | ||
<member-entity entity-alias="SCENM" entity-name="org.apache.ofbiz.common.enum.Enumeration" join-from-alias="OH" join-optional="true"> | ||
<key-map field-name="salesChannelEnumId" related="enumId"/> | ||
</member-entity> | ||
<member-entity entity-alias="OID" entity-name="co.hotwax.order.OrderIdentification" join-from-alias="OH" join-optional="true"> | ||
<key-map field-name="orderId"/> | ||
<entity-condition> | ||
<econdition entity-alias="OID" field-name="orderIdentificationTypeId" value="NETSUITE_ORDER_ID"/> | ||
<date-filter/> | ||
</entity-condition> | ||
</member-entity> | ||
<member-entity entity-alias="ODR" entity-name="org.apache.ofbiz.order.order.OrderRole" join-from-alias="OH" join-optional="true"> | ||
<key-map field-name="orderId"/> | ||
<entity-condition> | ||
<econdition entity-alias="ODR" field-name="roleTypeId" operator="equals" value="BILL_TO_CUSTOMER"/> | ||
</entity-condition> | ||
</member-entity> | ||
<member-entity entity-alias="PID" entity-name="org.apache.ofbiz.party.party.PartyIdentification" join-from-alias="ODR"> | ||
<key-map field-name="partyId"/> | ||
<entity-condition> | ||
<econdition entity-alias="PID" field-name="partyIdentificationTypeId" value="NETSUITE_CUSTOMER_ID"/> | ||
</entity-condition> | ||
</member-entity> | ||
<member-entity entity-alias="OCMBL" entity-name="org.apache.ofbiz.order.order.OrderContactMech" join-from-alias="OH" join-optional="true"> | ||
<key-map field-name="orderId"/> | ||
<entity-condition> | ||
<econdition entity-alias="OCMBL" field-name="contactMechPurposeTypeId" operator="equals" value="BILLING_LOCATION"/> | ||
</entity-condition> | ||
</member-entity> | ||
<member-entity entity-alias="PAB" entity-name="org.apache.ofbiz.party.contact.PostalAddress" join-from-alias="OCMBL" join-optional="true"> | ||
<key-map field-name="contactMechId"/> | ||
</member-entity> | ||
<member-entity entity-alias="COUNTRYGEOBL" entity-name="org.apache.ofbiz.common.geo.Geo" join-from-alias="PAB" join-optional="true"> | ||
<key-map field-name="countryGeoId" related="geoId"/> | ||
</member-entity> | ||
<member-entity entity-alias="OCMSL" entity-name="org.apache.ofbiz.order.order.OrderContactMech" join-from-alias="OH" join-optional="true"> | ||
<key-map field-name="orderId"/> | ||
<entity-condition> | ||
<econdition entity-alias="OCMSL" field-name="contactMechPurposeTypeId" operator="equals" value="SHIPPING_LOCATION"/> | ||
</entity-condition> | ||
</member-entity> | ||
<member-entity entity-alias="PAS" entity-name="org.apache.ofbiz.party.contact.PostalAddress" join-from-alias="OCMSL" join-optional="true"> | ||
<key-map field-name="contactMechId"/> | ||
</member-entity> | ||
<member-entity entity-alias="COUNTRYGEOSL" entity-name="org.apache.ofbiz.common.geo.Geo" join-from-alias="PAS" join-optional="true"> | ||
<key-map field-name="countryGeoId" related="geoId"/> | ||
</member-entity> | ||
<member-entity entity-alias="OCMBP" entity-name="org.apache.ofbiz.order.order.OrderContactMech" join-from-alias="OH" join-optional="true"> | ||
<key-map field-name="orderId"/> | ||
<entity-condition> | ||
<econdition entity-alias="OCMBP" field-name="contactMechPurposeTypeId" operator="equals" value="PHONE_BILLING"/> | ||
</entity-condition> | ||
</member-entity> | ||
<member-entity entity-alias="TN" entity-name="org.apache.ofbiz.party.contact.TelecomNumber" join-from-alias="OCMBP" join-optional="true"> | ||
<key-map field-name="contactMechId"/> | ||
</member-entity> | ||
<member-entity entity-alias="OADJ" entity-name="org.apache.ofbiz.order.order.OrderAdjustment" join-from-alias="OH" join-optional="true"> | ||
<key-map field-name="orderId"/> | ||
<entity-condition> | ||
<econdition field-name="orderAdjustmentTypeId" value="SHIPPING_CHARGES"/> | ||
</entity-condition> | ||
</member-entity> | ||
<member-entity entity-alias="OPP" entity-name="org.apache.ofbiz.order.order.OrderPaymentPreference" join-from-alias="OH" join-optional="true"> | ||
dt2patel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<key-map field-name="orderId"/> | ||
<entity-condition> | ||
<econdition field-name="paymentMethodTypeId" value="EXT_GIFT_CARD"/> | ||
</entity-condition> | ||
</member-entity> | ||
<entity-condition> | ||
<econdition entity-alias="OH" field-name="orderTypeId" operator="equals" value="SALES_ORDER"/> | ||
<econdition entity-alias="OID" field-name="orderId" operator="equals" value=""/> | ||
</entity-condition> | ||
<alias-all entity-alias="OH"/> | ||
<alias name="shippingAddress1" field="address1" entity-alias="PAS"/> | ||
<alias name="shippingAddress2" field="address2" entity-alias="PAS"/> | ||
<alias name="shippingCity" field="city" entity-alias="PAS"/> | ||
<alias name="shippingState" field="stateProvinceGeoId" entity-alias="PAS"/> | ||
<alias name="shippingPostalCode" field="postalCode" entity-alias="PAS"/> | ||
<alias name="shippingCountry" field="geoCode" entity-alias="COUNTRYGEOSL"/> | ||
<alias name="billingAddress1" field="address2" entity-alias="PAB"/> | ||
<alias name="billingAddress2" field="address2" entity-alias="PAB"/> | ||
<alias name="billingCity" field="city" entity-alias="PAB"/> | ||
<alias name="billingState" field="stateProvinceGeoId" entity-alias="PAB"/> | ||
<alias name="billingPostalCode" field="postalCode" entity-alias="PAB"/> | ||
<alias name="billingCountry" field="geoCode" entity-alias="COUNTRYGEOBL"/> | ||
<alias name="NetsuiteCustomerId" field="idValue" entity-alias="PID"/> | ||
<alias name="salesChannel" field="description" entity-alias="SCENM"/> | ||
<alias-all entity-alias="TN"/> | ||
<alias name="ShippingCharge" field="amount" entity-alias="OADJ"/> | ||
<alias name="giftCardAmountSum" field="maxAmount" entity-alias="OPP"/> | ||
</view-entity> | ||
|
||
<view-entity entity-name="OrderItemsForNetSuiteView" package="co.hotwax.order" group="ofbiz_transactional"> | ||
<member-entity entity-alias="OI" entity-name="org.apache.ofbiz.order.order.OrderItem"/> | ||
<member-entity entity-alias="P" entity-name="org.apache.ofbiz.product.product.Product" join-from-alias="OI"> | ||
<key-map field-name="productId"/> | ||
</member-entity> | ||
<member-entity entity-alias="GID" entity-name="org.apache.ofbiz.product.product.GoodIdentification" join-from-alias="P"> | ||
<key-map field-name="productId"/> | ||
<entity-condition> | ||
<econdition field-name="goodIdentificationTypeId" value="NETSUITE_PRODUCT_ID"/> | ||
<date-filter/> | ||
</entity-condition> | ||
</member-entity> | ||
<member-entity entity-alias="OADJ" entity-name="org.apache.ofbiz.order.order.OrderAdjustment" join-from-alias="OI" join-optional="true"> | ||
<key-map field-name="orderId"/> | ||
<key-map field-name="orderItemSeqId"/> | ||
<entity-condition> | ||
<econdition field-name="orderAdjustmentTypeId" value="EXT_PROMO_ADJUSTMENT"/> | ||
</entity-condition> | ||
</member-entity> | ||
<alias-all entity-alias="OI"/> | ||
<alias name="NetSuiteProductId" field="idValue" entity-alias="GID"/> | ||
<alias name="DiscountSum" field="amount" entity-alias="OADJ" function="sum"/> | ||
</view-entity> | ||
</entities> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Shinde-nutan,
Add one more entity condition to include "SHOPIFY_CUST_ID"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello sir,
In this view we are fetching the details which is required for an order to sync at Netsuite.
the shopify customer id is not required field. if needed we can add that in the custom groovy file which we are preparing specific to client.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we will have Shopify as a constant in our integrations, fetching the field in this view will make this specific to Shopify only and create need for refactoring should orders enter HotWax from another source. For now I agree with @Shinde-nutan here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @dt2patel
I agreed.
During the KR Production rollout, someone enabled the "Import Customer Job," which resulted in duplicate customers being created in NetSuite. When we create customers through the "Import Customer Job," we store the Shopify Customer ID in the External ID field of the Party entity.
However, when syncing historical customers from NetSuite or importing a new order from Shopify, we create a PartyIdentification record with the Shopify Customer ID and the corresponding partyIdentificationTypeID defined in OMS.
To avoid duplication issues, we need to add a condition to filter valid customer records appropriately during the fetch process. So we can add the condition in the Groovy file.
CC: @Shinde-nutan