From fe8814ad06c2db5ae3a5a19d7e0352a338987e4c Mon Sep 17 00:00:00 2001
From: JordenReuter <149687553+JordenReuter@users.noreply.github.com>
Date: Thu, 22 Feb 2024 20:07:08 +0100
Subject: [PATCH] feat: added operator to ms and icon in mfe api (#38)
---
.../product/store/domain/models/Microservice.java | 3 +++
.../rs/internal/mappers/MicroserviceMapper.java | 2 ++
.../ms/v1/mappers/OperatorMsMapperV1.java | 2 ++
.../openapi/onecx-product-store-internal.yaml | 6 ++++++
src/main/resources/db/changeLog.xml | 1 +
.../db/v1/2024-02-22-ms-operator-field.xml | 15 +++++++++++++++
src/test/resources/data/test-internal.xml | 6 +++---
src/test/resources/data/test-operator-ms.xml | 4 ++--
src/test/resources/data/test-v1.xml | 4 ++--
9 files changed, 36 insertions(+), 7 deletions(-)
create mode 100644 src/main/resources/db/v1/2024-02-22-ms-operator-field.xml
diff --git a/src/main/java/org/tkit/onecx/product/store/domain/models/Microservice.java b/src/main/java/org/tkit/onecx/product/store/domain/models/Microservice.java
index 68ba473..cf24b6b 100644
--- a/src/main/java/org/tkit/onecx/product/store/domain/models/Microservice.java
+++ b/src/main/java/org/tkit/onecx/product/store/domain/models/Microservice.java
@@ -36,4 +36,7 @@ public class Microservice extends TraceableEntity {
@Column(name = "PRODUCT_NAME")
private String productName;
+ @Column(name = "OPERATOR", nullable = false)
+ private boolean operator;
+
}
diff --git a/src/main/java/org/tkit/onecx/product/store/rs/internal/mappers/MicroserviceMapper.java b/src/main/java/org/tkit/onecx/product/store/rs/internal/mappers/MicroserviceMapper.java
index a904c30..381ebf1 100644
--- a/src/main/java/org/tkit/onecx/product/store/rs/internal/mappers/MicroserviceMapper.java
+++ b/src/main/java/org/tkit/onecx/product/store/rs/internal/mappers/MicroserviceMapper.java
@@ -19,6 +19,7 @@ public interface MicroserviceMapper {
@Mapping(target = "creationUser", ignore = true)
@Mapping(target = "creationDate", ignore = true)
@Mapping(target = "controlTraceabilityManual", ignore = true)
+ @Mapping(target = "operator", constant = "false")
Microservice create(CreateMicroserviceRequestDTO dto);
@Mapping(target = "persisted", ignore = true)
@@ -29,6 +30,7 @@ public interface MicroserviceMapper {
@Mapping(target = "creationUser", ignore = true)
@Mapping(target = "creationDate", ignore = true)
@Mapping(target = "controlTraceabilityManual", ignore = true)
+ @Mapping(target = "operator", constant = "false")
void update(UpdateMicroserviceRequestDTO dto, @MappingTarget Microservice data);
MicroserviceSearchCriteria map(MicroserviceSearchCriteriaDTO dto);
diff --git a/src/main/java/org/tkit/onecx/product/store/rs/operator/ms/v1/mappers/OperatorMsMapperV1.java b/src/main/java/org/tkit/onecx/product/store/rs/operator/ms/v1/mappers/OperatorMsMapperV1.java
index 9155f0f..9a9a0a5 100644
--- a/src/main/java/org/tkit/onecx/product/store/rs/operator/ms/v1/mappers/OperatorMsMapperV1.java
+++ b/src/main/java/org/tkit/onecx/product/store/rs/operator/ms/v1/mappers/OperatorMsMapperV1.java
@@ -20,6 +20,7 @@ public interface OperatorMsMapperV1 {
@Mapping(target = "creationUser", ignore = true)
@Mapping(target = "creationDate", ignore = true)
@Mapping(target = "controlTraceabilityManual", ignore = true)
+ @Mapping(target = "operator", constant = "true")
@Mapping(target = "appId", ignore = true)
Microservice create(UpdateMsRequestMsDTOv1 dto);
@@ -32,6 +33,7 @@ public interface OperatorMsMapperV1 {
@Mapping(target = "creationUser", ignore = true)
@Mapping(target = "creationDate", ignore = true)
@Mapping(target = "controlTraceabilityManual", ignore = true)
+ @Mapping(target = "operator", constant = "true")
@Mapping(target = "appId", ignore = true)
void update(@MappingTarget Microservice ms, UpdateMsRequestMsDTOv1 dto);
}
diff --git a/src/main/openapi/onecx-product-store-internal.yaml b/src/main/openapi/onecx-product-store-internal.yaml
index 6f16f10..ebff938 100644
--- a/src/main/openapi/onecx-product-store-internal.yaml
+++ b/src/main/openapi/onecx-product-store-internal.yaml
@@ -692,6 +692,8 @@ components:
type: string
description:
type: string
+ iconName:
+ type: string
technology:
type: string
remoteBaseUrl:
@@ -741,6 +743,8 @@ components:
type: string
productName:
type: string
+ operator:
+ type: boolean
MicrofrontendSearchCriteria:
type: object
properties:
@@ -1005,6 +1009,8 @@ components:
type: string
productName:
type: string
+ operator:
+ type: boolean
UIEndpoint:
required:
- path
diff --git a/src/main/resources/db/changeLog.xml b/src/main/resources/db/changeLog.xml
index 5eb5a3e..70efd6d 100644
--- a/src/main/resources/db/changeLog.xml
+++ b/src/main/resources/db/changeLog.xml
@@ -7,4 +7,5 @@
+
\ No newline at end of file
diff --git a/src/main/resources/db/v1/2024-02-22-ms-operator-field.xml b/src/main/resources/db/v1/2024-02-22-ms-operator-field.xml
new file mode 100644
index 0000000..ac2facf
--- /dev/null
+++ b/src/main/resources/db/v1/2024-02-22-ms-operator-field.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/test/resources/data/test-internal.xml b/src/test/resources/data/test-internal.xml
index 218649b..058a8f6 100644
--- a/src/test/resources/data/test-internal.xml
+++ b/src/test/resources/data/test-internal.xml
@@ -15,9 +15,9 @@
operator="false" optlock="0" app_version="1.0.0" contact="developers@1000kit.org" description="some text" icon_name="sun" note="some notes" technology="Angular" creationDate="2024-01-11 12:21:38.914993" modificationDate="2024-01-11 12:21:38.914993"
classification="searching"/>
-
-
-
+
+
+
diff --git a/src/test/resources/data/test-operator-ms.xml b/src/test/resources/data/test-operator-ms.xml
index 2c7629a..08aa9ab 100644
--- a/src/test/resources/data/test-operator-ms.xml
+++ b/src/test/resources/data/test-operator-ms.xml
@@ -3,8 +3,8 @@
+ operator="false"/>
+ operator="false"/>
\ No newline at end of file
diff --git a/src/test/resources/data/test-v1.xml b/src/test/resources/data/test-v1.xml
index a8dac0b..3dff22f 100644
--- a/src/test/resources/data/test-v1.xml
+++ b/src/test/resources/data/test-v1.xml
@@ -6,8 +6,8 @@
-
-
+
+