-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
feat: product import strategy #1706
Conversation
8d0b728
to
e5d328a
Compare
|
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.
Nice work - will do one more pass on this soon; but have added a few comments 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.
Very nice work 👍 - I ve done a first review and will do another one once seb and my comments are processed. It is a super clean work man 🚀
720bb8d
to
b1877d1
Compare
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.
Few comments, but very nice work 💪 I've also seen that there is still some of seb comments and that there is still some redis stuff, is that intended?
packages/medusa/src/strategies/__tests__/batch-jobs/product/import.ts
Outdated
Show resolved
Hide resolved
I made the change as Seb suggested. The import strategy doesn't depend on Redis anymore. Other Redis changes aren't related to the import strategy (I added type support for ioredis and The other unresolved comments still need to be discussed a bit more :) |
ff319f9
to
391c222
Compare
391c222
to
bf9f42f
Compare
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.
Really nice work @frane - just a few small tweaks left; I assume that we will include the Sales Channel related stuff in a separate ticket?
const { id } = (await productOptionRepo.findOne({ | ||
where: { title: o._title }, | ||
})) as ProductOption |
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.
todo: this is insufficient as we would have to get the correct product option for the product being worked on. For example, this could exist in the DB:
- Product Option 1:
{ id: "option_1", title: "Size", product_id: "prod_a" }
- Product Option 2:
{ id: "option_2", title: "Size", product_id: "prod_b" }
Now let's say we are adding a variant to Product B; we could end up having a situation where the variant has a product option value like this:
- Product Option Value: { id: "optval_1", value: "Medium", option_id: "option_1", variant_id: "new_variant" }
In this case, the option value refers to a ProductVariant belonging to Product B but a ProductOption belonging to Product A.
In the case where we are working with an existing product option we should be able to structure the query to be something along the lines of:
{ title: o._title, product_id: variantOp.product_id },
… track of `advancement_count`
d3f2c89
to
f23b4e7
Compare
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.
LGTM! Can't wait to start rolling this out 😍
What
region_id
was sent in the payloadfileKey
from MinIO file service (needs to be stored in the BatchJob context)useRedis
testing util that spins up a Redis container for integration testingioredis
typesHow
Testing
TODO
Testing locally with Postman
{"email": "admin@medusa-test.com", "password": "supersecret"}
and type to JSONform-data
where the CSV file should be uploaded under keyfiles
"key": "product-import.csv"
{"type": "product_import", "dry_run": false, "context": {"fileKey": "product-import.csv"}}
Fixes CORE-413