File tree Expand file tree Collapse file tree 12 files changed +418
-7
lines changed
org/springsource/restbucks/payment/web
test/java/de/odrotbohm/restbucks Expand file tree Collapse file tree 12 files changed +418
-7
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma
1919 <bytebuddy .version>1.17.6</bytebuddy .version>
2020 <datasource-micrometer .version>1.1.0</datasource-micrometer .version>
2121 <java .version>21</java .version>
22- <jmolecules .version>2025.0.0-SNAPSHOT</jmolecules .version>
22+ <jmolecules .version>2025.0.0-STEREOTYPE- SNAPSHOT</jmolecules .version>
2323 <spring-hateoas .version>3.0.0-SNAPSHOT</spring-hateoas .version>
2424 <spring-modulith .version>2.0.0-SNAPSHOT</spring-modulith .version>
2525
@@ -65,6 +65,21 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma
6565 <artifactId >jmolecules-starter-ddd</artifactId >
6666 </dependency >
6767
68+ <dependency >
69+ <groupId >org.jmolecules</groupId >
70+ <artifactId >jmolecules-ddd</artifactId >
71+ </dependency >
72+
73+ <dependency >
74+ <groupId >org.jmolecules</groupId >
75+ <artifactId >jmolecules-hexagonal-architecture</artifactId >
76+ </dependency >
77+
78+ <dependency >
79+ <groupId >org.jmolecules.integrations</groupId >
80+ <artifactId >jmolecules-stereotype</artifactId >
81+ </dependency >
82+
6883 <dependency >
6984 <groupId >org.jmolecules.integrations</groupId >
7085 <artifactId >jmolecules-jpa</artifactId >
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2025 the original author or authors.
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * https://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+ package de .odrotbohm .restbucks ;
17+
18+ import org .jmolecules .stereotype .Stereotype ;
19+
20+ /**
21+ * @author Oliver Drotbohm
22+ */
23+ @ Stereotype (groups = "restbucks" )
24+ public interface DTO {}
Original file line number Diff line number Diff line change 2121import java .util .List ;
2222
2323import org .jmolecules .ddd .integration .AssociationResolver ;
24+ import org .jmolecules .ddd .types .Repository ;
2425import org .springframework .data .repository .CrudRepository ;
2526import org .springframework .data .repository .PagingAndSortingRepository ;
2627import org .springframework .data .repository .query .Param ;
Original file line number Diff line number Diff line change 1+ @ org .jmolecules .architecture .hexagonal .Application
12@ org .jspecify .annotations .NullMarked
23package de .odrotbohm .restbucks .order ;
Original file line number Diff line number Diff line change 3232import org .jmolecules .ddd .types .AggregateRoot ;
3333import org .jmolecules .ddd .types .Association ;
3434import org .jmolecules .ddd .types .Identifier ;
35+ import org .jmolecules .ddd .types .ValueObject ;
3536import org .springframework .util .Assert ;
3637
3738/**
@@ -81,7 +82,7 @@ public Receipt getReceipt() {
8182 * @author Oliver Gierke
8283 */
8384 @ Value
84- public static class Receipt {
85+ public static class Receipt implements ValueObject {
8586
8687 private final LocalDateTime date ;
8788 private final Association <Order , OrderIdentifier > order ;
Original file line number Diff line number Diff line change 1+ @ org .jmolecules .architecture .hexagonal .Application
12@ org .jspecify .annotations .NullMarked
23package de .odrotbohm .restbucks .payment ;
4+
Original file line number Diff line number Diff line change 1717
1818import static org .springframework .hateoas .server .mvc .WebMvcLinkBuilder .*;
1919
20+ import de .odrotbohm .restbucks .DTO ;
2021import de .odrotbohm .restbucks .order .Order ;
2122import de .odrotbohm .restbucks .order .Orders ;
2223import de .odrotbohm .restbucks .payment .CreditCardNumber ;
2324import de .odrotbohm .restbucks .payment .Payment ;
24- import de .odrotbohm .restbucks .payment .PaymentService ;
2525import de .odrotbohm .restbucks .payment .Payment .Receipt ;
26+ import de .odrotbohm .restbucks .payment .PaymentService ;
2627import lombok .Data ;
2728import lombok .EqualsAndHashCode ;
2829import lombok .NonNull ;
@@ -156,7 +157,7 @@ static class PaymentModel extends RepresentationModel<PaymentModel> {
156157
157158 @ Value
158159 @ RequiredArgsConstructor (onConstructor = @ __ (@ JsonCreator ))
159- static class PaymentForm {
160+ public static class PaymentForm implements DTO {
160161 CreditCardNumber number ;
161162 }
162163}
Original file line number Diff line number Diff line change 1+ @ org .jmolecules .architecture .hexagonal .Port
12@ org .jspecify .annotations .NullMarked
23package de .odrotbohm .restbucks .payment .web ;
4+
Original file line number Diff line number Diff line change 1+ @ org .springframework .lang .NonNullApi
2+ @ org .jmolecules .architecture .hexagonal .PrimaryAdapter
3+ package org .springsource .restbucks .payment .web ;
Original file line number Diff line number Diff line change 1+ {
2+ "groups" : {
3+ "restbucks" : {
4+ "displayName" : " Restbucks" ,
5+ "type" : " design"
6+ }
7+ }
8+ }
You can’t perform that action at this time.
0 commit comments