@sap/cds-dk 9.2.1 → 9.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/bin/bind.js +5 -8
  3. package/bin/up.js +19 -13
  4. package/lib/bind/cf.js +4 -0
  5. package/lib/bind/k8s.js +21 -0
  6. package/lib/bind/plugin.js +9 -0
  7. package/lib/build/buildTaskProviderFactory.js +8 -14
  8. package/lib/build/constants.js +1 -0
  9. package/lib/build/index.js +17 -2
  10. package/lib/build/plugin.js +5 -7
  11. package/lib/build/provider/hana/index.js +4 -4
  12. package/lib/env/schemas/cds-rc.js +2 -2
  13. package/lib/import/odata/metadataconverter/MetadataConverter.js +5 -0
  14. package/lib/init/constants.js +3 -2
  15. package/lib/init/projectReader.js +17 -5
  16. package/lib/init/template/ams/index.js +1 -2
  17. package/lib/init/template/approuter/files/containerize.yaml.hbs +1 -1
  18. package/lib/init/template/approuter/index.js +1 -1
  19. package/lib/init/template/data/as-csv.js +10 -7
  20. package/lib/init/template/data/as-json.js +7 -4
  21. package/lib/init/template/enterprise-messaging/index.js +3 -2
  22. package/lib/init/template/enterprise-messaging-shared/index.js +3 -2
  23. package/lib/init/template/extension/files/.base/index.cds +6 -6
  24. package/lib/init/template/extension/index.js +5 -5
  25. package/lib/init/template/github-actions/files/kyma-info/action.yaml +1 -1
  26. package/lib/init/template/github-actions/files/kyma-setup/action.yaml +1 -9
  27. package/lib/init/template/github-actions/files/workflows/cf.yaml.hbs +25 -12
  28. package/lib/init/template/github-actions/files/workflows/kyma.yaml.hbs +8 -5
  29. package/lib/init/template/github-actions/files/workflows/release.yaml.hbs +30 -0
  30. package/lib/init/template/github-actions/files/workflows/test.yaml.hbs +6 -3
  31. package/lib/init/template/github-actions/index.js +28 -14
  32. package/lib/init/template/hana/index.js +2 -1
  33. package/lib/init/template/html5-repo/files/mta.yaml.hbs +5 -1
  34. package/lib/init/template/html5-repo/files/package.json.hbs +1 -1
  35. package/lib/init/template/html5-repo/index.js +27 -19
  36. package/lib/init/template/ias/files/mta.yaml.hbs +5 -4
  37. package/lib/init/template/ias/files/values.yaml.hbs +41 -40
  38. package/lib/init/template/mta/files/mta.yaml.hbs +1 -1
  39. package/lib/init/template/mta/files/package.json +1 -1
  40. package/lib/init/template/multitenancy/files/mta.yaml.hbs +1 -1
  41. package/lib/init/template/multitenancy/files/values.yaml.hbs +1 -1
  42. package/lib/init/template/nodejs/files/.vscode/extensions.json +0 -1
  43. package/lib/init/template/nodejs/files/package.json.hbs +3 -9
  44. package/lib/init/template/portal/files/mta.yaml.hbs +5 -1
  45. package/lib/init/template/portal/index.js +0 -1
  46. package/lib/init/template/sample/files/app/_i18n/i18n.properties +15 -0
  47. package/lib/init/template/sample/files/app/_i18n/i18n_de.properties +15 -0
  48. package/lib/init/template/sample/files/app/admin-books/fiori-service.cds +14 -15
  49. package/lib/init/template/sample/files/app/browse/fiori-service.cds +44 -44
  50. package/lib/init/template/sample/files/app/common.cds +99 -84
  51. package/lib/init/template/sample/files/db/schema.cds +22 -17
  52. package/lib/init/template/sample/files/package.json.hbs +1 -3
  53. package/lib/init/template/sample/files/srv/admin-service.cds +4 -3
  54. package/lib/init/template/sample/files/srv/cat-service.cds +28 -11
  55. package/lib/init/template/tiny-sample/files/nodejs/db/schema.cds +3 -3
  56. package/lib/init/template/typescript/files/package.json +1 -1
  57. package/lib/init/template/ui5/index.js +22 -0
  58. package/lib/init/template/xsuaa/files/mta.yaml.hbs +2 -1
  59. package/lib/init/template/xsuaa/index.js +7 -5
  60. package/lib/lint/eslintHelp.json +5 -3
  61. package/npm-shrinkwrap.json +15 -15
  62. package/package.json +1 -1
  63. package/lib/init/template/github-actions/files/cf-github-deploy/action.yaml +0 -48
  64. package/lib/init/template/sample/files/javascript/admin-service.js.hbs +0 -24
  65. package/lib/init/template/sample/files/javascript/cat-service.js.hbs +0 -43
  66. package/lib/init/template/sample/files/typescript/admin-service.ts.hbs +0 -16
  67. package/lib/init/template/sample/files/typescript/cat-service.ts.hbs +0 -38
