Skip to content

Commit 6b7b8df

Browse files
committed
Consume version 3.5.0
1 parent 3f97ef2 commit 6b7b8df

File tree

8 files changed

+1725
-14
lines changed

8 files changed

+1725
-14
lines changed

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.springframework.boot</groupId>
88
<artifactId>spring-boot-starter-parent</artifactId>
9-
<version>3.3.5</version>
9+
<version>3.3.6</version>
1010
<relativePath/> <!-- lookup parent from repository -->
1111
</parent>
1212

@@ -23,11 +23,11 @@
2323

2424
<!-- DEPENDENCIES VERSION -->
2525
<jdk.version>21</jdk.version>
26-
<cds.services.version>3.4.1</cds.services.version>
26+
<cds.services.version>3.5.0</cds.services.version>
2727
<cloud.sdk.version>5.13.0</cloud.sdk.version>
2828
<xsuaa.version>3.5.3</xsuaa.version>
2929
<cf-java-logging-support.version>3.8.4</cf-java-logging-support.version>
30-
<cds.cdsdk-version>8.4.2</cds.cdsdk-version>
30+
<cds.cdsdk-version>8.5.0</cds.cdsdk-version>
3131
</properties>
3232

3333
<modules>

srv/admin-service.cds

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ annotate AdminService.Books with @cds.search : {
3232
title
3333
};
3434

35+
annotate AdminService.OrderItems with {
36+
@mandatory
37+
@assert.range: [(0), _]
38+
quantity
39+
};
40+
41+
42+
3543
// Enable Fiori Draft for Orders
3644
annotate AdminService.Orders with @odata.draft.enabled;
3745
annotate AdminService.Books with @odata.draft.enabled;

srv/ic.http

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
GET https://example.com/comments HTTP/1.1
2+
content-type: application/json
3+
4+
{
5+
"name": "sample",
6+
"time": "Wed, 21 Oct 2015 18:27:50 GMT"
7+
}

srv/src/main/java/my/bookshop/MessageKeys.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
public class MessageKeys {
44

5-
public static final String QUANTITY_REQUIRE_MINIMUM = "quantity.require.minimum";
65
public static final String BOOK_REQUIRE_STOCK = "book.require.stock";
76
public static final String BOOK_ADDED_ORDER = "book.added.order";
87
public static final String BOOK_MISSING = "book.missing";

srv/src/main/java/my/bookshop/handlers/AdminServiceHandler.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,6 @@ public void beforeCreateOrder(Stream<Orders> orders, EventContext context) {
9494
order.getItems().forEach(orderItem -> {
9595
// validation of the Order creation request
9696
Integer quantity = orderItem.getQuantity();
97-
if (quantity == null || quantity <= 0) {
98-
// errors with localized messages from property files
99-
// exceptions abort the request and set an error http status code
100-
// messages in contrast allow to collect multiple errors
101-
messages.error(MessageKeys.QUANTITY_REQUIRE_MINIMUM)
102-
.target("in", ORDERS, o -> o.Items(i -> i.ID().eq(orderItem.getId()).and(i.IsActiveEntity().eq(orderItem.getIsActiveEntity()))).quantity());
103-
}
104-
10597
String bookId = orderItem.getBookId();
10698

10799
if(quantity == null || quantity <= 0 || bookId == null) {

srv/src/main/resources/messages.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
quantity.require.minimum = The specified quantity is smaller than 1
21
book.require.stock = Not enough books on stock (only {0} left)
32
book.added.order = Book successfully added to order
43
book.missing = Book does not exist

srv/src/main/resources/messages_de.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
quantity.require.minimum = Die eingetragene Anzahl ist kleiner als 1
21
book.require.stock = Nicht genügend Bücher auf Vorrat (nur {0} übrig)
32
book.added.order = Das Buch wurde der Bestellung erfolgreich hinzugefügt
43
book.missing = Das Buch existiert nicht

0 commit comments

Comments
 (0)