Restore simple bookshop - no workarounds
Signed-off-by: Daniel <daniel.hutzel@sap.com>
This commit is contained in:
@@ -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; }
|
||||
@@ -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 };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user