diff --git a/app/incidents/annotations.cds b/app/incidents/annotations.cds index e1bc4c11..eed5203f 100644 --- a/app/incidents/annotations.cds +++ b/app/incidents/annotations.cds @@ -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 : [ diff --git a/db/data/sap.capire.incidents-Customers.csv b/db/data/sap.capire.incidents-Customers.csv index f69a5a8f..573ee4e2 100644 --- a/db/data/sap.capire.incidents-Customers.csv +++ b/db/data/sap.capire.incidents-Customers.csv @@ -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 diff --git a/srv/services.cds b/srv/services.cds index 14db1dca..a0cf15b9 100644 --- a/srv/services.cds +++ b/srv/services.cds @@ -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'); +} \ No newline at end of file