Improved reviews-service

This commit is contained in:
Daniel
2020-03-20 15:29:10 +01:00
parent 76829742d8
commit 3872ac21a3
5 changed files with 41 additions and 30 deletions

View File

@@ -1,13 +1,17 @@
using { sap.capire.reviews as my } from '../db/schema';
service ReviewsService {
// Sync API
entity Reviews as projection on my.Reviews excluding { likes }
action like (review:Reviews.ID); // TODO: can be a bound action in OData
action unlike (review:Reviews.ID); // TODO: can be a bound action in OData
action like (review: type of Reviews:ID);
action unlike (review: type of Reviews:ID);
// Async API
event reviewed : { subject: Reviews.subject; rating: Decimal(2,1) };
event reviewed : {
subject: type of Reviews:subject;
rating: Decimal(2,1)
};
// Input validation
annotate Reviews with {