initial upload of extension sample

This commit is contained in:
Wolfgang Koch
2021-05-06 15:22:46 +02:00
commit 6657568824
34 changed files with 10469 additions and 0 deletions

7
node_modules/_base/srv/admin-service.cds generated vendored Normal file
View File

@@ -0,0 +1,7 @@
using { sap.capire.bookshop as my } from '../db/schema';
//service AdminService @(requires:'admin') {
service AdminService {
entity Books as projection on my.Books;
entity Authors as projection on my.Authors;
}

16
node_modules/_base/srv/cat-service.cds generated vendored Normal file
View File

@@ -0,0 +1,16 @@
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 author
} excluding { createdBy, modifiedBy };
//@__requires: 'authenticated-user'
action submitOrder ( book: Books:ID, amount: Integer ) returns { stock: Integer };
event OrderedBook : { book: Books:ID; amount: Integer; buyer: String };
}

27
node_modules/_base/srv/mashup.cds generated vendored Normal file
View File

@@ -0,0 +1,27 @@
////////////////////////////////////////////////////////////////////////////
//
// Mashing up imported models...
//
using { sap.capire.bookshop.Books } from '../db/schema';
//
// Extend Books with access to Reviews and average ratings
//
/*
using { ReviewsService.Reviews } from '@capire/reviews';
extend Books with {
reviews : Composition of many Reviews on reviews.subject = $self.ID;
rating : Decimal;
}
*/
//
// Extend Orders with Books as Products
//
using { sap.capire.orders.Orders_Items } from '../db/schema';
extend Orders_Items with {
book : Association to Books on product.ID = book.ID
}

5
node_modules/_base/srv/orders-service.cds generated vendored Normal file
View File

@@ -0,0 +1,5 @@
using { sap.capire.orders as my } from '../db/schema';
service OrdersService {
entity Orders as projection on my.Orders;
}