add read only tree table and value help
This commit is contained in:
@@ -2,4 +2,5 @@ using { sap.capire.bookshop as my } from '../db/schema';
|
||||
service AdminService @(requires:'admin', path:'/admin') {
|
||||
entity Books as projection on my.Books;
|
||||
entity Authors as projection on my.Authors;
|
||||
entity GenreHierarchy as projection on my.Genres
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using { sap.capire.bookshop as my } from '../db/schema';
|
||||
using {my.common.Hierarchy as Hierarchy} from './hierarchy';
|
||||
|
||||
extend my.Genres with Hierarchy;
|
||||
service CatalogService @(path:'/browse') {
|
||||
|
||||
/** For displaying lists of Books */
|
||||
@@ -10,6 +13,9 @@ service CatalogService @(path:'/browse') {
|
||||
author.name as author
|
||||
} excluding { createdBy, modifiedBy };
|
||||
|
||||
@readonly
|
||||
entity GenreHierarchy as projection on my.Genres;
|
||||
|
||||
@requires: 'authenticated-user'
|
||||
action submitOrder ( book: Books:ID, quantity: Integer ) returns { stock: Integer };
|
||||
event OrderedBook : { book: Books:ID; quantity: Integer; buyer: String };
|
||||
|
||||
29
bookshop/srv/hierarchy.cds
Normal file
29
bookshop/srv/hierarchy.cds
Normal file
@@ -0,0 +1,29 @@
|
||||
namespace my.common;
|
||||
|
||||
aspect Hierarchy {
|
||||
virtual LimitedDescendantCount : Integer64;
|
||||
virtual DistanceFromRoot : Integer64;
|
||||
virtual DrillState : String;
|
||||
virtual Matched : Boolean;
|
||||
virtual MatchedDescendantCount : Integer64;
|
||||
virtual LimitedRank : Integer64;
|
||||
}
|
||||
|
||||
|
||||
annotate Hierarchy with @Capabilities.FilterRestrictions.NonFilterableProperties: [
|
||||
'LimitedDescendantCount',
|
||||
'DistanceFromRoot',
|
||||
'DrillState',
|
||||
'Matched',
|
||||
'MatchedDescendantCount',
|
||||
'LimitedRank'
|
||||
];
|
||||
|
||||
annotate Hierarchy with @Capabilities.SortRestrictions.NonSortableProperties: [
|
||||
'LimitedDescendantCount',
|
||||
'DistanceFromRoot',
|
||||
'DrillState',
|
||||
'Matched',
|
||||
'MatchedDescendantCount',
|
||||
'LimitedRank'
|
||||
];
|
||||
Reference in New Issue
Block a user