Files
cloud-cap-samples/bookshop/srv/cat-service.cds
2021-11-12 21:25:33 +01:00

41 lines
766 B
Plaintext

using {sap.capire.bookshop as my} from '../db/schema';
service CatalogService @(path : '/browse') {
/**
* 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 authorName
} excluding {
createdBy,
modifiedBy
};
@readonly
entity Authors as projection on my.Authors 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
};
}