@@ -2,21 +2,15 @@
2
2
  "name": "{{ projectName }}",
3
3
  "version": "1.0.0",
4
4
  "description": "A simple CAP project.",
5
- "repository": "<Add your repository here>",
6
- "license": "UNLICENSED",
7
- "private": true,
8
5
  "dependencies": {
9
6
  "@sap/cds": "^9",
10
7
  "express": "^4"
11
8
  },
12
- "engines": {
13
- "node": ">=20"
14
- },
15
9
  "devDependencies": {
16
- "@cap-js/sqlite": "^2",
17
- "@cap-js/cds-types": "^0.13.0"
10
+ "@cap-js/sqlite": "^2"
18
11
  },
19
12
  "scripts": {
20
13
  "start": "cds-serve"
21
- }
14
+ },
15
+ "private": true
22
16
  }
@@ -37,7 +37,11 @@ modules:
37
37
  name: {{appName}}-portal-key
38
38
  config:
39
39
  content-endpoint: developer
40
- - name: {{appName}}-auth
40
+ - name: {{appName}}-auth{{#hasIas}}
41
+ parameters:
42
+ config:
43
+ credential-type: X509_GENERATED
44
+ app-identifier: portal-deployer{{/hasIas}}
41
45
  - name: {{appName}}-html5-repo-host
42
46
  - name: {{appName}}-app-deployer
43
47
  deployed-after:
@@ -23,7 +23,6 @@ module.exports = class PortalTemplate extends require('../../plugin') {
23
23
  const project = readProject()
24
24
  const { configFile } = project
25
25
  await merge(__dirname, 'files/package.json.hbs').into(configFile, { project })
26
- project.literal = () => text => text
27
26
  await renderAndCopy(path.join(__dirname, 'files/portal-site'), 'app/portal/portal-site', project)
28
27
  }
29
28
 
@@ -12,3 +12,18 @@ Stock = Stock
12
12
  Order = Order
13
13
  Orders = Orders
14
14
  Price = Price
15
+ Genre = Genre
16
+ Genres = Genres
17
+ DateOfBirth = Date of Birth
18
+ DateOfDeath = Date of Death
19
+ PlaceOfBirth = Place of Birth
20
+ PlaceOfDeath = Place of Death
21
+ Details = Details
22
+ Languages = Languages
23
+ Currencies = Currencies
24
+ MainGenre = Main Genre
25
+ SubGenres = Subgenres
26
+ Admin = Admin
27
+ Translations = Translations
28
+ General = General
29
+ Locale = Locale
@@ -12,3 +12,18 @@ Stock = Bestand
12
12
  Order = Bestellung
13
13
  Orders = Bestellungen
14
14
  Price = Preis
15
+ Genre = Genre
16
+ Genres = Genres
17
+ DateOfBirth = Geburtsdatum
18
+ DateOfDeath = Todesdatum
19
+ PlaceOfBirth = Geburtsort
20
+ PlaceOfDeath = Todesort
21
+ Details = Details
22
+ Languages = Sprachen
23
+ Currencies = Währungen
24
+ MainGenre = Hauptgenre
25
+ SubGenres = Subgenres
26
+ Admin = Admin
27
+ Translations = Übersetzungen
28
+ General = Allgemein
29
+ Locale = Gebietsschema
@@ -1,5 +1,4 @@
1
- using { AdminService } from '../../srv/admin-service.cds';
2
- using { sap.capire.bookshop } from '../../db/schema';
1
+ using {AdminService} from '../../srv/admin-service.cds';
3
2
 
4
3
  ////////////////////////////////////////////////////////////////////////////
5
4
  //
@@ -7,13 +6,13 @@ using { sap.capire.bookshop } from '../../db/schema';
7
6
  //
8
7
 
9
8
  annotate AdminService.Books with @(UI: {
10
- HeaderInfo : {
9
+ HeaderInfo : {
11
10
  TypeName : '{i18n>Book}',
12
11
  TypeNamePlural: '{i18n>Books}',
13
12
  Title : {Value: title},
14
13
  Description : {Value: author.name}
15
14
  },
16
- Facets: [
15
+ Facets : [
17
16
  {
18
17
  $Type : 'UI.ReferenceFacet',
19
18
  Label : '{i18n>General}',
@@ -49,7 +48,7 @@ annotate AdminService.Books with @(UI: {
49
48
  Label: '{i18n>Currency}'
50
49
  },
51
50
  ]},
52
- FieldGroup #Admin: {Data: [
51
+ FieldGroup #Admin : {Data: [
53
52
  {Value: createdBy},
54
53
  {Value: createdAt},
55
54
  {Value: modifiedBy},
@@ -67,23 +66,23 @@ annotate sap.capire.bookshop.Books with @fiori.draft.enabled;
67
66
  annotate AdminService.Books with @odata.draft.enabled;
68
67
 
69
68
  annotate AdminService.Books.texts with @(UI: {
70
- Identification: [{Value: title}],
69
+ Identification : [{Value: title}],
71
70
  SelectionFields: [
72
71
  locale,
73
72
  title
74
73
  ],
75
- LineItem: [
74
+ LineItem : [
76
75
  {
77
76
  Value: locale,
78
- Label: 'Locale'
77
+ Label: '{i18n>Locale}'
79
78
  },
80
79
  {
81
80
  Value: title,
82
- Label: 'Title'
81
+ Label: '{i18n>Title}'
83
82
  },
84
83
  {
85
84
  Value: descr,
86
- Label: 'Description'
85
+ Label: '{i18n>Description}'
87
86
  },
88
87
  ]
89
88
  });
@@ -105,13 +104,13 @@ annotate AdminService.Books.texts {
105
104
  using {sap} from '@sap/cds/common';
106
105
 
107
106
  extend service AdminService {
108
- @readonly entity Languages as projection on sap.common.Languages;
107
+ @readonly
108
+ entity Languages as projection on sap.common.Languages;
109
109
  }
110
110
 
111
- // Workaround for Fiori popup for asking user to enter a new UUID on Create
112
- annotate AdminService.Books with {
113
- ID @Core.Computed;
114
- }
111
+ // Workaround for Fiori popups for asking user to enter a valid UUID on Create
112
+ annotate AdminService.Authors : ID with @Core.Computed @odata.Type: 'Edm.String';
113
+ annotate AdminService.Books : ID with @Core.Computed @odata.Type: 'Edm.String';
115
114
 
116
115
  // Show Genre as drop down, not a dialog
117
116
  annotate AdminService.Books with {
@@ -1,57 +1,57 @@
1
- using { CatalogService } from '../../srv/cat-service.cds';
1
+ using {CatalogService} from '../../srv/cat-service.cds';
2
2
 
3
3
  ////////////////////////////////////////////////////////////////////////////
4
4
  //
5
5
  // Books Object Page
6
6
  //
7
- annotate CatalogService.Books with @(UI : {
8
- HeaderInfo: {
9
- TypeName : '{i18n>Book}',
10
- TypeNamePlural: '{i18n>Books}',
11
- Title : {Value: title},
12
- Description : {Value : author}
7
+ annotate CatalogService.Books with @(UI: {
8
+ HeaderInfo : {
9
+ TypeName : '{i18n>Book}',
10
+ TypeNamePlural: '{i18n>Books}',
11
+ Title : {Value: title},
12
+ Description : {Value: author}
13
+ },
14
+ HeaderFacets : [{
15
+ $Type : 'UI.ReferenceFacet',
16
+ Label : '{i18n>Description}',
17
+ Target: '@UI.FieldGroup#Descr'
18
+ }, ],
19
+ Facets : [{
20
+ $Type : 'UI.ReferenceFacet',
21
+ Label : '{i18n>Details}',
22
+ Target: '@UI.FieldGroup#Price'
23
+ }, ],
24
+ FieldGroup #Descr: {Data: [{Value: descr}, ]},
25
+ FieldGroup #Price: {Data: [
26
+ {Value: price},
27
+ {
28
+ Value: currency.symbol,
29
+ Label: '{i18n>Currency}'
13
30
  },
14
- HeaderFacets: [{
15
- $Type : 'UI.ReferenceFacet',
16
- Label : '{i18n>Description}',
17
- Target: '@UI.FieldGroup#Descr'
18
- }, ],
19
- Facets: [{
20
- $Type : 'UI.ReferenceFacet',
21
- Label : '{i18n>Details}',
22
- Target: '@UI.FieldGroup#Price'
23
- }, ],
24
- FieldGroup #Descr: {Data : [{Value : descr}, ]},
25
- FieldGroup #Price: {Data : [
26
- {Value: price},
27
- {
28
- Value: currency.symbol,
29
- Label: '{i18n>Currency}'
30
- },
31
- ]},
31
+ ]},
32
32
  });
33
33
 
34
34
  ////////////////////////////////////////////////////////////////////////////
35
35
  //
36
36
  // Books List Page
37
37
  //
38
- annotate CatalogService.Books with @(UI : {
39
- SelectionFields: [
40
- ID,
41
- price,
42
- currency_code
43
- ],
44
- LineItem: [
45
- {
46
- Value: ID,
47
- Label: '{i18n>Title}'
48
- },
49
- {
50
- Value: author,
51
- Label: '{i18n>Author}'
52
- },
53
- {Value: genre.name},
54
- {Value: price},
55
- {Value: currency.symbol},
56
- ]
38
+ annotate CatalogService.Books with @(UI: {
39
+ SelectionFields: [
40
+ ID,
41
+ price,
42
+ currency_code
43
+ ],
44
+ LineItem : [
45
+ {
46
+ Value: ID,
47
+ Label: '{i18n>Title}'
48
+ },
49
+ {
50
+ Value: author,
51
+ Label: '{i18n>Author}'
52
+ },
53
+ {Value: genre.name},
54
+ {Value: price},
55
+ {Value: currency.symbol},
56
+ ]
57
57
  });
@@ -2,8 +2,11 @@
2
2
  Common Annotations shared by all apps
3
3
  */
4
4
 
5
- using { sap.capire.bookshop as my } from '../db/schema';
6
- using { sap.common, sap.common.Currencies } from '@sap/cds/common';
5
+ using {sap.capire.bookshop as my} from '../db/schema';
6
+ using {
7
+ sap.common,
8
+ sap.common.Currencies
9
+ } from '@sap/cds/common';
7
10
 
8
11
  ////////////////////////////////////////////////////////////////////////////
9
12
  //
@@ -11,27 +14,33 @@ using { sap.common, sap.common.Currencies } from '@sap/cds/common';
11
14
  //
12
15
  annotate my.Books with @(
13
16
  Common.SemanticKey: [ID],
14
- UI: {
15
- Identification: [{ Value: title }],
17
+ UI : {
18
+ Identification : [{Value: title}],
16
19
  SelectionFields: [
17
20
  ID,
18
21
  author_ID,
19
22
  price,
20
23
  currency_code
21
24
  ],
22
- LineItem: [
23
- { Value: ID, Label: '{i18n>Title}' },
24
- { Value: author.ID, Label: '{i18n>Author}' },
25
- { Value: genre.name },
26
- { Value: stock },
27
- { Value: price },
28
- { Value: currency.symbol },
25
+ LineItem : [
26
+ {
27
+ Value: ID,
28
+ Label: '{i18n>Title}'
29
+ },
30
+ {
31
+ Value: author.ID,
32
+ Label: '{i18n>Author}'
33
+ },
34
+ {Value: genre.name},
35
+ {Value: stock},
36
+ {Value: price},
37
+ {Value: currency.symbol},
29
38
  ]
30
39
  }
31
40
  ) {
32
- ID @Common: {
33
- SemanticObject: 'Books',
34
- Text: title,
41
+ ID @Common : {
42
+ SemanticObject : 'Books',
43
+ Text : title,
35
44
  TextArrangement: #TextOnly
36
45
  };
37
46
  author @ValueList.entity: 'Authors';
@@ -47,14 +56,19 @@ annotate Currencies with {
47
56
  // Books Elements
48
57
  //
49
58
  annotate my.Books with {
50
- ID @title: '{i18n>ID}';
51
- title @title: '{i18n>Title}';
52
- genre @title: '{i18n>Genre}' @Common: { Text: genre.name, TextArrangement: #TextOnly };
53
- author @title: '{i18n>Author}' @Common: { Text: author.name, TextArrangement: #TextOnly };
54
- price @title: '{i18n>Price}' @Measures.ISOCurrency: currency_code;
55
- stock @title: '{i18n>Stock}';
56
- descr @title: '{i18n>Description}' @UI.MultiLineText;
57
- image @title: '{i18n>Image}';
59
+ ID @title: '{i18n>ID}';
60
+ title @title: '{i18n>Title}';
61
+ genre @title: '{i18n>Genre}' @Common : {
62
+ Text : genre.name,
63
+ TextArrangement: #TextOnly
64
+ };
65
+ author @title: '{i18n>Author}' @Common : {
66
+ Text : author.name,
67
+ TextArrangement: #TextOnly
68
+ };
69
+ price @title: '{i18n>Price}' @Measures.ISOCurrency: currency_code;
70
+ stock @title: '{i18n>Stock}';
71
+ descr @title: '{i18n>Description}' @UI.MultiLineText;
58
72
  }
59
73
 
60
74
  ////////////////////////////////////////////////////////////////////////////
@@ -63,35 +77,35 @@ annotate my.Books with {
63
77
  //
64
78
  annotate my.Genres with @(
65
79
  Common.SemanticKey: [name],
66
- UI: {
80
+ UI : {
67
81
  SelectionFields: [name],
68
- LineItem: [
69
- { Value: name },
82
+ LineItem : [
83
+ {Value: name},
70
84
  {
71
85
  Value: parent.name,
72
- Label: 'Main Genre'
86
+ Label: '{i18n>MainGenre}'
73
87
  },
74
88
  ],
75
89
  }
76
90
  );
77
91
 
78
92
  annotate my.Genres with {
79
- ID @Common.Text : name @Common.TextArrangement : #TextOnly;
93
+ ID @Common.Text: name @Common.TextArrangement: #TextOnly;
80
94
  }
81
95
 
82
96
  ////////////////////////////////////////////////////////////////////////////
83
97
  //
84
98
  // Genre Details
85
99
  //
86
- annotate my.Genres with @(UI : {
87
- Identification: [{ Value: name}],
88
- HeaderInfo: {
100
+ annotate my.Genres with @(UI: {
101
+ Identification: [{Value: name}],
102
+ HeaderInfo : {
89
103
  TypeName : '{i18n>Genre}',
90
104
  TypeNamePlural: '{i18n>Genres}',
91
- Title : { Value: name },
92
- Description : { Value: ID }
105
+ Title : {Value: name},
106
+ Description : {Value: ID}
93
107
  },
94
- Facets: [{
108
+ Facets : [{
95
109
  $Type : 'UI.ReferenceFacet',
96
110
  Label : '{i18n>SubGenres}',
97
111
  Target: 'children/@UI.LineItem'
@@ -113,21 +127,21 @@ annotate my.Genres with {
113
127
  //
114
128
  annotate my.Authors with @(
115
129
  Common.SemanticKey: [ID],
116
- UI: {
117
- Identification : [{ Value: name}],
118
- SelectionFields: [ name ],
130
+ UI : {
131
+ Identification : [{Value: name}],
132
+ SelectionFields: [name],
119
133
  LineItem : [
120
- { Value: ID },
121
- { Value: dateOfBirth },
122
- { Value: dateOfDeath },
123
- { Value: placeOfBirth },
124
- { Value: placeOfDeath },
134
+ {Value: ID},
135
+ {Value: dateOfBirth},
136
+ {Value: dateOfDeath},
137
+ {Value: placeOfBirth},
138
+ {Value: placeOfDeath},
125
139
  ],
126
140
  }
127
141
  ) {
128
142
  ID @Common: {
129
- SemanticObject: 'Authors',
130
- Text: name,
143
+ SemanticObject : 'Authors',
144
+ Text : name,
131
145
  TextArrangement: #TextOnly,
132
146
  };
133
147
  };
@@ -136,14 +150,14 @@ annotate my.Authors with @(
136
150
  //
137
151
  // Author Details
138
152
  //
139
- annotate my.Authors with @(UI : {
153
+ annotate my.Authors with @(UI: {
140
154
  HeaderInfo: {
141
155
  TypeName : '{i18n>Author}',
142
156
  TypeNamePlural: '{i18n>Authors}',
143
- Title : { Value: name },
144
- Description : { Value: dateOfBirth }
157
+ Title : {Value: name},
158
+ Description : {Value: dateOfBirth}
145
159
  },
146
- Facets: [{
160
+ Facets : [{
147
161
  $Type : 'UI.ReferenceFacet',
148
162
  Target: 'books/@UI.LineItem'
149
163
  }],
@@ -169,12 +183,15 @@ annotate my.Authors with {
169
183
  //
170
184
  annotate common.Languages with @(
171
185
  Common.SemanticKey: [code],
172
- Identification: [{ Value: code }],
173
- UI: {
174
- SelectionFields: [ name, descr ],
175
- LineItem: [
176
- { Value: code },
177
- { Value: name },
186
+ Identification : [{Value: code}],
187
+ UI : {
188
+ SelectionFields: [
189
+ name,
190
+ descr
191
+ ],
192
+ LineItem : [
193
+ {Value: code},
194
+ {Value: name},
178
195
  ],
179
196
  }
180
197
  );
@@ -183,22 +200,22 @@ annotate common.Languages with @(
183
200
  //
184
201
  // Language Details
185
202
  //
186
- annotate common.Languages with @(UI : {
187
- HeaderInfo: {
203
+ annotate common.Languages with @(UI: {
204
+ HeaderInfo : {
188
205
  TypeName : '{i18n>Language}',
189
206
  TypeNamePlural: '{i18n>Languages}',
190
- Title : { Value: name },
191
- Description : { Value: descr }
207
+ Title : {Value: name},
208
+ Description : {Value: descr}
192
209
  },
193
- Facets: [{
210
+ Facets : [{
194
211
  $Type : 'UI.ReferenceFacet',
195
212
  Label : '{i18n>Details}',
196
213
  Target: '@UI.FieldGroup#Details'
197
214
  }, ],
198
- FieldGroup #Details: {Data : [
199
- { Value: code },
200
- { Value: name },
201
- { Value: descr }
215
+ FieldGroup #Details: {Data: [
216
+ {Value: code},
217
+ {Value: name},
218
+ {Value: descr}
202
219
  ]},
203
220
  });
204
221
 
@@ -208,16 +225,16 @@ annotate common.Languages with @(UI : {
208
225
  //
209
226
  annotate common.Currencies with @(
210
227
  Common.SemanticKey: [code],
211
- Identification: [{ Value: code}],
212
- UI: {
228
+ Identification : [{Value: code}],
229
+ UI : {
213
230
  SelectionFields: [
214
231
  name,
215
232
  descr
216
233
  ],
217
- LineItem: [
218
- { Value: descr },
219
- { Value: symbol },
220
- { Value: code },
234
+ LineItem : [
235
+ {Value: descr},
236
+ {Value: symbol},
237
+ {Value: code},
221
238
  ],
222
239
  }
223
240
  );
@@ -226,24 +243,22 @@ annotate common.Currencies with @(
226
243
  //
227
244
  // Currency Details
228
245
  //
229
- annotate common.Currencies with @(UI : {
230
- HeaderInfo: {
246
+ annotate common.Currencies with @(UI: {
247
+ HeaderInfo : {
231
248
  TypeName : '{i18n>Currency}',
232
249
  TypeNamePlural: '{i18n>Currencies}',
233
- Title : { Value: descr },
234
- Description : { Value: code }
250
+ Title : {Value: descr},
251
+ Description : {Value: code}
235
252
  },
236
- Facets: [
237
- {
238
- $Type : 'UI.ReferenceFacet',
239
- Label : '{i18n>Details}',
240
- Target: '@UI.FieldGroup#Details'
241
- }
242
- ],
243
- FieldGroup #Details: {Data : [
244
- { Value: name },
245
- { Value: symbol },
246
- { Value: code },
247
- { Value: descr }
253
+ Facets : [{
254
+ $Type : 'UI.ReferenceFacet',
255
+ Label : '{i18n>Details}',
256
+ Target: '@UI.FieldGroup#Details'
257
+ }],
258
+ FieldGroup #Details: {Data: [
259
+ {Value: name},
260
+ {Value: symbol},
261
+ {Value: code},
262
+ {Value: descr}
248
263
  ]}
249
264
  });
@@ -1,31 +1,36 @@
1
- using { Currency, managed, sap } from '@sap/cds/common';
1
+ using {
2
+ Currency,
3
+ managed,
4
+ cuid,
5
+ sap
6
+ } from '@sap/cds/common';
7
+
2
8
  namespace sap.capire.bookshop;
3
9
 
4
- entity Books : managed {
5
- key ID : Integer;
6
- @mandatory title : localized String(111);
7
- descr : localized String(1111);
8
- @mandatory author : Association to Authors;
9
- genre : Association to Genres;
10
- stock : Integer;
11
- price : Decimal;
10
+ entity Books : managed, cuid {
11
+ title : localized String(111) @mandatory;
12
+ descr : localized String(1111);
13
+ author : Association to Authors @mandatory;
14
+ genre : Association to Genres;
15
+ stock : Integer;
16
+ price : Decimal;
12
17
  currency : Currency;
13
- image : LargeBinary @Core.MediaType : 'image/png';
14
18
  }
15
19
 
16
- entity Authors : managed {
17
- key ID : Integer;
18
- @mandatory name : String(111);
20
+ entity Authors : managed, cuid {
21
+ name : String(111) @mandatory;
19
22
  dateOfBirth : Date;
20
23
  dateOfDeath : Date;
21
24
  placeOfBirth : String;
22
25
  placeOfDeath : String;
23
- books : Association to many Books on books.author = $self;
26
+ books : Association to many Books
27
+ on books.author = $self;
24
28
  }
25
29
 
26
30
  /** Hierarchically organized Code List for Genres */
27
31
  entity Genres : sap.common.CodeList {
28
- key ID : Integer;
29
- parent : Association to Genres;
30
- children : Composition of many Genres on children.parent = $self;
32
+ key ID : Integer;
33
+ parent : Association to Genres;
34
+ children : Composition of many Genres
35
+ on children.parent = $self;
31
36
  }
@@ -1,3 +1 @@
1
- {
2
- "sapux": ["{{& appPath}}admin-books", "{{& appPath}}browse"]
3
- }
1
+ {}
@@ -1,5 +1,6 @@
1
- using { sap.capire.bookshop as my } from '../db/schema';
2
- service AdminService @(requires:'admin') {
3
- entity Books as projection on my.Books;
1
+ using {sap.capire.bookshop as my} from '../db/schema';
2
+
3
+ service AdminService @(requires: 'admin') {
4
+ entity Books as projection on my.Books;
4
5
  entity Authors as projection on my.Authors;
5
6
  }