Skip to content

Commit

Permalink
feat(josb): add shop import
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerald Baulig committed Jan 17, 2024
1 parent 5216e17 commit 0f6bf78
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions datasets/demo-shop/data/seed-data/shops.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
id: restorecommecre-demo-shop-000
shop_number: "00000000"
shopNumber: "00000000"
name: "Restorecommerce Demo Shop 000"
description: ""
domain: store.restorecommerce.io
organization_id: restorecommecre-demo-shop-000-organization
organizationId: restorecommecre-demo-shop-000-organization
meta:
modifiedBy: ""
owners:
Expand Down
1 change: 0 additions & 1 deletion datasets/demo-shop/data/seed-data/users.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
active: true
activationCode: ""
passwordHash: ""
unauthenticated: false
guest: false
image:
id: ""
Expand Down
7 changes: 7 additions & 0 deletions datasets/demo-shop/jobs/job_master.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@
"src": "./datasets/demo-shop/data/seed-data/",
"filter": "organizations.yaml",
"mutation": "mutation mutateOrganizations($var: [IIoRestorecommerceOrganizationOrganization!]!){ master_data { organization { Mutate( input: { items: $var, totalCount: 0, mode: UPSERT } ) { details{items {status {id, code, message}}, operationStatus { code message } } } } }}"
},
{
"name": "shops",
"operation": "sync",
"src": "./datasets/demo-shop/data/seed-data/",
"filter": "shops.yaml",
"mutation": "mutation{ master_data { shop { Mutate( input: { items: ${resource_list}, totalCount: 0, mode: UPSERT } ) { details{items {status {id, code, message}}, operationStatus { code message } } } } }}"
}
]
}
2 changes: 1 addition & 1 deletion import.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async function commandDataImport(cmd) {
console.log('Resources imported successfully');
});
jobResult.on('error', (err) => {
console.error('Error :', err);
console.error('Error :', err, JSON.stringify(err ?? '', null, 2));
});
}
}
Expand Down

0 comments on commit 0f6bf78

Please sign in to comment.