From e5e64713e1dadefd79ece8a19085c967399fdb17 Mon Sep 17 00:00:00 2001 From: Gerald Baulig Date: Wed, 10 Jul 2024 13:45:10 +0200 Subject: [PATCH] fix(jobs): re-arange import order --- datasets/demo-shop/jobs/job_master.json | 12 ++++++------ datasets/system/data/seed-data/organizations.yaml | 12 ------------ datasets/system/generator/unit-codes/transform.js | 3 --- datasets/system/jobs/job_extra.json | 2 +- datasets/system/jobs/job_master.json | 12 ++++++------ package.json | 4 ++-- 6 files changed, 15 insertions(+), 30 deletions(-) diff --git a/datasets/demo-shop/jobs/job_master.json b/datasets/demo-shop/jobs/job_master.json index eadc121..73cfa8f 100644 --- a/datasets/demo-shop/jobs/job_master.json +++ b/datasets/demo-shop/jobs/job_master.json @@ -4,6 +4,12 @@ "concurrency": 1 }, "tasks": [ + { + "name": "organizations", + "operation": "sync", + "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": "addresses", "operation": "sync", @@ -16,12 +22,6 @@ "filter": "contact_points.yaml", "mutation": "mutation{ master_data { contact_point { Mutate( input: { items: ${resource_list}, totalCount: 0, mode: UPSERT } ) { details{items {status {id, code, message}}, operationStatus { code message } } } } } }" }, - { - "name": "organizations", - "operation": "sync", - "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": "customers", "operation": "sync", diff --git a/datasets/system/data/seed-data/organizations.yaml b/datasets/system/data/seed-data/organizations.yaml index 5fe8d53..1f80b7a 100644 --- a/datasets/system/data/seed-data/organizations.yaml +++ b/datasets/system/data/seed-data/organizations.yaml @@ -1,19 +1,7 @@ --- id: system name: SYSTEM - contactPointIds: [] - website: "" - email: "" - vatId: "" - isicV4: "" - registration: "" - logo: - url: "" - registrationCourt: "" - paymentMethodIds: [] - parentId: "" meta: - modifiedBy: "" owners: - id: urn:restorecommerce:acs:names:ownerIndicatoryEntity value: urn:restorecommerce:acs:model:organization.Organization diff --git a/datasets/system/generator/unit-codes/transform.js b/datasets/system/generator/unit-codes/transform.js index f3958ff..073e87b 100644 --- a/datasets/system/generator/unit-codes/transform.js +++ b/datasets/system/generator/unit-codes/transform.js @@ -80,9 +80,6 @@ function transform() { code.id = 'un-cefact-cc-' + code.commonCode; code.meta = { - created: new Date().toISOString(), - modified: new Date().toISOString(), - modifiedBy: '', owners: [ { id: 'urn:restorecommerce:acs:names:ownerIndicatoryEntity', diff --git a/datasets/system/jobs/job_extra.json b/datasets/system/jobs/job_extra.json index 8af64d7..215d639 100644 --- a/datasets/system/jobs/job_extra.json +++ b/datasets/system/jobs/job_extra.json @@ -9,7 +9,7 @@ "operation": "sync", "filter": "unit_codes*.yaml", "batchSize": 100, - "mutation": "mutation mutateCodes($var: [IIoRestorecommerceUnitCodeUnitCode!]!){ master_data { unit_code { Mutate( input: { items: $var, totalCount: 0, mode: UPSERT } ) { details{items {status {id, code, message}}, operationStatus { code message } } } } }}" + "mutation": "mutation mutateUnitCodes($var: [IIoRestorecommerceUnitCodeUnitCode!]!){ master_data { unit_code { Mutate( input: { items: $var, totalCount: 0, mode: UPSERT } ) { details{items {status {id, code, message}}, operationStatus { code message } } } } }}" } ] } diff --git a/datasets/system/jobs/job_master.json b/datasets/system/jobs/job_master.json index c00c564..bd87be3 100644 --- a/datasets/system/jobs/job_master.json +++ b/datasets/system/jobs/job_master.json @@ -4,6 +4,12 @@ "concurrency": 1 }, "tasks": [ + { + "name": "organizations", + "operation": "sync", + "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": "countries", "operation": "sync", @@ -45,12 +51,6 @@ "operation": "sync", "filter": "contact_point_types.yaml", "mutation": "mutation{ master_data { contact_point_type { Mutate( input: { items: ${resource_list}, totalCount: 0, mode: UPSERT } ) { details{items {status {id, code, message}}, operationStatus { code message } } } } }}" - }, - { - "name": "organizations", - "operation": "sync", - "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 } } } } }}" } ] } diff --git a/package.json b/package.json index 0aa7fec..d7fca51 100644 --- a/package.json +++ b/package.json @@ -31,10 +31,10 @@ "scripts": { "build": "tsc -d -P tsconfig.objects.json", "import": "npm-run-all import:system import:demoshop", - "import:system": "npm-run-all import:system:master import:system:identity import:system:rules import:system:extra", - "import:system:master": "node dataset.js import -d system -j master", + "import:system": "npm-run-all import:system:identity import:system:master import:system:extra", "import:system:rules": "node dataset.js import -d system -j rules", "import:system:identity": "node dataset.js import -d system -j identity", + "import:system:master": "node dataset.js import -d system -j master", "import:system:extra": "node dataset.js import -d system -j extra", "import:demoshop": "npm-run-all import:demoshop:master import:demoshop:catalog import:demoshop:fulfillment", "import:demoshop:master": "node dataset.js import -d demo-shop -j master",