From 66d46ac9d8c766a30d3ad8b55bea7f9175ad1703 Mon Sep 17 00:00:00 2001 From: Jaro Hartmann Date: Thu, 11 Apr 2024 11:23:56 +0200 Subject: [PATCH] chore(irs-api):[#357] Add json aliases to relationship aspects --- .../tractusx/irs/edc/client/SingleLevelBomAsPlanned.java | 3 +++ .../tractusx/irs/edc/client/SingleLevelBomAsSpecified.java | 3 +++ .../tractusx/irs/edc/client/SingleLevelUsageAsBuilt.java | 3 +++ 3 files changed, 9 insertions(+) diff --git a/irs-edc-client/src/main/java/org/eclipse/tractusx/irs/edc/client/SingleLevelBomAsPlanned.java b/irs-edc-client/src/main/java/org/eclipse/tractusx/irs/edc/client/SingleLevelBomAsPlanned.java index a8357f66e9..a9c65c9532 100644 --- a/irs-edc-client/src/main/java/org/eclipse/tractusx/irs/edc/client/SingleLevelBomAsPlanned.java +++ b/irs-edc-client/src/main/java/org/eclipse/tractusx/irs/edc/client/SingleLevelBomAsPlanned.java @@ -30,6 +30,7 @@ import java.util.Optional; import java.util.Set; +import com.fasterxml.jackson.annotation.JsonAlias; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -121,7 +122,9 @@ private boolean thereIsQuantity() { @Jacksonized /* package */ static class Quantity { + @JsonAlias({ "quantityNumber", "value" }) private Double quantityNumber; + @JsonAlias({ "measurementUnit", "unit" }) private Object measurementUnit; /** diff --git a/irs-edc-client/src/main/java/org/eclipse/tractusx/irs/edc/client/SingleLevelBomAsSpecified.java b/irs-edc-client/src/main/java/org/eclipse/tractusx/irs/edc/client/SingleLevelBomAsSpecified.java index 427ffabdac..9f5277a9c9 100644 --- a/irs-edc-client/src/main/java/org/eclipse/tractusx/irs/edc/client/SingleLevelBomAsSpecified.java +++ b/irs-edc-client/src/main/java/org/eclipse/tractusx/irs/edc/client/SingleLevelBomAsSpecified.java @@ -29,6 +29,7 @@ import java.util.Optional; import java.util.Set; +import com.fasterxml.jackson.annotation.JsonAlias; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -119,7 +120,9 @@ public Relationship toRelationship(final String catenaXId) { @Data @Jacksonized /* package */ static class PartQuantity { + @JsonAlias({ "quantityNumber", "value" }) private Double quantityNumber; + @JsonAlias({ "measurementUnit", "unit" }) private String measurementUnit; } } diff --git a/irs-edc-client/src/main/java/org/eclipse/tractusx/irs/edc/client/SingleLevelUsageAsBuilt.java b/irs-edc-client/src/main/java/org/eclipse/tractusx/irs/edc/client/SingleLevelUsageAsBuilt.java index fb14cdf855..411dc4023c 100644 --- a/irs-edc-client/src/main/java/org/eclipse/tractusx/irs/edc/client/SingleLevelUsageAsBuilt.java +++ b/irs-edc-client/src/main/java/org/eclipse/tractusx/irs/edc/client/SingleLevelUsageAsBuilt.java @@ -29,6 +29,7 @@ import java.util.Optional; import java.util.Set; +import com.fasterxml.jackson.annotation.JsonAlias; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -128,7 +129,9 @@ private boolean thereIsQuantity() { @Jacksonized /* package */ static class Quantity { + @JsonAlias({ "quantityNumber", "value" }) private Double quantityNumber; + @JsonAlias({ "measurementUnit", "unit" }) private String measurementUnit; }