From 0a93a9f6352b6ddd83d56d5e1aefcef457cee25a Mon Sep 17 00:00:00 2001 From: zhiyaoPCCW <110662017+zhiyaoPCCW@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:17:58 +0800 Subject: [PATCH] fix(sdk): add more state check for completionDate (#226) --- .../api-target-mapper.order.eline.read.delete.yaml | 2 +- .../api-target-mapper.order.eline.read.yaml | 2 +- .../api-target-mapper.order.uni.read.delete.yaml | 2 +- .../api-target-mapper.order.uni.read.yaml | 2 +- .../src/main/resources/mef-sonata/product.yaml | 2 +- .../mef-sonata/template-upgrade/release.1.5.23.yaml | 13 +++++++++++++ 6 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/template-upgrade/release.1.5.23.yaml diff --git a/kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/api-targets-mappers/api-target-mapper.order.eline.read.delete.yaml b/kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/api-targets-mappers/api-target-mapper.order.eline.read.delete.yaml index 6b455cbc..3944631f 100644 --- a/kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/api-targets-mappers/api-target-mapper.order.eline.read.delete.yaml +++ b/kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/api-targets-mappers/api-target-mapper.order.eline.read.delete.yaml @@ -63,7 +63,7 @@ spec: source: "" sourceLocation: "BODY" target: "@{{completionDate}}" - checkPath: "$[?(@.state == 'completed')]" + checkPath: "$[?(@.state == 'completed'||@.state == 'failed'||@.state == 'partial'||@.state == 'rejected'||@.state == 'cancelled')]" deletePath: "$.completionDate" targetLocation: "BODY" requiredMapping: false diff --git a/kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/api-targets-mappers/api-target-mapper.order.eline.read.yaml b/kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/api-targets-mappers/api-target-mapper.order.eline.read.yaml index f95bdb20..9e3a7a6f 100644 --- a/kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/api-targets-mappers/api-target-mapper.order.eline.read.yaml +++ b/kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/api-targets-mappers/api-target-mapper.order.eline.read.yaml @@ -65,7 +65,7 @@ spec: sourceLocation: "BODY" target: "@{{completionDate}}" targetLocation: "BODY" - checkPath: "$[?(@.state == 'completed')]" + checkPath: "$[?(@.state == 'completed'||@.state == 'failed'||@.state == 'partial'||@.state == 'rejected'||@.state == 'cancelled')]" deletePath: "$.completionDate" requiredMapping: false - name: mapper.order.eline.read.instanceId diff --git a/kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/api-targets-mappers/api-target-mapper.order.uni.read.delete.yaml b/kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/api-targets-mappers/api-target-mapper.order.uni.read.delete.yaml index 3f98cd33..af037673 100644 --- a/kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/api-targets-mappers/api-target-mapper.order.uni.read.delete.yaml +++ b/kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/api-targets-mappers/api-target-mapper.order.uni.read.delete.yaml @@ -64,7 +64,7 @@ spec: source: "" sourceLocation: "BODY" target: "@{{completionDate}}" - checkPath: "$[?(@.state == 'completed')]" + checkPath: "$[?(@.state == 'completed'||@.state == 'failed'||@.state == 'partial'||@.state == 'rejected'||@.state == 'cancelled')]" deletePath: "$.completionDate" targetLocation: "BODY" requiredMapping: false diff --git a/kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/api-targets-mappers/api-target-mapper.order.uni.read.yaml b/kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/api-targets-mappers/api-target-mapper.order.uni.read.yaml index 96535569..5e1476fd 100644 --- a/kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/api-targets-mappers/api-target-mapper.order.uni.read.yaml +++ b/kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/api-targets-mappers/api-target-mapper.order.uni.read.yaml @@ -65,7 +65,7 @@ spec: source: "" sourceLocation: "BODY" target: "@{{completionDate}}" - checkPath: "$[?(@.state == 'completed')]" + checkPath: "$[?(@.state == 'completed'||@.state == 'failed'||@.state == 'partial'||@.state == 'rejected'||@.state == 'cancelled')]" deletePath: "$.completionDate" targetLocation: "BODY" requiredMapping: false diff --git a/kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/product.yaml b/kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/product.yaml index 23d87bec..99b292cc 100644 --- a/kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/product.yaml +++ b/kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/product.yaml @@ -98,7 +98,7 @@ spec: - classpath:/mef-sonata/mapping-matrix/mapping.matrix.inventory.eline.read.yaml - classpath:/mef-sonata/mapping-matrix/mapping.matrix.inventory.uni.list.yaml - classpath:/mef-sonata/mapping-matrix/mapping.matrix.inventory.eline.list.yaml - - classpath:/mef-sonata/template-upgrade/release.1.5.22.yaml + - classpath:/mef-sonata/template-upgrade/release.1.5.23.yaml templateUpgradePaths: diff --git a/kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/template-upgrade/release.1.5.23.yaml b/kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/template-upgrade/release.1.5.23.yaml new file mode 100644 index 00000000..beeb40c5 --- /dev/null +++ b/kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/template-upgrade/release.1.5.23.yaml @@ -0,0 +1,13 @@ +--- +kind: kraken.product.template-upgrade +apiVersion: v1 +metadata: + key: kraken.product.template-upgrade.1.5.23 + name: V1.5.23 + labels: + productSpec: grace + productVersion: V1.5.23 + publishDate: 2024-11-22 + description: | + Remove completionDate when state != completed. + version: 2 \ No newline at end of file