Skip to content

Commit 472bf59

Browse files
authored
Fixed various CDS warnings (SAP-samples#242)
1 parent 5371e05 commit 472bf59

3 files changed

Lines changed: 3 additions & 21 deletions

File tree

app/common.cds

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Common Annotations shared by all apps
33
*/
44
using {my.bookshop as my} from '../db/index';
5+
using {sap.common as common} from '@sap/cds/common';
56

67

78
////////////////////////////////////////////////////////////////////////////
@@ -158,8 +159,6 @@ annotate my.Reviews with {
158159
Text : book.title,
159160
TextArrangement : #TextOnly
160161
};
161-
date
162-
@title : '{i18n>Date}';
163162
rating
164163
@title : '{i18n>Rating}';
165164
text
@@ -382,26 +381,10 @@ annotate common.Currencies with
382381
{Value : descr}
383382
]},
384383
FieldGroup #Extended : {Data : [
385-
{Value : numcode},
386-
{Value : minor},
387-
{Value : exponent}
384+
{Value : minorUnit}
388385
]},
389386
});
390387

391-
392-
////////////////////////////////////////////////////////////////////////////
393-
//
394-
// Currencies Elements
395-
//
396-
annotate common.Currencies with {
397-
numcode
398-
@title : '{i18n>NumCode}';
399-
minor
400-
@title : '{i18n>MinorUnit}';
401-
exponent
402-
@title : '{i18n>Exponent}';
403-
}
404-
405388
////////////////////////////////////////////////////////////////////////////
406389
//
407390
// Fiori requires generated IDs to be annotated with @Core.Computed

db/reviews.cds

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ entity Reviews : cuid, managed {
1717

1818
// input validation
1919
annotate Reviews with {
20-
subject @mandatory;
2120
title @mandatory;
2221
rating @assert.range;
2322
book @mandatory @assert.target;

srv/admin-service.cds

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ using {my.bookshop as my} from '../db/index';
33

44
@path : 'admin'
55
service AdminService @(requires : 'admin') {
6-
entity Books as projection on my.Books actions {
6+
entity Books as projection on my.Books excluding { reviews } actions {
77
action addToOrder(order_ID : UUID, quantity : Integer) returns Orders;
88
}
99

0 commit comments

Comments
 (0)