diff --git a/bookshop/srv/admin-service.cds b/bookshop/srv/admin-service.cds index abbdeaf5..ea9b0731 100644 --- a/bookshop/srv/admin-service.cds +++ b/bookshop/srv/admin-service.cds @@ -3,7 +3,3 @@ service AdminService @(requires:'admin') { entity Books as projection on my.Books; entity Authors as projection on my.Authors; } - -//Since ID is computed, we can hide the popup for ID on Create -annotate AdminService.Books with { ID @Core.Computed; } -annotate AdminService.Authors with { ID @Core.Computed; } \ No newline at end of file diff --git a/bookshop/srv/cat-service.cds b/bookshop/srv/cat-service.cds index 223b045a..4cc44dff 100644 --- a/bookshop/srv/cat-service.cds +++ b/bookshop/srv/cat-service.cds @@ -1,42 +1,16 @@ -using {sap.capire.bookshop as my} from '../db/schema'; +using { sap.capire.bookshop as my } from '../db/schema'; +service CatalogService @(path:'/browse') { -service CatalogService @(path : '/browse') { + /** For displaying lists of Books */ + @readonly entity ListOfBooks as projection on Books + excluding { descr }; - /** - * For displaying lists of Books - */ - @readonly - entity ListOfBooks as projection on Books excluding { - descr - }; + /** For display in details pages */ + @readonly entity Books as projection on my.Books { *, + author.name as author + } excluding { createdBy, modifiedBy }; - /** - * For display in details pages - */ - @readonly - entity Books as projection on my.Books { - * , author.name as authorName - } excluding { - createdBy, - modifiedBy - }; - - @readonly - entity Authors as projection on my.Authors { - * , books : redirected to Books - } 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 - }; + @requires: 'authenticated-user' + action submitOrder ( book: Books:ID, amount: Integer ) returns { stock: Integer }; + event OrderedBook : { book: Books:ID; amount: Integer; buyer: String }; }