Test extend with composition

This commit is contained in:
d049904
2024-03-06 14:59:24 +01:00
parent fd770b4a91
commit 73f438d3c0
2 changed files with 43 additions and 0 deletions

View File

@@ -10,12 +10,22 @@
//
using { sap.capire.bookshop.Books } from '@capire/bookshop';
using { ReviewsService.Reviews } from '@capire/reviews';
using { managed, cuid } from '@sap/cds/common';
extend Books with {
reviews : Composition of many Reviews on reviews.subject = $self.ID;
rating : type of Reviews:rating; // average rating
numberOfReviews : Integer @title : '{i18n>NumberOfReviews}';
Y_characteristics : Composition of many Y_Characteristic on Y_characteristics.parent = $self;
}
entity Y_Characteristic : cuid, managed {
parent : Association to one Books;
characteristicId : String;
name : String;
value : String;
uom : String;
}
//
// Extend Orders with Books as Products