feat: import strategy - sales channels support (#2124)

**What**
- add support for specifying sales channel with import strategy
- additional:
  - refactor SC service to use `retrieve_` pattern
  - fix: pass arguments from `startServerWithEnvironment` to setup server
  - fix: minio undefined resolve/reject calls
  - fix: csv parser - detect missing columns from schema only if the column is required

**How**
- extending schema to expect sales channels columns in an import CSV file

RESOLVES CORE-304
This commit is contained in:
Frane Polić
2022-09-02 11:28:43 +00:00
committed by GitHub
parent d14a0398fb
commit 546a963f7b
12 changed files with 611 additions and 143 deletions
@@ -1,7 +1,13 @@
const setupServer = require("./setup-server")
const { initDb } = require("./use-db")
const startServerWithEnvironment = async ({ cwd, verbose, env }) => {
const startServerWithEnvironment = async ({
cwd,
redisUrl,
uploadDir,
verbose,
env,
}) => {
if (env) {
Object.entries(env).forEach(([key, value]) => {
process.env[key] = value
@@ -19,6 +25,8 @@ const startServerWithEnvironment = async ({ cwd, verbose, env }) => {
const medusaProcess = await setupServer({
cwd,
verbose,
redisUrl,
uploadDir,
env,
})