diff --git a/bookshop/srv/cat-service.cds b/bookshop/srv/cat-service.cds index 2441db25..db9724d1 100644 --- a/bookshop/srv/cat-service.cds +++ b/bookshop/srv/cat-service.cds @@ -1,16 +1,34 @@ -using { sap.capire.bookshop as my } from '../db/schema'; -service CatalogService @(path:'/browse') { +using {sap.capire.bookshop as my} from '../db/schema'; - /** For displaying lists of Books */ - @readonly entity ListOfBooks as projection on Books - excluding { descr }; +service CatalogService @(path : '/browse') { - /** For display in details pages */ - @readonly entity Books as projection on my.Books { *, - author.name as author - } excluding { createdBy, modifiedBy }; + /** + * For displaying lists of Books + */ + @readonly + entity ListOfBooks as projection on Books excluding { + descr + }; - @requires: 'authenticated-user' - action submitOrder ( book: Books:ID, quantity: Integer ) returns { stock: Integer }; - event OrderedBook : { book: Books:ID; quantity: Integer; buyer: String }; + /** + * For display in details pages + */ + @readonly + entity Books as projection on my.Books { + * , author.name as author + } excluding { + createdBy, + modifiedBy + }; + + @requires : 'authenticated-user' + action submitOrder(book : Books:ID, quantity : Integer) returns { + stock : Integer + }; + + event OrderedBook : { + book : Books:ID; + quantity : Integer; + buyer : String + }; }