-
Notifications
You must be signed in to change notification settings - Fork 0
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
[DL-82] Import Flow HS code #32
Open
sebastiandl
wants to merge
10
commits into
develop
Choose a base branch
from
feature/dl-82-hs-code-handling
base: develop
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.
Open
Conversation
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
sebastiandl
force-pushed
the
feature/dl-82-hs-code-handling
branch
from
March 22, 2021 13:37
11cd126
to
6c214d0
Compare
…ll as a little spec to test happy path
… to hs code handling
…and adding errors count to Flow HS code importing methods
sebastiandl
force-pushed
the
feature/dl-82-hs-code-handling
branch
from
March 23, 2021 13:44
6eda9d1
to
0fd667c
Compare
texpert
reviewed
Mar 23, 2021
texpert
approved these changes
Mar 23, 2021
… hs_code is provided within csv
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What problem is the code solving?
The HS code handled by flow is different from the HS code we are currently handling for Fulfil. Because of that we need to import from Flow the HS codes to eventually syncrhonize them with Fulfil since the we need to use them when printing Commercial Invoices for Flow Orders.
How does this change address the problem?
By adding the following changes:
NEW rake task spree_variant:import_flow_hs_code: This rake task calls the API endpoint to retrieve HS10 codes, and then extract the first 6 digits of each code and stores them within the flow_data information.
NEW rake task spree_variant:import_flow_hs_code_from_csv: This rake tasks updates HS6 codes based on a csv file. Flow allows us to create a CSV file from their console, which we can use to retrieve the HS6 codes directly. This is intended to be a backup method and is quite simple and straight forward.
Both rake tasks will call the Fulfill Flow Hs code sincronization before finishing in order to make sure to propagate the HS code properly.
Why is this the best solution?
This is not the best solution unfortunately, since in both scenarios we need to perform manual actions. The best approach would be to have a webhook configured, but we have suspicions that they are not working on Flow side.
On the other side, Flow is aware that we only need the HS6 code and they will be working on their side to provide us with such endpoint. In the meantime we should be fine with going with either of these options. Once we have the HS6 code endpoint ready we can update the
spree_variant:import_flow_hs_code
to use that endpoint instead.Share the knowledge
Since the HS codes from Flow and Fulfil would be different, we have to handle them in separate places within Spree and Fulfil. In Spree we are going to be storing those Flow HS codes within the flow data information, while in Fulfil the Flow HS codes are going to be stored in the product's metadata. That synchronization with Fulfil is being handled in this PR https://github.com/mejuri-inc/mejuri-web/pull/889