Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions app/incidents/annotations.cds
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
using ProcessorService as service from '../../srv/services';
using from '../../db/schema';

annotate service.Customers with @title : '{i18n>Customer}';
annotate service.Incidents with @title : '{i18n>Incident}';
annotate service.Incidents with @odata.draft.enabled;

annotate sap.capire.incidents.Customers with @(
title: '{i18n>Customer}',
cds.autoexpose
);

annotate service.Incidents with @(
title: '{i18n>Incident}',
odata.draft.enabled
);

annotate service.Incidents with @(
UI.LineItem : [
Expand Down
7 changes: 7 additions & 0 deletions db/data/sap.capire.incidents-Customers.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@ ID,firstName,lastName,email,phone
1004155,Daniel,Watts,daniel.watts@demo.com,+44-555-123
1004161,Stormy,Weathers,stormy.weathers@demo.com,
1004100,Sunny,Sunshine,sunny.sunshine@demo.com,+01-555-789
1004200,John,Doe,john.doe@demo.com,+01-555-456
1004201,Jane,Doe,jane.doe@demo.com,+01-555-654
1004202,Chris,Pine,chris.pine@demo.com,+01-555-321
1004203,Anna,Bell,anna.bell@demo.com,+01-555-987
1004204,Peter,Parker,peter.parker@demo.com,+01-555-111
1004205,Bruce,Wayne,bruce.wayne@demo.com,+01-555-222
1004206,Clark,Kent,clark.kent@demo.com,+01-555-333
16 changes: 4 additions & 12 deletions srv/services.cds
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,11 @@ using { sap.capire.incidents as my } from '../db/schema';
/**
* Service used by support personell, i.e. the incidents' 'processors'.
*/
service ProcessorService {
service ProcessorService @(requires: 'support') {
entity Incidents as projection on my.Incidents;
entity Customers @readonly as projection on my.Customers;
// TODO: Add actions
}

/**
* Service used by administrators to manage customers and incidents.
*/
service AdminService {
service CustomersService @(requires: ['support', 'admin']) {
entity Customers as projection on my.Customers;
entity Incidents as projection on my.Incidents;
}

annotate ProcessorService.Incidents with @odata.draft.enabled;
annotate ProcessorService with @(requires: 'support');
annotate AdminService with @(requires: 'admin');
}