Skip to content
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

Implement ProductImportStrategy #1265

Closed
4 tasks
fPolic opened this issue Mar 28, 2022 · 1 comment · Fixed by #1706
Closed
4 tasks

Implement ProductImportStrategy #1265

fPolic opened this issue Mar 28, 2022 · 1 comment · Fixed by #1706
Assignees

Comments

@fPolic
Copy link
Contributor

fPolic commented Mar 28, 2022

DoD

  • When dry_run: true ProductImportStrategy should first move BatchJob to an awaiting_confirmation state before importing data.
  // pre-confirmation.json

  [
    { operation: "create", type: "product", data: { .... },
    { operation: "create", type: "product-variant", data: { ... }
  ]

  // ON CONFIRM

  await Promise.all(preconfirmops.map((op) => {
    switch(op.operation) 
      case "create":
        productService.create(op.data)
        break
      case "update":
        productVariantService.update(op.existing_id, op.data)
  }))
  • Should create a summary of the data to be imported e.g. create_count: 32, update_count: 13, error_count: 2 which should be kept in the BatchJob result until completion.
  • Should report progress to the BatchJobService
  • The default import format should support the same columns as the export format

View more from the discussion here

The required fields for a new product are:

  • handle, title
  • Other fields that have defaults if not provided:
    • Status - draft
    • Product Option 1 - Default Option
    • Profile - Default Profile
    • Discountable - true

The required fields for a new product variant are:

  • If product has product option then Variant Option Value must be defined
  • Other fields that have defaults if not provided:
    • Title - concat of option values
    • Allow Backorder - false
    • Manage Inventory - true
    • Variant Option Value 1 (if not defined on product) - Default Variant

Fixes CORE-413

@srindom
Copy link
Collaborator

srindom commented Mar 29, 2022

DoD

  • When dry_run: true ProductImportStrategy should first move BatchJob to an awaiting_confirmation state before importing data.
  // pre-confirmation.json

  [
    { operation: "create", type: "product", data: { .... },
    { operation: "create", type: "product-variant", data: { ... }
  ]

  // ON CONFIRM

  await Promise.all(preconfirmops.map((op) => {
    switch(op.operation) 
      case "create":
        productService.create(op.data)
        break
      case "update":
        productVariantService.update(op.existing_id, op.data)
  }))
  • Should create a summary of the data to be imported e.g. create_count: 32, update_count: 13, error_count: 2 which should be kept in the BatchJob result until completion.
  • Should report progress to the BatchJobService
  • The default import format should support the same columns as the export format

View more from the discussion here

The required fields for a new product are:

  • handle, title
  • Other fields that have defaults if not provided:
    • Status - draft
    • Product Option 1 - Default Option
    • Profile - Default Profile
    • Discountable - true

The required fields for a new product variant are:

  • If product has product option then Variant Option Value must be defined
  • Other fields that have defaults if not provided:
    • Title - concat of option values
    • Allow Backorder - false
    • Manage Inventory - true
    • Variant Option Value 1 (if not defined on product) - Default Variant

@olivermrbl olivermrbl changed the title Implement ProductImportHandler Implement ProductImportStrategy May 9, 2022
@fPolic fPolic self-assigned this May 12, 2022
@fPolic fPolic linked a pull request Jun 27, 2022 that will close this issue
2 tasks
@srindom srindom closed this as completed Dec 12, 2022
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 a pull request may close this issue.

2 participants