Separated reviewed and reviews

This commit is contained in:
Daniel
2020-05-29 16:56:03 +02:00
parent 0a552b4346
commit 6f9737ae38
6 changed files with 25 additions and 30 deletions

16
reviewed/db/schema.cds Normal file
View File

@@ -0,0 +1,16 @@
//
// Extending Books with Reviews
//
using { sap.capire.bookshop.Books } from '@capire/bookshop';
using { ReviewsService.Reviews } from '@capire/reviews';
extend Books with {
/** Access to detailed collection of Reviews */
reviews : Composition of many Reviews on reviews.subject = $self.ID;
/** Average rating */
rating : Reviews.rating;
}
// Temporary workaround for cap/issues#4112:
annotate Reviews with @cds.autoexpose;