forked from c-kobo/ui5con2023
-
Notifications
You must be signed in to change notification settings - Fork 1
/
capabilities.cds
47 lines (43 loc) · 1.4 KB
/
capabilities.cds
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using {TravelService} from '../srv/travel-service';
annotate TravelService.Travel with @odata.draft.enabled;
annotate TravelService.Travel with @Common.SemanticKey: [TravelID];
annotate TravelService.Booking with @Common.SemanticKey: [BookingID];
annotate TravelService.BookingSupplement with @Common.SemanticKey: [BookingSupplementID];
annotate TravelService.Travel with @Capabilities : {
InsertRestrictions : {
$Type : 'Capabilities.InsertRestrictionsType',
Insertable: false,
},
DeleteRestrictions : {
$Type : 'Capabilities.DeleteRestrictionsType',
Deletable: false,
}
};
annotate TravelService.Booking with @Capabilities : {
DeleteRestrictions : {
$Type : 'Capabilities.DeleteRestrictionsType',
Deletable: false
}
};
//Exercise 7: Aggregation Capabilities
annotate TravelService.BookedFlights with @(
Aggregation.CustomAggregate #BookingUUID: 'Edm.Decimal',
Aggregation.ApplySupported : {
$Type : 'Aggregation.ApplySupportedType',
Transformations : [
'aggregate',
'groupby'
],
Rollup : #None,
GroupableProperties : [
to_Customer_CustomerID,
AirlineID
],
AggregatableProperties: [{
$Type : 'Aggregation.AggregatablePropertyType',
Property: BookingUUID
}, ],
}
) {
BookingUUID @Aggregation.default: #COUNTDISTINCT @Common.Label: 'Booked Flight'
}