From 6c7db41a8b212a1f06f63dff16791bb04e533c26 Mon Sep 17 00:00:00 2001
From: Johannes Buechele <johannes@bujo.at>
Date: Wed, 30 Aug 2023 11:48:53 +0200
Subject: [PATCH] added missing work id to meta file

---
 .../java/eu/fairkom/faircommons/common/mappers/WorkMapper.java  | 1 +
 .../fairkom/faircommons/common/models/views/MetaDataView.java   | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/faircommons-services/common/src/main/java/eu/fairkom/faircommons/common/mappers/WorkMapper.java b/faircommons-services/common/src/main/java/eu/fairkom/faircommons/common/mappers/WorkMapper.java
index 6da3b1f..50b31b9 100644
--- a/faircommons-services/common/src/main/java/eu/fairkom/faircommons/common/mappers/WorkMapper.java
+++ b/faircommons-services/common/src/main/java/eu/fairkom/faircommons/common/mappers/WorkMapper.java
@@ -58,6 +58,7 @@ public abstract class WorkMapper extends BaseMapper<Work, WorkView, UUID> {
     public abstract WorkFileView toWorkFileView(WorkFile workFile);
 
     @Mapping(target = "licenseIdentifier", source = "license.identifier")
+    @Mapping(target = "workId", source = "id")
     public abstract MetaDataView toMetaDataView(Work work);
 
     public abstract IpfsEntryView toIpfsView(IpfsEntry ipfsEntry);
diff --git a/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/models/views/MetaDataView.java b/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/models/views/MetaDataView.java
index 7c37056..ae81d80 100644
--- a/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/models/views/MetaDataView.java
+++ b/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/models/views/MetaDataView.java
@@ -8,6 +8,7 @@ import lombok.extern.jackson.Jacksonized;
 
 import java.io.Serializable;
 import java.time.ZonedDateTime;
+import java.util.UUID;
 
 //all attributes immutable
 
@@ -15,6 +16,7 @@ import java.time.ZonedDateTime;
 @Builder
 @Jacksonized
 public class MetaDataView implements Serializable {
+    UUID workId;
     String title;
     String description;
     ZonedDateTime creationDate;
-- 
GitLab