forked from cap-js-community/odata-v2-adapter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathannotations.cds
70 lines (68 loc) · 2.65 KB
/
annotations.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
using test.DraftService from '../../srv/draft';
annotate DraftService.Header with @(
UI: {
Identification: [
{ Value: name }
],
SelectionFields: [ name, currency, country ],
LineItem: [
{ $Type: 'UI.DataField', Value: name, Label: 'Name' },
{ $Type: 'UI.DataField', Value: price, Label: 'Price' },
{ $Type: 'UI.DataField', Value: currency, Label: 'Currency' },
{ $Type: 'UI.DataField', Value: stock, Label: 'Stock' },
{ $Type: 'UI.DataField', Value: country, Label: 'Country' }
],
HeaderInfo: {
$Type: 'UI.HeaderInfoType',
TypeName: 'Header',
TypeNamePlural: 'Headers',
Title: { Value: name },
Description: { Value: description }
},
Facets: [
{ $Type: 'UI.ReferenceFacet', Label: 'General', Target: '@UI.FieldGroup#General' },
{ $Type: 'UI.ReferenceFacet', Label: 'Items', Target: 'Items/@UI.LineItem' }
],
FieldGroup#General: {
Data: [
{ $Type: 'UI.DataField', Value: name, Label: 'Name' },
{ $Type: 'UI.DataField', Value: price, Label: 'Price' },
{ $Type: 'UI.DataField', Value: currency, Label: 'Currency' },
{ $Type: 'UI.DataField', Value: stock, Label: 'Stock' },
{ $Type: 'UI.DataField', Value: country, Label: 'Country' }
]
}
}
);
annotate DraftService.HeaderItem with @(
UI: {
Identification: [
{ Value: name }
],
SelectionFields: [ name, startAt, endAt ],
LineItem: [
{ $Type: 'UI.DataField', Value: name, Label: 'Name'},
{ $Type: 'UI.DataField', Value: description, Label: 'Description'},
{ $Type: 'UI.DataField', Value: startAt, Label: 'Start At'},
{ $Type: 'UI.DataField', Value: endAt, Label: 'End At'}
],
HeaderInfo: {
$Type: 'UI.HeaderInfoType',
TypeName: 'Item',
TypeNamePlural: 'Items',
Title: { Value: name },
Description: { Value: description }
},
Facets: [
{ $Type: 'UI.ReferenceFacet', Label: 'General', Target: '@UI.FieldGroup#General' },
],
FieldGroup#General: {
Data: [
{ $Type: 'UI.DataField', Value: name, Label: 'Name'},
{ $Type: 'UI.DataField', Value: description, Label: 'Description'},
{ $Type: 'UI.DataField', Value: startAt, Label: 'Start At'},
{ $Type: 'UI.DataField', Value: endAt, Label: 'End At'}
]
}
}
);