diff --git a/apps/sepuling-java/src/main/java/smecalculus/bezmen/construction/App.java b/apps/sepuling-java/src/main/java/smecalculus/bezmen/construction/App.java index 7900bab0..f40121f6 100644 --- a/apps/sepuling-java/src/main/java/smecalculus/bezmen/construction/App.java +++ b/apps/sepuling-java/src/main/java/smecalculus/bezmen/construction/App.java @@ -9,8 +9,8 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.context.annotation.PropertySource; -import smecalculus.bezmen.core.SepulkaMapper; -import smecalculus.bezmen.core.SepulkaMapperImpl; +import smecalculus.bezmen.core.SepulkaConverter; +import smecalculus.bezmen.core.SepulkaConverterImpl; import smecalculus.bezmen.core.SepulkaService; import smecalculus.bezmen.core.SepulkaServiceImpl; import smecalculus.bezmen.messaging.SepulkaClient; @@ -53,13 +53,13 @@ SepulkaClient sepulkaClient(EdgeValidator validator, SepulkaMessageMapper mapper } @Bean - SepulkaMapper sepulkaMapper() { - return new SepulkaMapperImpl(); + SepulkaConverter sepulkaConverter() { + return new SepulkaConverterImpl(); } @Bean - SepulkaService sepulkaService(SepulkaMapper mapper, SepulkaDao dao) { - return new SepulkaServiceImpl(mapper, dao); + SepulkaService sepulkaService(SepulkaConverter converter, SepulkaDao dao) { + return new SepulkaServiceImpl(converter, dao); } @Bean diff --git a/apps/sepuling-java/src/main/java/smecalculus/bezmen/core/SepulkaServiceImpl.java b/apps/sepuling-java/src/main/java/smecalculus/bezmen/core/SepulkaServiceImpl.java index 5f4d1bcf..c8e73072 100644 --- a/apps/sepuling-java/src/main/java/smecalculus/bezmen/core/SepulkaServiceImpl.java +++ b/apps/sepuling-java/src/main/java/smecalculus/bezmen/core/SepulkaServiceImpl.java @@ -17,7 +17,7 @@ public class SepulkaServiceImpl implements SepulkaService { @NonNull - private SepulkaMapper mapper; + private SepulkaConverter converter; @NonNull private SepulkaDao dao; @@ -25,14 +25,14 @@ public class SepulkaServiceImpl implements SepulkaService { @Override public RegistrationResponse register(RegistrationRequest request) { var now = LocalDateTime.now(); - var sepulkaCreated = mapper.toState(request) + var sepulkaCreated = converter.toState(request) .internalId(randomUUID()) .revision(0) .createdAt(now) .updatedAt(now) .build(); var sepulkaSaved = dao.add(sepulkaCreated); - return mapper.toMessage(sepulkaSaved).build(); + return converter.toMessage(sepulkaSaved).build(); } @Override diff --git a/apps/sepuling-kotlin/src/main/kotlin/smecalculus/bezmen/construction/App.kt b/apps/sepuling-kotlin/src/main/kotlin/smecalculus/bezmen/construction/App.kt index c13f12fc..1e824408 100644 --- a/apps/sepuling-kotlin/src/main/kotlin/smecalculus/bezmen/construction/App.kt +++ b/apps/sepuling-kotlin/src/main/kotlin/smecalculus/bezmen/construction/App.kt @@ -8,8 +8,8 @@ import org.springframework.context.annotation.PropertySource import smecalculus.bezmen.configuration.MessagingDm.MappingMode.SPRING_MVC import smecalculus.bezmen.configuration.StorageDm.MappingMode.MY_BATIS import smecalculus.bezmen.configuration.StorageDm.MappingMode.SPRING_DATA -import smecalculus.bezmen.core.SepulkaMapper -import smecalculus.bezmen.core.SepulkaMapperImpl +import smecalculus.bezmen.core.SepulkaConverter +import smecalculus.bezmen.core.SepulkaConverterImpl import smecalculus.bezmen.core.SepulkaService import smecalculus.bezmen.core.SepulkaServiceImpl import smecalculus.bezmen.messaging.SepulkaClient @@ -55,13 +55,13 @@ class App { } @Bean - fun sepulkaMapper(): SepulkaMapper { - return SepulkaMapperImpl() + fun sepulkaConverter(): SepulkaConverter { + return SepulkaConverterImpl() } @Bean fun sepulkaService( - mapper: SepulkaMapper, + mapper: SepulkaConverter, dao: SepulkaDao, ): SepulkaService { return SepulkaServiceImpl(mapper, dao) diff --git a/apps/sepuling-kotlin/src/main/kotlin/smecalculus/bezmen/core/SepulkaServiceImpl.kt b/apps/sepuling-kotlin/src/main/kotlin/smecalculus/bezmen/core/SepulkaServiceImpl.kt index 1214668e..8c8bb3bb 100644 --- a/apps/sepuling-kotlin/src/main/kotlin/smecalculus/bezmen/core/SepulkaServiceImpl.kt +++ b/apps/sepuling-kotlin/src/main/kotlin/smecalculus/bezmen/core/SepulkaServiceImpl.kt @@ -9,20 +9,20 @@ import java.time.LocalDateTime import java.util.UUID class SepulkaServiceImpl( - private val mapper: SepulkaMapper, + private val converter: SepulkaConverter, private val dao: SepulkaDao, ) : SepulkaService { override fun register(request: RegistrationRequest): RegistrationResponse { val now = LocalDateTime.now() val sepulkaCreated = - mapper.toState(request) + converter.toState(request) .internalId(UUID.randomUUID()) .revision(0) .createdAt(now) .updatedAt(now) .build() val sepulkaSaved = dao.add(sepulkaCreated) - return mapper.toMessage(sepulkaSaved).build() + return converter.toMessage(sepulkaSaved).build() } override fun view(request: PreviewRequest): List { diff --git a/apps/sepuling-kotlin/src/main/kotlin/smecalculus/bezmen/storage/SepulkaStateEm.kt b/apps/sepuling-kotlin/src/main/kotlin/smecalculus/bezmen/storage/SepulkaStateEm.kt deleted file mode 100644 index e62373af..00000000 --- a/apps/sepuling-kotlin/src/main/kotlin/smecalculus/bezmen/storage/SepulkaStateEm.kt +++ /dev/null @@ -1,48 +0,0 @@ -package smecalculus.bezmen.storage - -import org.springframework.data.annotation.Id -import org.springframework.data.domain.Persistable -import org.springframework.data.relational.core.mapping.Column -import org.springframework.data.relational.core.mapping.Table -import java.time.LocalDateTime -import java.util.UUID - -abstract class SepulkaStateEm { - data class Existence( - var internalId: UUID?, - var externalId: String?, - ) - - data class Preview( - var internalId: UUID?, - var externalId: String?, - var createdAt: LocalDateTime?, - ) - - data class Touch( - var revision: Int?, - var updatedAt: LocalDateTime?, - ) - - @Table("sepulkas") - data class AggregateRoot( - @Id - var internalId: UUID?, - @Column - var externalId: String?, - @Column - var revision: Int?, - @Column - var createdAt: LocalDateTime?, - @Column - var updatedAt: LocalDateTime?, - ) : Persistable { - override fun getId(): UUID? { - return internalId - } - - override fun isNew(): Boolean { - return true - } - } -} diff --git a/apps/sepuling-kotlin/src/main/kotlin/smecalculus/bezmen/storage/SepulkaStateMapper.kt b/apps/sepuling-kotlin/src/main/kotlin/smecalculus/bezmen/storage/SepulkaStateMapper.kt deleted file mode 100644 index 6c462414..00000000 --- a/apps/sepuling-kotlin/src/main/kotlin/smecalculus/bezmen/storage/SepulkaStateMapper.kt +++ /dev/null @@ -1,18 +0,0 @@ -package smecalculus.bezmen.storage - -import io.mcarle.konvert.api.Konverter -import smecalculus.bezmen.core.SepulkaStateDm -import smecalculus.bezmen.mapping.EdgeMapper - -@Konverter -interface SepulkaStateMapper : EdgeMapper { - fun toEdge(state: SepulkaStateDm.AggregateRoot): SepulkaStateEm.AggregateRoot - - fun toDomain(state: SepulkaStateEm.AggregateRoot): SepulkaStateDm.AggregateRoot - - fun toEdge(state: SepulkaStateDm.Touch): SepulkaStateEm.Touch - - fun toDomain(state: SepulkaStateEm.Existence): SepulkaStateDm.Existence - - fun toDomain(state: SepulkaStateEm.Preview): SepulkaStateDm.Preview -} diff --git a/libs/abstraction-client/src/main/java/smecalculus/bezmen/mapping/EdgeMapper.java b/libs/abstraction-client/src/main/java/smecalculus/bezmen/mapping/EdgeMapper.java deleted file mode 100644 index 5349e64a..00000000 --- a/libs/abstraction-client/src/main/java/smecalculus/bezmen/mapping/EdgeMapper.java +++ /dev/null @@ -1,5 +0,0 @@ -package smecalculus.bezmen.mapping; - -public interface EdgeMapper { - // nothing here yet -} diff --git a/libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaMapper.java b/libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaConverter.java similarity index 91% rename from libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaMapper.java rename to libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaConverter.java index cb4e4597..62730387 100644 --- a/libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaMapper.java +++ b/libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaConverter.java @@ -6,7 +6,7 @@ import smecalculus.bezmen.core.SepulkaStateDm.AggregateRoot; @Mapper -public interface SepulkaMapper { +public interface SepulkaConverter { AggregateRoot.Builder toState(RegistrationRequest request); RegistrationResponse.Builder toMessage(AggregateRoot state); diff --git a/libs/essentials/src/main/java/smecalculus/bezmen/validation/ValidationPropsMapper.java b/libs/essentials/src/main/java/smecalculus/bezmen/validation/ValidationPropsMapper.java index d27fd4da..9c6c147b 100644 --- a/libs/essentials/src/main/java/smecalculus/bezmen/validation/ValidationPropsMapper.java +++ b/libs/essentials/src/main/java/smecalculus/bezmen/validation/ValidationPropsMapper.java @@ -5,10 +5,9 @@ import smecalculus.bezmen.configuration.ValidationDm; import smecalculus.bezmen.configuration.ValidationDm.ValidationMode; import smecalculus.bezmen.configuration.ValidationEm; -import smecalculus.bezmen.mapping.EdgeMapper; @Mapper -public interface ValidationPropsMapper extends EdgeMapper { +public interface ValidationPropsMapper { @Mapping(source = "mode", target = "validationMode") ValidationDm.ValidationProps toDomain(ValidationEm.ValidationProps props); diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingPropsMapper.java b/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingPropsMapper.java index f2eb4a10..ee7e8e0d 100644 --- a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingPropsMapper.java +++ b/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingPropsMapper.java @@ -4,10 +4,9 @@ import org.mapstruct.Mapping; import smecalculus.bezmen.configuration.MessagingDm.MappingMode; import smecalculus.bezmen.configuration.MessagingDm.ProtocolMode; -import smecalculus.bezmen.mapping.EdgeMapper; @Mapper -public interface MessagingPropsMapper extends EdgeMapper { +public interface MessagingPropsMapper { @Mapping(source = "protocol", target = "protocolProps") @Mapping(source = "mapping", target = "mappingProps") MessagingDm.MessagingProps toDomain(MessagingEm.MessagingProps propsEdge); diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/messaging/SepulkaMessageMapper.java b/libs/messaging/src/main/java/smecalculus/bezmen/messaging/SepulkaMessageMapper.java index cbf606a0..09dbb786 100644 --- a/libs/messaging/src/main/java/smecalculus/bezmen/messaging/SepulkaMessageMapper.java +++ b/libs/messaging/src/main/java/smecalculus/bezmen/messaging/SepulkaMessageMapper.java @@ -2,10 +2,9 @@ import org.mapstruct.Mapper; import smecalculus.bezmen.core.SepulkaMessageDm; -import smecalculus.bezmen.mapping.EdgeMapper; @Mapper -public interface SepulkaMessageMapper extends EdgeMapper { +public interface SepulkaMessageMapper { SepulkaMessageDm.RegistrationRequest toDomain(SepulkaMessageEm.RegistrationRequest request); SepulkaMessageEm.RegistrationResponse toEdge(SepulkaMessageDm.RegistrationResponse response); diff --git a/apps/sepuling-java/src/main/java/smecalculus/bezmen/storage/SepulkaStateEm.java b/libs/storage/src/main/java/smecalculus/bezmen/storage/SepulkaStateEm.java similarity index 100% rename from apps/sepuling-java/src/main/java/smecalculus/bezmen/storage/SepulkaStateEm.java rename to libs/storage/src/main/java/smecalculus/bezmen/storage/SepulkaStateEm.java diff --git a/apps/sepuling-java/src/main/java/smecalculus/bezmen/storage/SepulkaStateMapper.java b/libs/storage/src/main/java/smecalculus/bezmen/storage/SepulkaStateMapper.java similarity index 84% rename from apps/sepuling-java/src/main/java/smecalculus/bezmen/storage/SepulkaStateMapper.java rename to libs/storage/src/main/java/smecalculus/bezmen/storage/SepulkaStateMapper.java index 839a5b45..aa1ffaf5 100644 --- a/apps/sepuling-java/src/main/java/smecalculus/bezmen/storage/SepulkaStateMapper.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/storage/SepulkaStateMapper.java @@ -2,10 +2,9 @@ import org.mapstruct.Mapper; import smecalculus.bezmen.core.SepulkaStateDm; -import smecalculus.bezmen.mapping.EdgeMapper; @Mapper -public interface SepulkaStateMapper extends EdgeMapper { +public interface SepulkaStateMapper { SepulkaStateEm.AggregateRoot toEdge(SepulkaStateDm.AggregateRoot state); SepulkaStateDm.AggregateRoot toDomain(SepulkaStateEm.AggregateRoot state); diff --git a/pom.xml b/pom.xml index 080e736a..72f8862d 100644 --- a/pom.xml +++ b/pom.xml @@ -147,13 +147,6 @@ ${kotlin.version} ${maven.compiler.release} - - ksp - - - - - @@ -180,18 +173,6 @@ - - - com.dyescape - kotlin-maven-symbol-processing - 1.6 - - - io.mcarle - konvert - ${konvert.version} - - org.apache.maven.plugins