Skip to content

Commit 7225b21

Browse files
authored
Consume cds-services 3.5.0 (#402)
1 parent 0052e95 commit 7225b21

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

db/orders.cds

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ entity Orders : cuid, managed {
2020
entity OrderItems : cuid {
2121
parent : Association to Orders;
2222
book : Association to Books @mandatory @assert.target;
23+
@mandatory
24+
@assert.range: [(0), _]
2325
quantity : Integer;
2426
amount : Decimal(9, 2);
2527
}

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
<cds-feature-attachments.version>1.0.5</cds-feature-attachments.version>
3232
</properties>
3333

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) {

0 commit comments

Comments
 (0)