Skip to content

Commit

Permalink
add internal cinema-service
Browse files Browse the repository at this point in the history
  • Loading branch information
aramovic79 committed Nov 8, 2024
1 parent 67a004d commit bfc8ae2
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 1 deletion.
5 changes: 5 additions & 0 deletions __tests__/__snapshots__/ordCdsrc.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ exports[`Tests for default ORD document when .cdsrc.json is present Successfully
"groupTypeId": "sap.cds:service",
"title": "This is test Catalog Service title",
},
{
"groupId": "sap.cds:service:sap.test.cdsrc.sample:CinemaService",
"groupTypeId": "sap.cds:service",
"title": "This is test Cinema Service title",
},
],
"openResourceDiscovery": "1.10",
"packages": [
Expand Down
5 changes: 5 additions & 0 deletions __tests__/__snapshots__/ordPackageJson.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ exports[`Tests for default ORD document when .cdsrc.json is not present Successf
"groupTypeId": "sap.cds:service",
"title": "This is test Catalog Service title",
},
{
"groupId": "sap.cds:service:customer.capirebookshopordsample:CinemaService",
"groupTypeId": "sap.cds:service",
"title": "This is test Cinema Service title",
},
],
"openResourceDiscovery": "1.9",
"packages": [
Expand Down
8 changes: 8 additions & 0 deletions __tests__/bookshop/db/schema.cds
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,11 @@ entity Genres : sap.common.CodeList {
children : Composition of many Genres
on children.parent = $self;
}

entity Movies : managed {
key ID : Integer;
title : localized String(111);
descr : localized String(1111);
author : Association to Authors;
genre : Association to Genres;
}
2 changes: 1 addition & 1 deletion __tests__/bookshop/srv/cat-service.cds
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ service CatalogService @(path: '/browse') {
annotate CatalogService with @ORD.Extensions: {
title : 'This is test Catalog Service title',
shortDescription : 'short description for test CatalogService',
visibility : 'internal',
visibility : 'private',
version : '2.0.0',
extensible : {supported: 'yes'}
};
40 changes: 40 additions & 0 deletions __tests__/bookshop/srv/cinema-service.cds
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using {sap.capire.bookshop as my} from '../db/schema';

service CinemaService @(path: '/browse') {

@readonly
entity Movies as
select from my.Movies {
*,
author.name as author
}
excluding {
createdBy,
modifiedBy
};

@requires: 'authenticated-user'
action submitOrder(book : Movies:ID, quantity : Integer);

event MovieCreated : {
ID : Integer;
title : String @title: 'Title';
};

event MovieDeleted : {
ID : Integer;
};

event MovieUpdated : {
ID : Integer;
title : String @title: 'Title';
}
}

annotate CinemaService with @ORD.Extensions: {
title : 'This is test Cinema Service title',
shortDescription : 'short description for test CinemaService',
visibility : 'internal',
version : '1.0.0',
extensible : {supported: 'yes'}
};

0 comments on commit bfc8ae2

Please sign in to comment.