-
-
Notifications
You must be signed in to change notification settings - Fork 4
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(data-ingestion): Upload product items from the needs data to the Strapi collection #210
base: saga
Are you sure you want to change the base?
Conversation
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.
Overall this is great, I left a couple comments for you to review but very solid work!!
There were a couple console.log statements that we might not need anymore. Not sure if those were just for debugging (i.e line 168 of src/scripts/import-needs-assessment-data/add-categories.ts
and line 206 of src/scripts/import-needs-assessment-data/add-items.ts
)
return validCategories; | ||
} | ||
|
||
const isFulfilled = <T>( |
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.
Can we make this consistent with the _isRejected
below? I am fine with with either way, just want to make sure it is consistent.
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.
question: @guel-codes, can you clarify what you're referencing as inconsistent between the isFulfilled
and _isRejected
for further investigation? Thanks.
return validProducts; | ||
} | ||
|
||
const isFulfilled = <T>( |
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.
Can we also make this one consistent with the _isRejected below
What changed?
This pull request currently populates the
name
field type for theProduct.Category
collection. It relates to task 1 in PR #112. This collection still requires theitems
relation field type to be populated.Still to do in this PR:
unit
field type to the StrapiProduct.Item
collection.Product.Item
collection, using the needs data to create items with the following fields -name
,age_gender
,size_style
,category
,unit
.**Update: This pull request now populates the
Product.Category
andProduct.Item
collections.How can you test this?
Add the attached needs-data.json file to the
src/scripts/import-needs-assessment-data
folder, setup thesrc/scripts/.env
file, then run the dev server in one terminal andyarn script:import-needs-assessment-data
in another. The logs should show you that 11 categories and 290 products have been created successfully or already exist. (The json file was updated with the full dataset Nov. 28/24)To test a small amount of data when working with the add-items scripts for the
Product.Item
collection, use the following demo-data needs-data(1).json instead of the above-noted json file.The logs should show you the following breakdown:
5 categories processed (either in SUCCESS or ALREADY_EXISTS) and
26 products processed (2 ORIGINAL_DATA_INVALID and 24 in SUCCESS or ALREADY_EXISTS).