diff --git a/src/main/java/onlydust/com/marketplace/kernel/model/ProgramId.java b/src/main/java/onlydust/com/marketplace/kernel/model/ProgramId.java index a71bdb8..37eaf87 100644 --- a/src/main/java/onlydust/com/marketplace/kernel/model/ProgramId.java +++ b/src/main/java/onlydust/com/marketplace/kernel/model/ProgramId.java @@ -1,5 +1,6 @@ package onlydust.com.marketplace.kernel.model; +import com.fasterxml.jackson.annotation.JsonCreator; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import lombok.NonNull; @@ -15,6 +16,7 @@ public static ProgramId of(@NonNull final UUID uuid) { return ProgramId.builder().uuid(uuid).build(); } + @JsonCreator public static ProgramId of(@NonNull final String uuid) { return ProgramId.of(UUID.fromString(uuid)); } diff --git a/src/main/java/onlydust/com/marketplace/kernel/model/ProjectId.java b/src/main/java/onlydust/com/marketplace/kernel/model/ProjectId.java index 821c23a..e3b2fb3 100644 --- a/src/main/java/onlydust/com/marketplace/kernel/model/ProjectId.java +++ b/src/main/java/onlydust/com/marketplace/kernel/model/ProjectId.java @@ -1,5 +1,6 @@ package onlydust.com.marketplace.kernel.model; +import com.fasterxml.jackson.annotation.JsonCreator; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import lombok.NonNull; @@ -15,6 +16,7 @@ public static ProjectId of(@NonNull final UUID uuid) { return ProjectId.builder().uuid(uuid).build(); } + @JsonCreator public static ProjectId of(@NonNull final String uuid) { return ProjectId.of(UUID.fromString(uuid)); } diff --git a/src/main/java/onlydust/com/marketplace/kernel/model/RewardId.java b/src/main/java/onlydust/com/marketplace/kernel/model/RewardId.java index dc62c06..b0dc242 100644 --- a/src/main/java/onlydust/com/marketplace/kernel/model/RewardId.java +++ b/src/main/java/onlydust/com/marketplace/kernel/model/RewardId.java @@ -1,5 +1,6 @@ package onlydust.com.marketplace.kernel.model; +import com.fasterxml.jackson.annotation.JsonCreator; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import lombok.NonNull; @@ -15,6 +16,7 @@ public static RewardId of(@NonNull final UUID uuid) { return RewardId.builder().uuid(uuid).build(); } + @JsonCreator public static RewardId of(@NonNull final String uuid) { return RewardId.of(UUID.fromString(uuid)); } diff --git a/src/main/java/onlydust/com/marketplace/kernel/model/SponsorId.java b/src/main/java/onlydust/com/marketplace/kernel/model/SponsorId.java index 914f502..8785a8f 100644 --- a/src/main/java/onlydust/com/marketplace/kernel/model/SponsorId.java +++ b/src/main/java/onlydust/com/marketplace/kernel/model/SponsorId.java @@ -1,5 +1,6 @@ package onlydust.com.marketplace.kernel.model; +import com.fasterxml.jackson.annotation.JsonCreator; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import lombok.NonNull; @@ -15,6 +16,7 @@ public static SponsorId of(@NonNull final UUID uuid) { return SponsorId.builder().uuid(uuid).build(); } + @JsonCreator public static SponsorId of(@NonNull final String uuid) { return SponsorId.of(UUID.fromString(uuid)); } diff --git a/src/main/java/onlydust/com/marketplace/kernel/model/UserId.java b/src/main/java/onlydust/com/marketplace/kernel/model/UserId.java index 466ab73..cad7405 100644 --- a/src/main/java/onlydust/com/marketplace/kernel/model/UserId.java +++ b/src/main/java/onlydust/com/marketplace/kernel/model/UserId.java @@ -1,5 +1,6 @@ package onlydust.com.marketplace.kernel.model; +import com.fasterxml.jackson.annotation.JsonCreator; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import lombok.NonNull; @@ -15,6 +16,7 @@ public static UserId of(@NonNull final UUID uuid) { return UserId.builder().uuid(uuid).build(); } + @JsonCreator public static UserId of(@NonNull final String uuid) { return UserId.of(UUID.fromString(uuid)); } diff --git a/src/main/java/onlydust/com/marketplace/kernel/model/UuidWrapper.java b/src/main/java/onlydust/com/marketplace/kernel/model/UuidWrapper.java index e9511b3..511db10 100644 --- a/src/main/java/onlydust/com/marketplace/kernel/model/UuidWrapper.java +++ b/src/main/java/onlydust/com/marketplace/kernel/model/UuidWrapper.java @@ -15,6 +15,7 @@ public abstract class UuidWrapper { @Builder.Default private final UUID uuid = UUID.randomUUID(); + @Override public String toString() { return uuid.toString(); }