diff --git a/__tests__/__mocks__/internalResourcesCsn.json b/__tests__/__mocks__/internalResourcesCsn.json new file mode 100644 index 0000000..57df60a --- /dev/null +++ b/__tests__/__mocks__/internalResourcesCsn.json @@ -0,0 +1,2578 @@ +{ + "definitions": { + "AdminService": { + "kind": "service", + "@requires": "authenticated-user", + "@ORD.Extensions.title": "This is test AdminService title", + "@ORD.Extensions.shortDescription": "short description for test AdminService", + "@ORD.Extensions.visibility": "internal", + "@ORD.Extensions.version": "2.0.0", + "@ORD.Extensions.extensible.supported": "yes", + "@ORD.Extensions.entityTypeMappings.entityTypeTargets": [ + { + "ordId": "sap.odm:entityType:test-from-extension:v1" + } + ] + }, + "AdminService.Books": { + "kind": "entity", + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Books"] + } + }, + "elements": { + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "createdBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "modifiedAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@cds.on.update": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@cds.on.update": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "title": { + "localized": true, + "type": "cds.String", + "length": 111 + }, + "descr": { + "localized": true, + "type": "cds.String", + "length": 1111 + }, + "author": { + "type": "cds.Association", + "target": "AdminService.Authors", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "genre": { + "type": "cds.Association", + "target": "AdminService.Genres", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "stock": { + "type": "cds.Integer" + }, + "price": { + "type": "cds.Decimal", + "precision": 9, + "scale": 2 + }, + "currency": { + "@title": "{i18n>Currency}", + "@description": "{i18n>CurrencyCode.Description}", + "type": "Currency", + "target": "AdminService.Currencies", + "keys": [ + { + "ref": ["code"] + } + ] + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "AdminService.Books.texts", + "on": [ + { + "ref": ["texts", "ID"] + }, + "=", + { + "ref": ["ID"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "AdminService.Books.texts", + "on": [ + { + "ref": ["localized", "ID"] + }, + "=", + { + "ref": ["ID"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "AdminService.Authors": { + "kind": "entity", + "@ODM.entityName": "odm.bookshop.Authors", + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Authors"] + } + }, + "elements": { + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "createdBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "modifiedAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@cds.on.update": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@cds.on.update": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "name": { + "type": "cds.String", + "length": 111 + }, + "books": { + "type": "cds.Association", + "cardinality": { + "max": "*" + }, + "target": "AdminService.Books", + "on": [ + { + "ref": ["books", "author"] + }, + "=", + { + "ref": ["$self"] + } + ] + } + } + }, + "AdminService.BookCreated": { + "kind": "event", + "elements": { + "ID": { + "type": "cds.Integer" + }, + "title": { + "@title": "Title", + "type": "cds.String" + } + } + }, + "AdminService.BookDeleted": { + "kind": "event", + "elements": { + "ID": { + "type": "cds.Integer" + } + } + }, + "AdminService.BookUpdated": { + "kind": "event", + "elements": { + "ID": { + "type": "cds.Integer" + }, + "title": { + "@title": "Title", + "type": "cds.String" + } + } + }, + "AdminService.sum": { + "kind": "function", + "params": { + "x": { + "type": "cds.Integer" + }, + "y": { + "type": "cds.Integer" + } + }, + "returns": { + "type": "cds.Integer" + } + }, + "AdminService.add": { + "kind": "action", + "params": { + "x": { + "type": "cds.Integer" + }, + "to": { + "type": "cds.Integer" + } + }, + "returns": { + "type": "cds.Integer" + } + }, + "CatalogService": { + "kind": "service", + "@path": "/browse", + "@ORD.Extensions.title": "This is test Catalog Service title", + "@ORD.Extensions.shortDescription": "short description for test CatalogService", + "@ORD.Extensions.visibility": "internal", + "@ORD.Extensions.version": "2.0.0", + "@ORD.Extensions.extensible.supported": "yes" + }, + "CatalogService.Books": { + "kind": "entity", + "@readonly": true, + "query": { + "SELECT": { + "from": { + "ref": ["sap.capire.bookshop.Books"] + }, + "columns": [ + "*", + { + "ref": ["author", "name"], + "as": "author" + } + ], + "excluding": ["createdBy", "modifiedBy"] + } + }, + "elements": { + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@cds.on.update": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "title": { + "localized": true, + "type": "cds.String", + "length": 111 + }, + "descr": { + "localized": true, + "type": "cds.String", + "length": 1111 + }, + "author": { + "type": "cds.String", + "length": 111 + }, + "genre": { + "type": "cds.Association", + "target": "CatalogService.Genres", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "stock": { + "type": "cds.Integer" + }, + "price": { + "type": "cds.Decimal", + "precision": 9, + "scale": 2 + }, + "currency": { + "@title": "{i18n>Currency}", + "@description": "{i18n>CurrencyCode.Description}", + "type": "Currency", + "target": "CatalogService.Currencies", + "keys": [ + { + "ref": ["code"] + } + ] + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "CatalogService.Books.texts", + "on": [ + { + "ref": ["texts", "ID"] + }, + "=", + { + "ref": ["ID"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "CatalogService.Books.texts", + "on": [ + { + "ref": ["localized", "ID"] + }, + "=", + { + "ref": ["ID"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "CatalogService.submitOrder": { + "kind": "action", + "@requires": "authenticated-user", + "params": { + "book": { + "type": { + "ref": ["CatalogService.Books", "ID"] + } + }, + "quantity": { + "type": "cds.Integer" + } + } + }, + "CatalogService.BookCreated": { + "kind": "event", + "elements": { + "ID": { + "type": "cds.Integer" + }, + "title": { + "@title": "Title", + "type": "cds.String" + } + } + }, + "CatalogService.BookDeleted": { + "kind": "event", + "elements": { + "ID": { + "type": "cds.Integer" + } + } + }, + "CatalogService.BookUpdated": { + "kind": "event", + "elements": { + "ID": { + "type": "cds.Integer" + }, + "title": { + "@title": "Title", + "type": "cds.String" + } + } + }, + "CinemaService": { + "kind": "service", + "@path": "/browse", + "@ORD.Extensions.title": "This is test Cinema Service title", + "@ORD.Extensions.shortDescription": "short description for test CinemaService", + "@ORD.Extensions.visibility": "internal", + "@ORD.Extensions.version": "1.0.0", + "@ORD.Extensions.extensible.supported": "yes" + }, + "CinemaService.Movies": { + "kind": "entity", + "@readonly": true, + "query": { + "SELECT": { + "from": { + "ref": ["sap.capire.bookshop.Movies"] + }, + "columns": [ + "*", + { + "ref": ["author", "name"], + "as": "author" + } + ], + "excluding": ["createdBy", "modifiedBy"] + } + }, + "elements": { + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@cds.on.update": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "title": { + "localized": true, + "type": "cds.String", + "length": 111 + }, + "descr": { + "localized": true, + "type": "cds.String", + "length": 1111 + }, + "author": { + "type": "cds.String", + "length": 111 + }, + "genre": { + "type": "cds.Association", + "target": "CinemaService.Genres", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "CinemaService.Movies.texts", + "on": [ + { + "ref": ["texts", "ID"] + }, + "=", + { + "ref": ["ID"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "CinemaService.Movies.texts", + "on": [ + { + "ref": ["localized", "ID"] + }, + "=", + { + "ref": ["ID"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "CinemaService.submitOrder": { + "kind": "action", + "@requires": "authenticated-user", + "params": { + "book": { + "type": { + "ref": ["CinemaService.Movies", "ID"] + } + }, + "quantity": { + "type": "cds.Integer" + } + } + }, + "CinemaService.MovieCreated": { + "kind": "event", + "elements": { + "ID": { + "type": "cds.Integer" + }, + "title": { + "@title": "Title", + "type": "cds.String" + } + } + }, + "CinemaService.MovieDeleted": { + "kind": "event", + "elements": { + "ID": { + "type": "cds.Integer" + } + } + }, + "CinemaService.MovieUpdated": { + "kind": "event", + "elements": { + "ID": { + "type": "cds.Integer" + }, + "title": { + "@title": "Title", + "type": "cds.String" + } + } + }, + "sap.capire.bookshop.Books": { + "kind": "entity", + "includes": ["managed"], + "elements": { + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "createdBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "modifiedAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@cds.on.update": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@cds.on.update": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "title": { + "localized": true, + "type": "cds.String", + "length": 111 + }, + "descr": { + "localized": true, + "type": "cds.String", + "length": 1111 + }, + "author": { + "type": "cds.Association", + "target": "sap.capire.bookshop.Authors", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "genre": { + "type": "cds.Association", + "target": "sap.capire.bookshop.Genres", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "stock": { + "type": "cds.Integer" + }, + "price": { + "type": "cds.Decimal", + "precision": 9, + "scale": 2 + }, + "currency": { + "@title": "{i18n>Currency}", + "@description": "{i18n>CurrencyCode.Description}", + "type": "Currency", + "target": "sap.common.Currencies", + "keys": [ + { + "ref": ["code"] + } + ] + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.capire.bookshop.Books.texts", + "on": [ + { + "ref": ["texts", "ID"] + }, + "=", + { + "ref": ["ID"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "sap.capire.bookshop.Books.texts", + "on": [ + { + "ref": ["localized", "ID"] + }, + "=", + { + "ref": ["ID"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "sap.capire.bookshop.Authors": { + "kind": "entity", + "@ODM.entityName": "odm.bookshop.Authors", + "includes": ["managed"], + "elements": { + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "createdBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "modifiedAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@cds.on.update": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@cds.on.update": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "name": { + "type": "cds.String", + "length": 111 + }, + "books": { + "type": "cds.Association", + "cardinality": { + "max": "*" + }, + "target": "sap.capire.bookshop.Books", + "on": [ + { + "ref": ["books", "author"] + }, + "=", + { + "ref": ["$self"] + } + ] + } + } + }, + "sap.capire.bookshop.Genres": { + "kind": "entity", + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "includes": ["sap.common.CodeList"], + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "parent": { + "type": "cds.Association", + "target": "sap.capire.bookshop.Genres", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "children": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.capire.bookshop.Genres", + "on": [ + { + "ref": ["children", "parent"] + }, + "=", + { + "ref": ["$self"] + } + ] + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.capire.bookshop.Genres.texts", + "on": [ + { + "ref": ["texts", "ID"] + }, + "=", + { + "ref": ["ID"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "sap.capire.bookshop.Genres.texts", + "on": [ + { + "ref": ["localized", "ID"] + }, + "=", + { + "ref": ["ID"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "sap.capire.bookshop.Movies": { + "kind": "entity", + "includes": ["managed"], + "elements": { + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "createdBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "modifiedAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@cds.on.update": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@cds.on.update": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "title": { + "localized": true, + "type": "cds.String", + "length": 111 + }, + "descr": { + "localized": true, + "type": "cds.String", + "length": 1111 + }, + "author": { + "type": "cds.Association", + "target": "sap.capire.bookshop.Authors", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "genre": { + "type": "cds.Association", + "target": "sap.capire.bookshop.Genres", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.capire.bookshop.Movies.texts", + "on": [ + { + "ref": ["texts", "ID"] + }, + "=", + { + "ref": ["ID"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "sap.capire.bookshop.Movies.texts", + "on": [ + { + "ref": ["localized", "ID"] + }, + "=", + { + "ref": ["ID"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "Language": { + "kind": "type", + "@title": "{i18n>Language}", + "@description": "{i18n>LanguageCode.Description}", + "type": "cds.Association", + "target": "sap.common.Languages", + "keys": [ + { + "ref": ["code"] + } + ] + }, + "Currency": { + "kind": "type", + "@title": "{i18n>Currency}", + "@description": "{i18n>CurrencyCode.Description}", + "type": "cds.Association", + "target": "sap.common.Currencies", + "keys": [ + { + "ref": ["code"] + } + ] + }, + "Country": { + "kind": "type", + "@title": "{i18n>Country}", + "@description": "{i18n>CountryCode.Description}", + "type": "cds.Association", + "target": "sap.common.Countries", + "keys": [ + { + "ref": ["code"] + } + ] + }, + "Timezone": { + "kind": "type", + "type": "cds.Association", + "target": "sap.common.Timezones", + "keys": [ + { + "ref": ["code"] + } + ] + }, + "sap.common": { + "kind": "context" + }, + "sap.common.Locale": { + "kind": "type", + "@title": "{i18n>LanguageCode}", + "type": "cds.String", + "length": 14 + }, + "sap.common.Languages": { + "kind": "entity", + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "includes": ["sap.common.CodeList"], + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@Common.Text": { + "=": "name" + }, + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.common.Languages.texts", + "on": [ + { + "ref": ["texts", "code"] + }, + "=", + { + "ref": ["code"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "sap.common.Languages.texts", + "on": [ + { + "ref": ["localized", "code"] + }, + "=", + { + "ref": ["code"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "sap.common.Countries": { + "kind": "entity", + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "includes": ["sap.common.CodeList"], + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@title": "{i18n>CountryCode}", + "@Common.Text": { + "=": "name" + }, + "key": true, + "type": "cds.String", + "length": 3 + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.common.Countries.texts", + "on": [ + { + "ref": ["texts", "code"] + }, + "=", + { + "ref": ["code"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "sap.common.Countries.texts", + "on": [ + { + "ref": ["localized", "code"] + }, + "=", + { + "ref": ["code"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "sap.common.Currencies": { + "kind": "entity", + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "includes": ["sap.common.CodeList"], + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@title": "{i18n>CurrencyCode}", + "@Common.Text": { + "=": "name" + }, + "key": true, + "type": "cds.String", + "length": 3 + }, + "symbol": { + "@title": "{i18n>CurrencySymbol}", + "type": "cds.String", + "length": 5 + }, + "minorUnit": { + "@title": "{i18n>CurrencyMinorUnit}", + "type": "cds.Int16" + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.common.Currencies.texts", + "on": [ + { + "ref": ["texts", "code"] + }, + "=", + { + "ref": ["code"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "sap.common.Currencies.texts", + "on": [ + { + "ref": ["localized", "code"] + }, + "=", + { + "ref": ["code"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "sap.common.Timezones": { + "kind": "entity", + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "includes": ["sap.common.CodeList"], + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@title": "{i18n>TimeZoneCode}", + "key": true, + "type": "cds.String", + "length": 100 + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.common.Timezones.texts", + "on": [ + { + "ref": ["texts", "code"] + }, + "=", + { + "ref": ["code"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "sap.common.Timezones.texts", + "on": [ + { + "ref": ["localized", "code"] + }, + "=", + { + "ref": ["code"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "sap.common.CodeList": { + "kind": "aspect", + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + } + } + }, + "sap.common.TextsAspect": { + "kind": "aspect", + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + } + } + }, + "cuid": { + "kind": "aspect", + "elements": { + "ID": { + "key": true, + "type": "cds.UUID" + } + } + }, + "managed": { + "kind": "aspect", + "elements": { + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "createdBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "modifiedAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@cds.on.update": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@cds.on.update": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + } + } + }, + "temporal": { + "kind": "aspect", + "elements": { + "validFrom": { + "@cds.valid.from": true, + "type": "cds.Timestamp" + }, + "validTo": { + "@cds.valid.to": true, + "type": "cds.Timestamp" + } + } + }, + "User": { + "kind": "type", + "@title": "{i18n>UserID}", + "@description": "{i18n>UserID.Description}", + "type": "cds.String", + "length": 255 + }, + "sap.capire.bookshop.Books.texts": { + "kind": "entity", + "@odata.draft.enabled": false, + "includes": ["sap.common.TextsAspect"], + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "ID": { + "@odata.containment.ignore": true, + "key": true, + "type": "cds.Integer" + }, + "title": { + "localized": null, + "type": "cds.String", + "length": 111 + }, + "descr": { + "localized": null, + "type": "cds.String", + "length": 1111 + } + } + }, + "sap.capire.bookshop.Genres.texts": { + "kind": "entity", + "@odata.draft.enabled": false, + "includes": ["sap.common.TextsAspect"], + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "name": { + "@title": "{i18n>Name}", + "localized": null, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": null, + "type": "cds.String", + "length": 1000 + }, + "ID": { + "@odata.containment.ignore": true, + "key": true, + "type": "cds.Integer" + } + } + }, + "sap.capire.bookshop.Movies.texts": { + "kind": "entity", + "@odata.draft.enabled": false, + "includes": ["sap.common.TextsAspect"], + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "ID": { + "@odata.containment.ignore": true, + "key": true, + "type": "cds.Integer" + }, + "title": { + "localized": null, + "type": "cds.String", + "length": 111 + }, + "descr": { + "localized": null, + "type": "cds.String", + "length": 1111 + } + } + }, + "sap.common.Languages.texts": { + "kind": "entity", + "@odata.draft.enabled": false, + "includes": ["sap.common.TextsAspect"], + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "name": { + "@title": "{i18n>Name}", + "localized": null, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": null, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@odata.containment.ignore": true, + "@Common.Text": { + "=": "name" + }, + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + } + } + }, + "sap.common.Countries.texts": { + "kind": "entity", + "@odata.draft.enabled": false, + "includes": ["sap.common.TextsAspect"], + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "name": { + "@title": "{i18n>Name}", + "localized": null, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": null, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@odata.containment.ignore": true, + "@title": "{i18n>CountryCode}", + "@Common.Text": { + "=": "name" + }, + "key": true, + "type": "cds.String", + "length": 3 + } + } + }, + "sap.common.Currencies.texts": { + "kind": "entity", + "@odata.draft.enabled": false, + "includes": ["sap.common.TextsAspect"], + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "name": { + "@title": "{i18n>Name}", + "localized": null, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": null, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@odata.containment.ignore": true, + "@title": "{i18n>CurrencyCode}", + "@Common.Text": { + "=": "name" + }, + "key": true, + "type": "cds.String", + "length": 3 + } + } + }, + "sap.common.Timezones.texts": { + "kind": "entity", + "@odata.draft.enabled": false, + "includes": ["sap.common.TextsAspect"], + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "name": { + "@title": "{i18n>Name}", + "localized": null, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": null, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@odata.containment.ignore": true, + "@title": "{i18n>TimeZoneCode}", + "key": true, + "type": "cds.String", + "length": 100 + } + } + }, + "AdminService.Genres": { + "kind": "entity", + "@cds.autoexposed": true, + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Genres"] + } + }, + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "parent": { + "type": "cds.Association", + "target": "AdminService.Genres", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "children": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "AdminService.Genres", + "on": [ + { + "ref": ["children", "parent"] + }, + "=", + { + "ref": ["$self"] + } + ] + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "AdminService.Genres.texts", + "on": [ + { + "ref": ["texts", "ID"] + }, + "=", + { + "ref": ["ID"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "AdminService.Genres.texts", + "on": [ + { + "ref": ["localized", "ID"] + }, + "=", + { + "ref": ["ID"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "AdminService.Currencies": { + "kind": "entity", + "@cds.autoexposed": true, + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "projection": { + "from": { + "ref": ["sap.common.Currencies"] + } + }, + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@title": "{i18n>CurrencyCode}", + "@Common.Text": { + "=": "name" + }, + "key": true, + "type": "cds.String", + "length": 3 + }, + "symbol": { + "@title": "{i18n>CurrencySymbol}", + "type": "cds.String", + "length": 5 + }, + "minorUnit": { + "@title": "{i18n>CurrencyMinorUnit}", + "type": "cds.Int16" + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "AdminService.Currencies.texts", + "on": [ + { + "ref": ["texts", "code"] + }, + "=", + { + "ref": ["code"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "AdminService.Currencies.texts", + "on": [ + { + "ref": ["localized", "code"] + }, + "=", + { + "ref": ["code"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "AdminService.Books.texts": { + "kind": "entity", + "@cds.autoexposed": true, + "@odata.draft.enabled": false, + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Books.texts"] + } + }, + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "ID": { + "@odata.containment.ignore": true, + "key": true, + "type": "cds.Integer" + }, + "title": { + "localized": null, + "type": "cds.String", + "length": 111 + }, + "descr": { + "localized": null, + "type": "cds.String", + "length": 1111 + } + } + }, + "CatalogService.Genres": { + "kind": "entity", + "@cds.autoexposed": true, + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Genres"] + } + }, + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "parent": { + "type": "cds.Association", + "target": "CatalogService.Genres", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "children": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "CatalogService.Genres", + "on": [ + { + "ref": ["children", "parent"] + }, + "=", + { + "ref": ["$self"] + } + ] + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "CatalogService.Genres.texts", + "on": [ + { + "ref": ["texts", "ID"] + }, + "=", + { + "ref": ["ID"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "CatalogService.Genres.texts", + "on": [ + { + "ref": ["localized", "ID"] + }, + "=", + { + "ref": ["ID"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "CatalogService.Currencies": { + "kind": "entity", + "@cds.autoexposed": true, + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "projection": { + "from": { + "ref": ["sap.common.Currencies"] + } + }, + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@title": "{i18n>CurrencyCode}", + "@Common.Text": { + "=": "name" + }, + "key": true, + "type": "cds.String", + "length": 3 + }, + "symbol": { + "@title": "{i18n>CurrencySymbol}", + "type": "cds.String", + "length": 5 + }, + "minorUnit": { + "@title": "{i18n>CurrencyMinorUnit}", + "type": "cds.Int16" + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "CatalogService.Currencies.texts", + "on": [ + { + "ref": ["texts", "code"] + }, + "=", + { + "ref": ["code"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "CatalogService.Currencies.texts", + "on": [ + { + "ref": ["localized", "code"] + }, + "=", + { + "ref": ["code"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "CatalogService.Books.texts": { + "kind": "entity", + "@cds.autoexposed": true, + "@odata.draft.enabled": false, + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Books.texts"] + } + }, + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "ID": { + "@odata.containment.ignore": true, + "key": true, + "type": "cds.Integer" + }, + "title": { + "localized": null, + "type": "cds.String", + "length": 111 + }, + "descr": { + "localized": null, + "type": "cds.String", + "length": 1111 + } + } + }, + "CinemaService.Genres": { + "kind": "entity", + "@cds.autoexposed": true, + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Genres"] + } + }, + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "parent": { + "type": "cds.Association", + "target": "CinemaService.Genres", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "children": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "CinemaService.Genres", + "on": [ + { + "ref": ["children", "parent"] + }, + "=", + { + "ref": ["$self"] + } + ] + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "CinemaService.Genres.texts", + "on": [ + { + "ref": ["texts", "ID"] + }, + "=", + { + "ref": ["ID"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "CinemaService.Genres.texts", + "on": [ + { + "ref": ["localized", "ID"] + }, + "=", + { + "ref": ["ID"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "CinemaService.Movies.texts": { + "kind": "entity", + "@cds.autoexposed": true, + "@odata.draft.enabled": false, + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Movies.texts"] + } + }, + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "ID": { + "@odata.containment.ignore": true, + "key": true, + "type": "cds.Integer" + }, + "title": { + "localized": null, + "type": "cds.String", + "length": 111 + }, + "descr": { + "localized": null, + "type": "cds.String", + "length": 1111 + } + } + }, + "AdminService.Genres.texts": { + "kind": "entity", + "@cds.autoexposed": true, + "@odata.draft.enabled": false, + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Genres.texts"] + } + }, + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "name": { + "@title": "{i18n>Name}", + "localized": null, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": null, + "type": "cds.String", + "length": 1000 + }, + "ID": { + "@odata.containment.ignore": true, + "key": true, + "type": "cds.Integer" + } + } + }, + "AdminService.Currencies.texts": { + "kind": "entity", + "@cds.autoexposed": true, + "@odata.draft.enabled": false, + "projection": { + "from": { + "ref": ["sap.common.Currencies.texts"] + } + }, + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "name": { + "@title": "{i18n>Name}", + "localized": null, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": null, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@odata.containment.ignore": true, + "@title": "{i18n>CurrencyCode}", + "@Common.Text": { + "=": "name" + }, + "key": true, + "type": "cds.String", + "length": 3 + } + } + }, + "CatalogService.Genres.texts": { + "kind": "entity", + "@cds.autoexposed": true, + "@odata.draft.enabled": false, + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Genres.texts"] + } + }, + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "name": { + "@title": "{i18n>Name}", + "localized": null, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": null, + "type": "cds.String", + "length": 1000 + }, + "ID": { + "@odata.containment.ignore": true, + "key": true, + "type": "cds.Integer" + } + } + }, + "CatalogService.Currencies.texts": { + "kind": "entity", + "@cds.autoexposed": true, + "@odata.draft.enabled": false, + "projection": { + "from": { + "ref": ["sap.common.Currencies.texts"] + } + }, + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "name": { + "@title": "{i18n>Name}", + "localized": null, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": null, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@odata.containment.ignore": true, + "@title": "{i18n>CurrencyCode}", + "@Common.Text": { + "=": "name" + }, + "key": true, + "type": "cds.String", + "length": 3 + } + } + }, + "CinemaService.Genres.texts": { + "kind": "entity", + "@cds.autoexposed": true, + "@odata.draft.enabled": false, + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Genres.texts"] + } + }, + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "name": { + "@title": "{i18n>Name}", + "localized": null, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": null, + "type": "cds.String", + "length": 1000 + }, + "ID": { + "@odata.containment.ignore": true, + "key": true, + "type": "cds.Integer" + } + } + } + }, + "meta": { + "creator": "CDS Compiler v5.2.0", + "flavor": "inferred" + }, + "$version": "2.0" +} diff --git a/__tests__/__mocks__/privateResourcesCsn.json b/__tests__/__mocks__/privateResourcesCsn.json new file mode 100644 index 0000000..bee362e --- /dev/null +++ b/__tests__/__mocks__/privateResourcesCsn.json @@ -0,0 +1,2578 @@ +{ + "definitions": { + "AdminService": { + "kind": "service", + "@requires": "authenticated-user", + "@ORD.Extensions.title": "This is test AdminService title", + "@ORD.Extensions.shortDescription": "short description for test AdminService", + "@ORD.Extensions.visibility": "private", + "@ORD.Extensions.version": "2.0.0", + "@ORD.Extensions.extensible.supported": "yes", + "@ORD.Extensions.entityTypeMappings.entityTypeTargets": [ + { + "ordId": "sap.odm:entityType:test-from-extension:v1" + } + ] + }, + "AdminService.Books": { + "kind": "entity", + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Books"] + } + }, + "elements": { + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "createdBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "modifiedAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@cds.on.update": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@cds.on.update": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "title": { + "localized": true, + "type": "cds.String", + "length": 111 + }, + "descr": { + "localized": true, + "type": "cds.String", + "length": 1111 + }, + "author": { + "type": "cds.Association", + "target": "AdminService.Authors", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "genre": { + "type": "cds.Association", + "target": "AdminService.Genres", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "stock": { + "type": "cds.Integer" + }, + "price": { + "type": "cds.Decimal", + "precision": 9, + "scale": 2 + }, + "currency": { + "@title": "{i18n>Currency}", + "@description": "{i18n>CurrencyCode.Description}", + "type": "Currency", + "target": "AdminService.Currencies", + "keys": [ + { + "ref": ["code"] + } + ] + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "AdminService.Books.texts", + "on": [ + { + "ref": ["texts", "ID"] + }, + "=", + { + "ref": ["ID"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "AdminService.Books.texts", + "on": [ + { + "ref": ["localized", "ID"] + }, + "=", + { + "ref": ["ID"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "AdminService.Authors": { + "kind": "entity", + "@ODM.entityName": "odm.bookshop.Authors", + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Authors"] + } + }, + "elements": { + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "createdBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "modifiedAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@cds.on.update": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@cds.on.update": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "name": { + "type": "cds.String", + "length": 111 + }, + "books": { + "type": "cds.Association", + "cardinality": { + "max": "*" + }, + "target": "AdminService.Books", + "on": [ + { + "ref": ["books", "author"] + }, + "=", + { + "ref": ["$self"] + } + ] + } + } + }, + "AdminService.BookCreated": { + "kind": "event", + "elements": { + "ID": { + "type": "cds.Integer" + }, + "title": { + "@title": "Title", + "type": "cds.String" + } + } + }, + "AdminService.BookDeleted": { + "kind": "event", + "elements": { + "ID": { + "type": "cds.Integer" + } + } + }, + "AdminService.BookUpdated": { + "kind": "event", + "elements": { + "ID": { + "type": "cds.Integer" + }, + "title": { + "@title": "Title", + "type": "cds.String" + } + } + }, + "AdminService.sum": { + "kind": "function", + "params": { + "x": { + "type": "cds.Integer" + }, + "y": { + "type": "cds.Integer" + } + }, + "returns": { + "type": "cds.Integer" + } + }, + "AdminService.add": { + "kind": "action", + "params": { + "x": { + "type": "cds.Integer" + }, + "to": { + "type": "cds.Integer" + } + }, + "returns": { + "type": "cds.Integer" + } + }, + "CatalogService": { + "kind": "service", + "@path": "/browse", + "@ORD.Extensions.title": "This is test Catalog Service title", + "@ORD.Extensions.shortDescription": "short description for test CatalogService", + "@ORD.Extensions.visibility": "private", + "@ORD.Extensions.version": "2.0.0", + "@ORD.Extensions.extensible.supported": "yes" + }, + "CatalogService.Books": { + "kind": "entity", + "@readonly": true, + "query": { + "SELECT": { + "from": { + "ref": ["sap.capire.bookshop.Books"] + }, + "columns": [ + "*", + { + "ref": ["author", "name"], + "as": "author" + } + ], + "excluding": ["createdBy", "modifiedBy"] + } + }, + "elements": { + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@cds.on.update": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "title": { + "localized": true, + "type": "cds.String", + "length": 111 + }, + "descr": { + "localized": true, + "type": "cds.String", + "length": 1111 + }, + "author": { + "type": "cds.String", + "length": 111 + }, + "genre": { + "type": "cds.Association", + "target": "CatalogService.Genres", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "stock": { + "type": "cds.Integer" + }, + "price": { + "type": "cds.Decimal", + "precision": 9, + "scale": 2 + }, + "currency": { + "@title": "{i18n>Currency}", + "@description": "{i18n>CurrencyCode.Description}", + "type": "Currency", + "target": "CatalogService.Currencies", + "keys": [ + { + "ref": ["code"] + } + ] + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "CatalogService.Books.texts", + "on": [ + { + "ref": ["texts", "ID"] + }, + "=", + { + "ref": ["ID"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "CatalogService.Books.texts", + "on": [ + { + "ref": ["localized", "ID"] + }, + "=", + { + "ref": ["ID"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "CatalogService.submitOrder": { + "kind": "action", + "@requires": "authenticated-user", + "params": { + "book": { + "type": { + "ref": ["CatalogService.Books", "ID"] + } + }, + "quantity": { + "type": "cds.Integer" + } + } + }, + "CatalogService.BookCreated": { + "kind": "event", + "elements": { + "ID": { + "type": "cds.Integer" + }, + "title": { + "@title": "Title", + "type": "cds.String" + } + } + }, + "CatalogService.BookDeleted": { + "kind": "event", + "elements": { + "ID": { + "type": "cds.Integer" + } + } + }, + "CatalogService.BookUpdated": { + "kind": "event", + "elements": { + "ID": { + "type": "cds.Integer" + }, + "title": { + "@title": "Title", + "type": "cds.String" + } + } + }, + "CinemaService": { + "kind": "service", + "@path": "/browse", + "@ORD.Extensions.title": "This is test Cinema Service title", + "@ORD.Extensions.shortDescription": "short description for test CinemaService", + "@ORD.Extensions.visibility": "private", + "@ORD.Extensions.version": "1.0.0", + "@ORD.Extensions.extensible.supported": "yes" + }, + "CinemaService.Movies": { + "kind": "entity", + "@readonly": true, + "query": { + "SELECT": { + "from": { + "ref": ["sap.capire.bookshop.Movies"] + }, + "columns": [ + "*", + { + "ref": ["author", "name"], + "as": "author" + } + ], + "excluding": ["createdBy", "modifiedBy"] + } + }, + "elements": { + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@cds.on.update": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "title": { + "localized": true, + "type": "cds.String", + "length": 111 + }, + "descr": { + "localized": true, + "type": "cds.String", + "length": 1111 + }, + "author": { + "type": "cds.String", + "length": 111 + }, + "genre": { + "type": "cds.Association", + "target": "CinemaService.Genres", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "CinemaService.Movies.texts", + "on": [ + { + "ref": ["texts", "ID"] + }, + "=", + { + "ref": ["ID"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "CinemaService.Movies.texts", + "on": [ + { + "ref": ["localized", "ID"] + }, + "=", + { + "ref": ["ID"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "CinemaService.submitOrder": { + "kind": "action", + "@requires": "authenticated-user", + "params": { + "book": { + "type": { + "ref": ["CinemaService.Movies", "ID"] + } + }, + "quantity": { + "type": "cds.Integer" + } + } + }, + "CinemaService.MovieCreated": { + "kind": "event", + "elements": { + "ID": { + "type": "cds.Integer" + }, + "title": { + "@title": "Title", + "type": "cds.String" + } + } + }, + "CinemaService.MovieDeleted": { + "kind": "event", + "elements": { + "ID": { + "type": "cds.Integer" + } + } + }, + "CinemaService.MovieUpdated": { + "kind": "event", + "elements": { + "ID": { + "type": "cds.Integer" + }, + "title": { + "@title": "Title", + "type": "cds.String" + } + } + }, + "sap.capire.bookshop.Books": { + "kind": "entity", + "includes": ["managed"], + "elements": { + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "createdBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "modifiedAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@cds.on.update": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@cds.on.update": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "title": { + "localized": true, + "type": "cds.String", + "length": 111 + }, + "descr": { + "localized": true, + "type": "cds.String", + "length": 1111 + }, + "author": { + "type": "cds.Association", + "target": "sap.capire.bookshop.Authors", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "genre": { + "type": "cds.Association", + "target": "sap.capire.bookshop.Genres", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "stock": { + "type": "cds.Integer" + }, + "price": { + "type": "cds.Decimal", + "precision": 9, + "scale": 2 + }, + "currency": { + "@title": "{i18n>Currency}", + "@description": "{i18n>CurrencyCode.Description}", + "type": "Currency", + "target": "sap.common.Currencies", + "keys": [ + { + "ref": ["code"] + } + ] + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.capire.bookshop.Books.texts", + "on": [ + { + "ref": ["texts", "ID"] + }, + "=", + { + "ref": ["ID"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "sap.capire.bookshop.Books.texts", + "on": [ + { + "ref": ["localized", "ID"] + }, + "=", + { + "ref": ["ID"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "sap.capire.bookshop.Authors": { + "kind": "entity", + "@ODM.entityName": "odm.bookshop.Authors", + "includes": ["managed"], + "elements": { + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "createdBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "modifiedAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@cds.on.update": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@cds.on.update": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "name": { + "type": "cds.String", + "length": 111 + }, + "books": { + "type": "cds.Association", + "cardinality": { + "max": "*" + }, + "target": "sap.capire.bookshop.Books", + "on": [ + { + "ref": ["books", "author"] + }, + "=", + { + "ref": ["$self"] + } + ] + } + } + }, + "sap.capire.bookshop.Genres": { + "kind": "entity", + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "includes": ["sap.common.CodeList"], + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "parent": { + "type": "cds.Association", + "target": "sap.capire.bookshop.Genres", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "children": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.capire.bookshop.Genres", + "on": [ + { + "ref": ["children", "parent"] + }, + "=", + { + "ref": ["$self"] + } + ] + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.capire.bookshop.Genres.texts", + "on": [ + { + "ref": ["texts", "ID"] + }, + "=", + { + "ref": ["ID"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "sap.capire.bookshop.Genres.texts", + "on": [ + { + "ref": ["localized", "ID"] + }, + "=", + { + "ref": ["ID"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "sap.capire.bookshop.Movies": { + "kind": "entity", + "includes": ["managed"], + "elements": { + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "createdBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "modifiedAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@cds.on.update": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@cds.on.update": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "title": { + "localized": true, + "type": "cds.String", + "length": 111 + }, + "descr": { + "localized": true, + "type": "cds.String", + "length": 1111 + }, + "author": { + "type": "cds.Association", + "target": "sap.capire.bookshop.Authors", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "genre": { + "type": "cds.Association", + "target": "sap.capire.bookshop.Genres", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.capire.bookshop.Movies.texts", + "on": [ + { + "ref": ["texts", "ID"] + }, + "=", + { + "ref": ["ID"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "sap.capire.bookshop.Movies.texts", + "on": [ + { + "ref": ["localized", "ID"] + }, + "=", + { + "ref": ["ID"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "Language": { + "kind": "type", + "@title": "{i18n>Language}", + "@description": "{i18n>LanguageCode.Description}", + "type": "cds.Association", + "target": "sap.common.Languages", + "keys": [ + { + "ref": ["code"] + } + ] + }, + "Currency": { + "kind": "type", + "@title": "{i18n>Currency}", + "@description": "{i18n>CurrencyCode.Description}", + "type": "cds.Association", + "target": "sap.common.Currencies", + "keys": [ + { + "ref": ["code"] + } + ] + }, + "Country": { + "kind": "type", + "@title": "{i18n>Country}", + "@description": "{i18n>CountryCode.Description}", + "type": "cds.Association", + "target": "sap.common.Countries", + "keys": [ + { + "ref": ["code"] + } + ] + }, + "Timezone": { + "kind": "type", + "type": "cds.Association", + "target": "sap.common.Timezones", + "keys": [ + { + "ref": ["code"] + } + ] + }, + "sap.common": { + "kind": "context" + }, + "sap.common.Locale": { + "kind": "type", + "@title": "{i18n>LanguageCode}", + "type": "cds.String", + "length": 14 + }, + "sap.common.Languages": { + "kind": "entity", + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "includes": ["sap.common.CodeList"], + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@Common.Text": { + "=": "name" + }, + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.common.Languages.texts", + "on": [ + { + "ref": ["texts", "code"] + }, + "=", + { + "ref": ["code"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "sap.common.Languages.texts", + "on": [ + { + "ref": ["localized", "code"] + }, + "=", + { + "ref": ["code"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "sap.common.Countries": { + "kind": "entity", + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "includes": ["sap.common.CodeList"], + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@title": "{i18n>CountryCode}", + "@Common.Text": { + "=": "name" + }, + "key": true, + "type": "cds.String", + "length": 3 + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.common.Countries.texts", + "on": [ + { + "ref": ["texts", "code"] + }, + "=", + { + "ref": ["code"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "sap.common.Countries.texts", + "on": [ + { + "ref": ["localized", "code"] + }, + "=", + { + "ref": ["code"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "sap.common.Currencies": { + "kind": "entity", + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "includes": ["sap.common.CodeList"], + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@title": "{i18n>CurrencyCode}", + "@Common.Text": { + "=": "name" + }, + "key": true, + "type": "cds.String", + "length": 3 + }, + "symbol": { + "@title": "{i18n>CurrencySymbol}", + "type": "cds.String", + "length": 5 + }, + "minorUnit": { + "@title": "{i18n>CurrencyMinorUnit}", + "type": "cds.Int16" + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.common.Currencies.texts", + "on": [ + { + "ref": ["texts", "code"] + }, + "=", + { + "ref": ["code"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "sap.common.Currencies.texts", + "on": [ + { + "ref": ["localized", "code"] + }, + "=", + { + "ref": ["code"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "sap.common.Timezones": { + "kind": "entity", + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "includes": ["sap.common.CodeList"], + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@title": "{i18n>TimeZoneCode}", + "key": true, + "type": "cds.String", + "length": 100 + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.common.Timezones.texts", + "on": [ + { + "ref": ["texts", "code"] + }, + "=", + { + "ref": ["code"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "sap.common.Timezones.texts", + "on": [ + { + "ref": ["localized", "code"] + }, + "=", + { + "ref": ["code"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "sap.common.CodeList": { + "kind": "aspect", + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + } + } + }, + "sap.common.TextsAspect": { + "kind": "aspect", + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + } + } + }, + "cuid": { + "kind": "aspect", + "elements": { + "ID": { + "key": true, + "type": "cds.UUID" + } + } + }, + "managed": { + "kind": "aspect", + "elements": { + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "createdBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "modifiedAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@cds.on.update": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@cds.on.update": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + } + } + }, + "temporal": { + "kind": "aspect", + "elements": { + "validFrom": { + "@cds.valid.from": true, + "type": "cds.Timestamp" + }, + "validTo": { + "@cds.valid.to": true, + "type": "cds.Timestamp" + } + } + }, + "User": { + "kind": "type", + "@title": "{i18n>UserID}", + "@description": "{i18n>UserID.Description}", + "type": "cds.String", + "length": 255 + }, + "sap.capire.bookshop.Books.texts": { + "kind": "entity", + "@odata.draft.enabled": false, + "includes": ["sap.common.TextsAspect"], + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "ID": { + "@odata.containment.ignore": true, + "key": true, + "type": "cds.Integer" + }, + "title": { + "localized": null, + "type": "cds.String", + "length": 111 + }, + "descr": { + "localized": null, + "type": "cds.String", + "length": 1111 + } + } + }, + "sap.capire.bookshop.Genres.texts": { + "kind": "entity", + "@odata.draft.enabled": false, + "includes": ["sap.common.TextsAspect"], + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "name": { + "@title": "{i18n>Name}", + "localized": null, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": null, + "type": "cds.String", + "length": 1000 + }, + "ID": { + "@odata.containment.ignore": true, + "key": true, + "type": "cds.Integer" + } + } + }, + "sap.capire.bookshop.Movies.texts": { + "kind": "entity", + "@odata.draft.enabled": false, + "includes": ["sap.common.TextsAspect"], + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "ID": { + "@odata.containment.ignore": true, + "key": true, + "type": "cds.Integer" + }, + "title": { + "localized": null, + "type": "cds.String", + "length": 111 + }, + "descr": { + "localized": null, + "type": "cds.String", + "length": 1111 + } + } + }, + "sap.common.Languages.texts": { + "kind": "entity", + "@odata.draft.enabled": false, + "includes": ["sap.common.TextsAspect"], + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "name": { + "@title": "{i18n>Name}", + "localized": null, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": null, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@odata.containment.ignore": true, + "@Common.Text": { + "=": "name" + }, + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + } + } + }, + "sap.common.Countries.texts": { + "kind": "entity", + "@odata.draft.enabled": false, + "includes": ["sap.common.TextsAspect"], + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "name": { + "@title": "{i18n>Name}", + "localized": null, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": null, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@odata.containment.ignore": true, + "@title": "{i18n>CountryCode}", + "@Common.Text": { + "=": "name" + }, + "key": true, + "type": "cds.String", + "length": 3 + } + } + }, + "sap.common.Currencies.texts": { + "kind": "entity", + "@odata.draft.enabled": false, + "includes": ["sap.common.TextsAspect"], + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "name": { + "@title": "{i18n>Name}", + "localized": null, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": null, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@odata.containment.ignore": true, + "@title": "{i18n>CurrencyCode}", + "@Common.Text": { + "=": "name" + }, + "key": true, + "type": "cds.String", + "length": 3 + } + } + }, + "sap.common.Timezones.texts": { + "kind": "entity", + "@odata.draft.enabled": false, + "includes": ["sap.common.TextsAspect"], + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "name": { + "@title": "{i18n>Name}", + "localized": null, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": null, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@odata.containment.ignore": true, + "@title": "{i18n>TimeZoneCode}", + "key": true, + "type": "cds.String", + "length": 100 + } + } + }, + "AdminService.Genres": { + "kind": "entity", + "@cds.autoexposed": true, + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Genres"] + } + }, + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "parent": { + "type": "cds.Association", + "target": "AdminService.Genres", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "children": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "AdminService.Genres", + "on": [ + { + "ref": ["children", "parent"] + }, + "=", + { + "ref": ["$self"] + } + ] + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "AdminService.Genres.texts", + "on": [ + { + "ref": ["texts", "ID"] + }, + "=", + { + "ref": ["ID"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "AdminService.Genres.texts", + "on": [ + { + "ref": ["localized", "ID"] + }, + "=", + { + "ref": ["ID"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "AdminService.Currencies": { + "kind": "entity", + "@cds.autoexposed": true, + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "projection": { + "from": { + "ref": ["sap.common.Currencies"] + } + }, + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@title": "{i18n>CurrencyCode}", + "@Common.Text": { + "=": "name" + }, + "key": true, + "type": "cds.String", + "length": 3 + }, + "symbol": { + "@title": "{i18n>CurrencySymbol}", + "type": "cds.String", + "length": 5 + }, + "minorUnit": { + "@title": "{i18n>CurrencyMinorUnit}", + "type": "cds.Int16" + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "AdminService.Currencies.texts", + "on": [ + { + "ref": ["texts", "code"] + }, + "=", + { + "ref": ["code"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "AdminService.Currencies.texts", + "on": [ + { + "ref": ["localized", "code"] + }, + "=", + { + "ref": ["code"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "AdminService.Books.texts": { + "kind": "entity", + "@cds.autoexposed": true, + "@odata.draft.enabled": false, + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Books.texts"] + } + }, + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "ID": { + "@odata.containment.ignore": true, + "key": true, + "type": "cds.Integer" + }, + "title": { + "localized": null, + "type": "cds.String", + "length": 111 + }, + "descr": { + "localized": null, + "type": "cds.String", + "length": 1111 + } + } + }, + "CatalogService.Genres": { + "kind": "entity", + "@cds.autoexposed": true, + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Genres"] + } + }, + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "parent": { + "type": "cds.Association", + "target": "CatalogService.Genres", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "children": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "CatalogService.Genres", + "on": [ + { + "ref": ["children", "parent"] + }, + "=", + { + "ref": ["$self"] + } + ] + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "CatalogService.Genres.texts", + "on": [ + { + "ref": ["texts", "ID"] + }, + "=", + { + "ref": ["ID"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "CatalogService.Genres.texts", + "on": [ + { + "ref": ["localized", "ID"] + }, + "=", + { + "ref": ["ID"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "CatalogService.Currencies": { + "kind": "entity", + "@cds.autoexposed": true, + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "projection": { + "from": { + "ref": ["sap.common.Currencies"] + } + }, + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@title": "{i18n>CurrencyCode}", + "@Common.Text": { + "=": "name" + }, + "key": true, + "type": "cds.String", + "length": 3 + }, + "symbol": { + "@title": "{i18n>CurrencySymbol}", + "type": "cds.String", + "length": 5 + }, + "minorUnit": { + "@title": "{i18n>CurrencyMinorUnit}", + "type": "cds.Int16" + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "CatalogService.Currencies.texts", + "on": [ + { + "ref": ["texts", "code"] + }, + "=", + { + "ref": ["code"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "CatalogService.Currencies.texts", + "on": [ + { + "ref": ["localized", "code"] + }, + "=", + { + "ref": ["code"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "CatalogService.Books.texts": { + "kind": "entity", + "@cds.autoexposed": true, + "@odata.draft.enabled": false, + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Books.texts"] + } + }, + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "ID": { + "@odata.containment.ignore": true, + "key": true, + "type": "cds.Integer" + }, + "title": { + "localized": null, + "type": "cds.String", + "length": 111 + }, + "descr": { + "localized": null, + "type": "cds.String", + "length": 1111 + } + } + }, + "CinemaService.Genres": { + "kind": "entity", + "@cds.autoexposed": true, + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Genres"] + } + }, + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "parent": { + "type": "cds.Association", + "target": "CinemaService.Genres", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "children": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "CinemaService.Genres", + "on": [ + { + "ref": ["children", "parent"] + }, + "=", + { + "ref": ["$self"] + } + ] + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "CinemaService.Genres.texts", + "on": [ + { + "ref": ["texts", "ID"] + }, + "=", + { + "ref": ["ID"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "CinemaService.Genres.texts", + "on": [ + { + "ref": ["localized", "ID"] + }, + "=", + { + "ref": ["ID"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "CinemaService.Movies.texts": { + "kind": "entity", + "@cds.autoexposed": true, + "@odata.draft.enabled": false, + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Movies.texts"] + } + }, + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "ID": { + "@odata.containment.ignore": true, + "key": true, + "type": "cds.Integer" + }, + "title": { + "localized": null, + "type": "cds.String", + "length": 111 + }, + "descr": { + "localized": null, + "type": "cds.String", + "length": 1111 + } + } + }, + "AdminService.Genres.texts": { + "kind": "entity", + "@cds.autoexposed": true, + "@odata.draft.enabled": false, + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Genres.texts"] + } + }, + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "name": { + "@title": "{i18n>Name}", + "localized": null, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": null, + "type": "cds.String", + "length": 1000 + }, + "ID": { + "@odata.containment.ignore": true, + "key": true, + "type": "cds.Integer" + } + } + }, + "AdminService.Currencies.texts": { + "kind": "entity", + "@cds.autoexposed": true, + "@odata.draft.enabled": false, + "projection": { + "from": { + "ref": ["sap.common.Currencies.texts"] + } + }, + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "name": { + "@title": "{i18n>Name}", + "localized": null, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": null, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@odata.containment.ignore": true, + "@title": "{i18n>CurrencyCode}", + "@Common.Text": { + "=": "name" + }, + "key": true, + "type": "cds.String", + "length": 3 + } + } + }, + "CatalogService.Genres.texts": { + "kind": "entity", + "@cds.autoexposed": true, + "@odata.draft.enabled": false, + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Genres.texts"] + } + }, + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "name": { + "@title": "{i18n>Name}", + "localized": null, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": null, + "type": "cds.String", + "length": 1000 + }, + "ID": { + "@odata.containment.ignore": true, + "key": true, + "type": "cds.Integer" + } + } + }, + "CatalogService.Currencies.texts": { + "kind": "entity", + "@cds.autoexposed": true, + "@odata.draft.enabled": false, + "projection": { + "from": { + "ref": ["sap.common.Currencies.texts"] + } + }, + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "name": { + "@title": "{i18n>Name}", + "localized": null, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": null, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@odata.containment.ignore": true, + "@title": "{i18n>CurrencyCode}", + "@Common.Text": { + "=": "name" + }, + "key": true, + "type": "cds.String", + "length": 3 + } + } + }, + "CinemaService.Genres.texts": { + "kind": "entity", + "@cds.autoexposed": true, + "@odata.draft.enabled": false, + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Genres.texts"] + } + }, + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "name": { + "@title": "{i18n>Name}", + "localized": null, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": null, + "type": "cds.String", + "length": 1000 + }, + "ID": { + "@odata.containment.ignore": true, + "key": true, + "type": "cds.Integer" + } + } + } + }, + "meta": { + "creator": "CDS Compiler v5.2.0", + "flavor": "inferred" + }, + "$version": "2.0" +} diff --git a/__tests__/__mocks__/publicResourcesCsn.json b/__tests__/__mocks__/publicResourcesCsn.json new file mode 100644 index 0000000..1ccc968 --- /dev/null +++ b/__tests__/__mocks__/publicResourcesCsn.json @@ -0,0 +1,2578 @@ +{ + "definitions": { + "AdminService": { + "kind": "service", + "@requires": "authenticated-user", + "@ORD.Extensions.title": "This is test AdminService title", + "@ORD.Extensions.shortDescription": "short description for test AdminService", + "@ORD.Extensions.visibility": "public", + "@ORD.Extensions.version": "2.0.0", + "@ORD.Extensions.extensible.supported": "yes", + "@ORD.Extensions.entityTypeMappings.entityTypeTargets": [ + { + "ordId": "sap.odm:entityType:test-from-extension:v1" + } + ] + }, + "AdminService.Books": { + "kind": "entity", + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Books"] + } + }, + "elements": { + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "createdBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "modifiedAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@cds.on.update": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@cds.on.update": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "title": { + "localized": true, + "type": "cds.String", + "length": 111 + }, + "descr": { + "localized": true, + "type": "cds.String", + "length": 1111 + }, + "author": { + "type": "cds.Association", + "target": "AdminService.Authors", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "genre": { + "type": "cds.Association", + "target": "AdminService.Genres", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "stock": { + "type": "cds.Integer" + }, + "price": { + "type": "cds.Decimal", + "precision": 9, + "scale": 2 + }, + "currency": { + "@title": "{i18n>Currency}", + "@description": "{i18n>CurrencyCode.Description}", + "type": "Currency", + "target": "AdminService.Currencies", + "keys": [ + { + "ref": ["code"] + } + ] + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "AdminService.Books.texts", + "on": [ + { + "ref": ["texts", "ID"] + }, + "=", + { + "ref": ["ID"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "AdminService.Books.texts", + "on": [ + { + "ref": ["localized", "ID"] + }, + "=", + { + "ref": ["ID"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "AdminService.Authors": { + "kind": "entity", + "@ODM.entityName": "odm.bookshop.Authors", + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Authors"] + } + }, + "elements": { + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "createdBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "modifiedAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@cds.on.update": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@cds.on.update": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "name": { + "type": "cds.String", + "length": 111 + }, + "books": { + "type": "cds.Association", + "cardinality": { + "max": "*" + }, + "target": "AdminService.Books", + "on": [ + { + "ref": ["books", "author"] + }, + "=", + { + "ref": ["$self"] + } + ] + } + } + }, + "AdminService.BookCreated": { + "kind": "event", + "elements": { + "ID": { + "type": "cds.Integer" + }, + "title": { + "@title": "Title", + "type": "cds.String" + } + } + }, + "AdminService.BookDeleted": { + "kind": "event", + "elements": { + "ID": { + "type": "cds.Integer" + } + } + }, + "AdminService.BookUpdated": { + "kind": "event", + "elements": { + "ID": { + "type": "cds.Integer" + }, + "title": { + "@title": "Title", + "type": "cds.String" + } + } + }, + "AdminService.sum": { + "kind": "function", + "params": { + "x": { + "type": "cds.Integer" + }, + "y": { + "type": "cds.Integer" + } + }, + "returns": { + "type": "cds.Integer" + } + }, + "AdminService.add": { + "kind": "action", + "params": { + "x": { + "type": "cds.Integer" + }, + "to": { + "type": "cds.Integer" + } + }, + "returns": { + "type": "cds.Integer" + } + }, + "CatalogService": { + "kind": "service", + "@path": "/browse", + "@ORD.Extensions.title": "This is test Catalog Service title", + "@ORD.Extensions.shortDescription": "short description for test CatalogService", + "@ORD.Extensions.visibility": "public", + "@ORD.Extensions.version": "2.0.0", + "@ORD.Extensions.extensible.supported": "yes" + }, + "CatalogService.Books": { + "kind": "entity", + "@readonly": true, + "query": { + "SELECT": { + "from": { + "ref": ["sap.capire.bookshop.Books"] + }, + "columns": [ + "*", + { + "ref": ["author", "name"], + "as": "author" + } + ], + "excluding": ["createdBy", "modifiedBy"] + } + }, + "elements": { + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@cds.on.update": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "title": { + "localized": true, + "type": "cds.String", + "length": 111 + }, + "descr": { + "localized": true, + "type": "cds.String", + "length": 1111 + }, + "author": { + "type": "cds.String", + "length": 111 + }, + "genre": { + "type": "cds.Association", + "target": "CatalogService.Genres", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "stock": { + "type": "cds.Integer" + }, + "price": { + "type": "cds.Decimal", + "precision": 9, + "scale": 2 + }, + "currency": { + "@title": "{i18n>Currency}", + "@description": "{i18n>CurrencyCode.Description}", + "type": "Currency", + "target": "CatalogService.Currencies", + "keys": [ + { + "ref": ["code"] + } + ] + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "CatalogService.Books.texts", + "on": [ + { + "ref": ["texts", "ID"] + }, + "=", + { + "ref": ["ID"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "CatalogService.Books.texts", + "on": [ + { + "ref": ["localized", "ID"] + }, + "=", + { + "ref": ["ID"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "CatalogService.submitOrder": { + "kind": "action", + "@requires": "authenticated-user", + "params": { + "book": { + "type": { + "ref": ["CatalogService.Books", "ID"] + } + }, + "quantity": { + "type": "cds.Integer" + } + } + }, + "CatalogService.BookCreated": { + "kind": "event", + "elements": { + "ID": { + "type": "cds.Integer" + }, + "title": { + "@title": "Title", + "type": "cds.String" + } + } + }, + "CatalogService.BookDeleted": { + "kind": "event", + "elements": { + "ID": { + "type": "cds.Integer" + } + } + }, + "CatalogService.BookUpdated": { + "kind": "event", + "elements": { + "ID": { + "type": "cds.Integer" + }, + "title": { + "@title": "Title", + "type": "cds.String" + } + } + }, + "CinemaService": { + "kind": "service", + "@path": "/browse", + "@ORD.Extensions.title": "This is test Cinema Service title", + "@ORD.Extensions.shortDescription": "short description for test CinemaService", + "@ORD.Extensions.visibility": "public", + "@ORD.Extensions.version": "1.0.0", + "@ORD.Extensions.extensible.supported": "yes" + }, + "CinemaService.Movies": { + "kind": "entity", + "@readonly": true, + "query": { + "SELECT": { + "from": { + "ref": ["sap.capire.bookshop.Movies"] + }, + "columns": [ + "*", + { + "ref": ["author", "name"], + "as": "author" + } + ], + "excluding": ["createdBy", "modifiedBy"] + } + }, + "elements": { + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@cds.on.update": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "title": { + "localized": true, + "type": "cds.String", + "length": 111 + }, + "descr": { + "localized": true, + "type": "cds.String", + "length": 1111 + }, + "author": { + "type": "cds.String", + "length": 111 + }, + "genre": { + "type": "cds.Association", + "target": "CinemaService.Genres", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "CinemaService.Movies.texts", + "on": [ + { + "ref": ["texts", "ID"] + }, + "=", + { + "ref": ["ID"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "CinemaService.Movies.texts", + "on": [ + { + "ref": ["localized", "ID"] + }, + "=", + { + "ref": ["ID"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "CinemaService.submitOrder": { + "kind": "action", + "@requires": "authenticated-user", + "params": { + "book": { + "type": { + "ref": ["CinemaService.Movies", "ID"] + } + }, + "quantity": { + "type": "cds.Integer" + } + } + }, + "CinemaService.MovieCreated": { + "kind": "event", + "elements": { + "ID": { + "type": "cds.Integer" + }, + "title": { + "@title": "Title", + "type": "cds.String" + } + } + }, + "CinemaService.MovieDeleted": { + "kind": "event", + "elements": { + "ID": { + "type": "cds.Integer" + } + } + }, + "CinemaService.MovieUpdated": { + "kind": "event", + "elements": { + "ID": { + "type": "cds.Integer" + }, + "title": { + "@title": "Title", + "type": "cds.String" + } + } + }, + "sap.capire.bookshop.Books": { + "kind": "entity", + "includes": ["managed"], + "elements": { + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "createdBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "modifiedAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@cds.on.update": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@cds.on.update": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "title": { + "localized": true, + "type": "cds.String", + "length": 111 + }, + "descr": { + "localized": true, + "type": "cds.String", + "length": 1111 + }, + "author": { + "type": "cds.Association", + "target": "sap.capire.bookshop.Authors", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "genre": { + "type": "cds.Association", + "target": "sap.capire.bookshop.Genres", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "stock": { + "type": "cds.Integer" + }, + "price": { + "type": "cds.Decimal", + "precision": 9, + "scale": 2 + }, + "currency": { + "@title": "{i18n>Currency}", + "@description": "{i18n>CurrencyCode.Description}", + "type": "Currency", + "target": "sap.common.Currencies", + "keys": [ + { + "ref": ["code"] + } + ] + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.capire.bookshop.Books.texts", + "on": [ + { + "ref": ["texts", "ID"] + }, + "=", + { + "ref": ["ID"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "sap.capire.bookshop.Books.texts", + "on": [ + { + "ref": ["localized", "ID"] + }, + "=", + { + "ref": ["ID"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "sap.capire.bookshop.Authors": { + "kind": "entity", + "@ODM.entityName": "odm.bookshop.Authors", + "includes": ["managed"], + "elements": { + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "createdBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "modifiedAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@cds.on.update": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@cds.on.update": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "name": { + "type": "cds.String", + "length": 111 + }, + "books": { + "type": "cds.Association", + "cardinality": { + "max": "*" + }, + "target": "sap.capire.bookshop.Books", + "on": [ + { + "ref": ["books", "author"] + }, + "=", + { + "ref": ["$self"] + } + ] + } + } + }, + "sap.capire.bookshop.Genres": { + "kind": "entity", + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "includes": ["sap.common.CodeList"], + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "parent": { + "type": "cds.Association", + "target": "sap.capire.bookshop.Genres", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "children": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.capire.bookshop.Genres", + "on": [ + { + "ref": ["children", "parent"] + }, + "=", + { + "ref": ["$self"] + } + ] + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.capire.bookshop.Genres.texts", + "on": [ + { + "ref": ["texts", "ID"] + }, + "=", + { + "ref": ["ID"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "sap.capire.bookshop.Genres.texts", + "on": [ + { + "ref": ["localized", "ID"] + }, + "=", + { + "ref": ["ID"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "sap.capire.bookshop.Movies": { + "kind": "entity", + "includes": ["managed"], + "elements": { + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "createdBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "modifiedAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@cds.on.update": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@cds.on.update": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "title": { + "localized": true, + "type": "cds.String", + "length": 111 + }, + "descr": { + "localized": true, + "type": "cds.String", + "length": 1111 + }, + "author": { + "type": "cds.Association", + "target": "sap.capire.bookshop.Authors", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "genre": { + "type": "cds.Association", + "target": "sap.capire.bookshop.Genres", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.capire.bookshop.Movies.texts", + "on": [ + { + "ref": ["texts", "ID"] + }, + "=", + { + "ref": ["ID"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "sap.capire.bookshop.Movies.texts", + "on": [ + { + "ref": ["localized", "ID"] + }, + "=", + { + "ref": ["ID"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "Language": { + "kind": "type", + "@title": "{i18n>Language}", + "@description": "{i18n>LanguageCode.Description}", + "type": "cds.Association", + "target": "sap.common.Languages", + "keys": [ + { + "ref": ["code"] + } + ] + }, + "Currency": { + "kind": "type", + "@title": "{i18n>Currency}", + "@description": "{i18n>CurrencyCode.Description}", + "type": "cds.Association", + "target": "sap.common.Currencies", + "keys": [ + { + "ref": ["code"] + } + ] + }, + "Country": { + "kind": "type", + "@title": "{i18n>Country}", + "@description": "{i18n>CountryCode.Description}", + "type": "cds.Association", + "target": "sap.common.Countries", + "keys": [ + { + "ref": ["code"] + } + ] + }, + "Timezone": { + "kind": "type", + "type": "cds.Association", + "target": "sap.common.Timezones", + "keys": [ + { + "ref": ["code"] + } + ] + }, + "sap.common": { + "kind": "context" + }, + "sap.common.Locale": { + "kind": "type", + "@title": "{i18n>LanguageCode}", + "type": "cds.String", + "length": 14 + }, + "sap.common.Languages": { + "kind": "entity", + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "includes": ["sap.common.CodeList"], + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@Common.Text": { + "=": "name" + }, + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.common.Languages.texts", + "on": [ + { + "ref": ["texts", "code"] + }, + "=", + { + "ref": ["code"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "sap.common.Languages.texts", + "on": [ + { + "ref": ["localized", "code"] + }, + "=", + { + "ref": ["code"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "sap.common.Countries": { + "kind": "entity", + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "includes": ["sap.common.CodeList"], + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@title": "{i18n>CountryCode}", + "@Common.Text": { + "=": "name" + }, + "key": true, + "type": "cds.String", + "length": 3 + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.common.Countries.texts", + "on": [ + { + "ref": ["texts", "code"] + }, + "=", + { + "ref": ["code"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "sap.common.Countries.texts", + "on": [ + { + "ref": ["localized", "code"] + }, + "=", + { + "ref": ["code"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "sap.common.Currencies": { + "kind": "entity", + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "includes": ["sap.common.CodeList"], + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@title": "{i18n>CurrencyCode}", + "@Common.Text": { + "=": "name" + }, + "key": true, + "type": "cds.String", + "length": 3 + }, + "symbol": { + "@title": "{i18n>CurrencySymbol}", + "type": "cds.String", + "length": 5 + }, + "minorUnit": { + "@title": "{i18n>CurrencyMinorUnit}", + "type": "cds.Int16" + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.common.Currencies.texts", + "on": [ + { + "ref": ["texts", "code"] + }, + "=", + { + "ref": ["code"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "sap.common.Currencies.texts", + "on": [ + { + "ref": ["localized", "code"] + }, + "=", + { + "ref": ["code"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "sap.common.Timezones": { + "kind": "entity", + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "includes": ["sap.common.CodeList"], + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@title": "{i18n>TimeZoneCode}", + "key": true, + "type": "cds.String", + "length": 100 + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.common.Timezones.texts", + "on": [ + { + "ref": ["texts", "code"] + }, + "=", + { + "ref": ["code"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "sap.common.Timezones.texts", + "on": [ + { + "ref": ["localized", "code"] + }, + "=", + { + "ref": ["code"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "sap.common.CodeList": { + "kind": "aspect", + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + } + } + }, + "sap.common.TextsAspect": { + "kind": "aspect", + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + } + } + }, + "cuid": { + "kind": "aspect", + "elements": { + "ID": { + "key": true, + "type": "cds.UUID" + } + } + }, + "managed": { + "kind": "aspect", + "elements": { + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "createdBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "modifiedAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@cds.on.update": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@cds.on.update": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@UI.ExcludeFromNavigationContext": true, + "@title": "{i18n>ChangedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + } + } + }, + "temporal": { + "kind": "aspect", + "elements": { + "validFrom": { + "@cds.valid.from": true, + "type": "cds.Timestamp" + }, + "validTo": { + "@cds.valid.to": true, + "type": "cds.Timestamp" + } + } + }, + "User": { + "kind": "type", + "@title": "{i18n>UserID}", + "@description": "{i18n>UserID.Description}", + "type": "cds.String", + "length": 255 + }, + "sap.capire.bookshop.Books.texts": { + "kind": "entity", + "@odata.draft.enabled": false, + "includes": ["sap.common.TextsAspect"], + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "ID": { + "@odata.containment.ignore": true, + "key": true, + "type": "cds.Integer" + }, + "title": { + "localized": null, + "type": "cds.String", + "length": 111 + }, + "descr": { + "localized": null, + "type": "cds.String", + "length": 1111 + } + } + }, + "sap.capire.bookshop.Genres.texts": { + "kind": "entity", + "@odata.draft.enabled": false, + "includes": ["sap.common.TextsAspect"], + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "name": { + "@title": "{i18n>Name}", + "localized": null, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": null, + "type": "cds.String", + "length": 1000 + }, + "ID": { + "@odata.containment.ignore": true, + "key": true, + "type": "cds.Integer" + } + } + }, + "sap.capire.bookshop.Movies.texts": { + "kind": "entity", + "@odata.draft.enabled": false, + "includes": ["sap.common.TextsAspect"], + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "ID": { + "@odata.containment.ignore": true, + "key": true, + "type": "cds.Integer" + }, + "title": { + "localized": null, + "type": "cds.String", + "length": 111 + }, + "descr": { + "localized": null, + "type": "cds.String", + "length": 1111 + } + } + }, + "sap.common.Languages.texts": { + "kind": "entity", + "@odata.draft.enabled": false, + "includes": ["sap.common.TextsAspect"], + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "name": { + "@title": "{i18n>Name}", + "localized": null, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": null, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@odata.containment.ignore": true, + "@Common.Text": { + "=": "name" + }, + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + } + } + }, + "sap.common.Countries.texts": { + "kind": "entity", + "@odata.draft.enabled": false, + "includes": ["sap.common.TextsAspect"], + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "name": { + "@title": "{i18n>Name}", + "localized": null, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": null, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@odata.containment.ignore": true, + "@title": "{i18n>CountryCode}", + "@Common.Text": { + "=": "name" + }, + "key": true, + "type": "cds.String", + "length": 3 + } + } + }, + "sap.common.Currencies.texts": { + "kind": "entity", + "@odata.draft.enabled": false, + "includes": ["sap.common.TextsAspect"], + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "name": { + "@title": "{i18n>Name}", + "localized": null, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": null, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@odata.containment.ignore": true, + "@title": "{i18n>CurrencyCode}", + "@Common.Text": { + "=": "name" + }, + "key": true, + "type": "cds.String", + "length": 3 + } + } + }, + "sap.common.Timezones.texts": { + "kind": "entity", + "@odata.draft.enabled": false, + "includes": ["sap.common.TextsAspect"], + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "name": { + "@title": "{i18n>Name}", + "localized": null, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": null, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@odata.containment.ignore": true, + "@title": "{i18n>TimeZoneCode}", + "key": true, + "type": "cds.String", + "length": 100 + } + } + }, + "AdminService.Genres": { + "kind": "entity", + "@cds.autoexposed": true, + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Genres"] + } + }, + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "parent": { + "type": "cds.Association", + "target": "AdminService.Genres", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "children": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "AdminService.Genres", + "on": [ + { + "ref": ["children", "parent"] + }, + "=", + { + "ref": ["$self"] + } + ] + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "AdminService.Genres.texts", + "on": [ + { + "ref": ["texts", "ID"] + }, + "=", + { + "ref": ["ID"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "AdminService.Genres.texts", + "on": [ + { + "ref": ["localized", "ID"] + }, + "=", + { + "ref": ["ID"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "AdminService.Currencies": { + "kind": "entity", + "@cds.autoexposed": true, + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "projection": { + "from": { + "ref": ["sap.common.Currencies"] + } + }, + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@title": "{i18n>CurrencyCode}", + "@Common.Text": { + "=": "name" + }, + "key": true, + "type": "cds.String", + "length": 3 + }, + "symbol": { + "@title": "{i18n>CurrencySymbol}", + "type": "cds.String", + "length": 5 + }, + "minorUnit": { + "@title": "{i18n>CurrencyMinorUnit}", + "type": "cds.Int16" + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "AdminService.Currencies.texts", + "on": [ + { + "ref": ["texts", "code"] + }, + "=", + { + "ref": ["code"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "AdminService.Currencies.texts", + "on": [ + { + "ref": ["localized", "code"] + }, + "=", + { + "ref": ["code"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "AdminService.Books.texts": { + "kind": "entity", + "@cds.autoexposed": true, + "@odata.draft.enabled": false, + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Books.texts"] + } + }, + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "ID": { + "@odata.containment.ignore": true, + "key": true, + "type": "cds.Integer" + }, + "title": { + "localized": null, + "type": "cds.String", + "length": 111 + }, + "descr": { + "localized": null, + "type": "cds.String", + "length": 1111 + } + } + }, + "CatalogService.Genres": { + "kind": "entity", + "@cds.autoexposed": true, + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Genres"] + } + }, + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "parent": { + "type": "cds.Association", + "target": "CatalogService.Genres", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "children": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "CatalogService.Genres", + "on": [ + { + "ref": ["children", "parent"] + }, + "=", + { + "ref": ["$self"] + } + ] + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "CatalogService.Genres.texts", + "on": [ + { + "ref": ["texts", "ID"] + }, + "=", + { + "ref": ["ID"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "CatalogService.Genres.texts", + "on": [ + { + "ref": ["localized", "ID"] + }, + "=", + { + "ref": ["ID"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "CatalogService.Currencies": { + "kind": "entity", + "@cds.autoexposed": true, + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "projection": { + "from": { + "ref": ["sap.common.Currencies"] + } + }, + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@title": "{i18n>CurrencyCode}", + "@Common.Text": { + "=": "name" + }, + "key": true, + "type": "cds.String", + "length": 3 + }, + "symbol": { + "@title": "{i18n>CurrencySymbol}", + "type": "cds.String", + "length": 5 + }, + "minorUnit": { + "@title": "{i18n>CurrencyMinorUnit}", + "type": "cds.Int16" + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "CatalogService.Currencies.texts", + "on": [ + { + "ref": ["texts", "code"] + }, + "=", + { + "ref": ["code"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "CatalogService.Currencies.texts", + "on": [ + { + "ref": ["localized", "code"] + }, + "=", + { + "ref": ["code"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "CatalogService.Books.texts": { + "kind": "entity", + "@cds.autoexposed": true, + "@odata.draft.enabled": false, + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Books.texts"] + } + }, + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "ID": { + "@odata.containment.ignore": true, + "key": true, + "type": "cds.Integer" + }, + "title": { + "localized": null, + "type": "cds.String", + "length": 111 + }, + "descr": { + "localized": null, + "type": "cds.String", + "length": 1111 + } + } + }, + "CinemaService.Genres": { + "kind": "entity", + "@cds.autoexposed": true, + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Genres"] + } + }, + "elements": { + "name": { + "@title": "{i18n>Name}", + "localized": true, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": true, + "type": "cds.String", + "length": 1000 + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "parent": { + "type": "cds.Association", + "target": "CinemaService.Genres", + "keys": [ + { + "ref": ["ID"] + } + ] + }, + "children": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "CinemaService.Genres", + "on": [ + { + "ref": ["children", "parent"] + }, + "=", + { + "ref": ["$self"] + } + ] + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "CinemaService.Genres.texts", + "on": [ + { + "ref": ["texts", "ID"] + }, + "=", + { + "ref": ["ID"] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "CinemaService.Genres.texts", + "on": [ + { + "ref": ["localized", "ID"] + }, + "=", + { + "ref": ["ID"] + }, + "and", + { + "ref": ["localized", "locale"] + }, + "=", + { + "ref": ["$user", "locale"] + } + ] + } + } + }, + "CinemaService.Movies.texts": { + "kind": "entity", + "@cds.autoexposed": true, + "@odata.draft.enabled": false, + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Movies.texts"] + } + }, + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "ID": { + "@odata.containment.ignore": true, + "key": true, + "type": "cds.Integer" + }, + "title": { + "localized": null, + "type": "cds.String", + "length": 111 + }, + "descr": { + "localized": null, + "type": "cds.String", + "length": 1111 + } + } + }, + "AdminService.Genres.texts": { + "kind": "entity", + "@cds.autoexposed": true, + "@odata.draft.enabled": false, + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Genres.texts"] + } + }, + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "name": { + "@title": "{i18n>Name}", + "localized": null, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": null, + "type": "cds.String", + "length": 1000 + }, + "ID": { + "@odata.containment.ignore": true, + "key": true, + "type": "cds.Integer" + } + } + }, + "AdminService.Currencies.texts": { + "kind": "entity", + "@cds.autoexposed": true, + "@odata.draft.enabled": false, + "projection": { + "from": { + "ref": ["sap.common.Currencies.texts"] + } + }, + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "name": { + "@title": "{i18n>Name}", + "localized": null, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": null, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@odata.containment.ignore": true, + "@title": "{i18n>CurrencyCode}", + "@Common.Text": { + "=": "name" + }, + "key": true, + "type": "cds.String", + "length": 3 + } + } + }, + "CatalogService.Genres.texts": { + "kind": "entity", + "@cds.autoexposed": true, + "@odata.draft.enabled": false, + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Genres.texts"] + } + }, + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "name": { + "@title": "{i18n>Name}", + "localized": null, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": null, + "type": "cds.String", + "length": 1000 + }, + "ID": { + "@odata.containment.ignore": true, + "key": true, + "type": "cds.Integer" + } + } + }, + "CatalogService.Currencies.texts": { + "kind": "entity", + "@cds.autoexposed": true, + "@odata.draft.enabled": false, + "projection": { + "from": { + "ref": ["sap.common.Currencies.texts"] + } + }, + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "name": { + "@title": "{i18n>Name}", + "localized": null, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": null, + "type": "cds.String", + "length": 1000 + }, + "code": { + "@odata.containment.ignore": true, + "@title": "{i18n>CurrencyCode}", + "@Common.Text": { + "=": "name" + }, + "key": true, + "type": "cds.String", + "length": 3 + } + } + }, + "CinemaService.Genres.texts": { + "kind": "entity", + "@cds.autoexposed": true, + "@odata.draft.enabled": false, + "projection": { + "from": { + "ref": ["sap.capire.bookshop.Genres.texts"] + } + }, + "elements": { + "locale": { + "@title": "{i18n>LanguageCode}", + "key": true, + "type": "sap.common.Locale", + "length": 14 + }, + "name": { + "@title": "{i18n>Name}", + "localized": null, + "type": "cds.String", + "length": 255 + }, + "descr": { + "@title": "{i18n>Description}", + "localized": null, + "type": "cds.String", + "length": 1000 + }, + "ID": { + "@odata.containment.ignore": true, + "key": true, + "type": "cds.Integer" + } + } + } + }, + "meta": { + "creator": "CDS Compiler v5.2.0", + "flavor": "inferred" + }, + "$version": "2.0" +} diff --git a/__tests__/__snapshots__/noOrdInCdsrc.test.js.snap b/__tests__/__snapshots__/noOrdInCdsrc.test.js.snap new file mode 100644 index 0000000..5afac3e --- /dev/null +++ b/__tests__/__snapshots__/noOrdInCdsrc.test.js.snap @@ -0,0 +1,310 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Tests for ORD document when .cdsrc.json has no \`ord\` property Successfully create ORD Documents with no \`ord\` in .cdsrc.json 1`] = ` +{ + "$schema": "https://sap.github.io/open-resource-discovery/spec-v1/interfaces/Document.schema.json", + "apiResources": [ + { + "apiProtocol": "odata-v4", + "description": "Description for AdminService", + "entityTypeMappings": { + "entityTypeTargets": [ + { + "ordId": "sap.odm:entityType:test-from-extension:v1", + }, + ], + }, + "entryPoints": [ + "/odata/v4/admin", + ], + "extensible": { + "supported": "yes", + }, + "lastUpdate": "2024-11-04T14:33:25+01:00", + "ordId": "customer.capirebookshopordsample:apiResource:AdminService:v1", + "partOfGroups": [ + "sap.cds:service:customer.capirebookshopordsample:AdminService", + ], + "partOfPackage": "customer.capirebookshopordsample:package:capirebookshopordsample:v1", + "releaseStatus": "active", + "resourceDefinitions": [ + { + "accessStrategies": [ + { + "type": "open", + }, + ], + "mediaType": "application/json", + "type": "openapi-v3", + "url": "/.well-known/open-resource-discovery/v1/api-metadata/AdminService.oas3.json", + }, + { + "accessStrategies": [ + { + "type": "open", + }, + ], + "mediaType": "application/xml", + "type": "edmx", + "url": "/.well-known/open-resource-discovery/v1/api-metadata/AdminService.edmx", + }, + ], + "shortDescription": "short description for test AdminService", + "title": "This is test AdminService title", + "version": "2.0.0", + "visibility": "public", + }, + { + "apiProtocol": "odata-v4", + "description": "Description for CatalogService", + "entityTypeMappings": [ + { + "entityTypeTargets": [ + { + "ordId": "sap.odm:entityType:odm.bookshop.Authors:v1", + }, + ], + }, + ], + "entryPoints": [ + "/browse", + ], + "extensible": { + "supported": "yes", + }, + "lastUpdate": "2024-11-04T14:33:25+01:00", + "ordId": "customer.capirebookshopordsample:apiResource:CatalogService:v1", + "partOfGroups": [ + "sap.cds:service:customer.capirebookshopordsample:CatalogService", + ], + "partOfPackage": "customer.capirebookshopordsample:package:capirebookshopordsample:v1", + "releaseStatus": "active", + "resourceDefinitions": [ + { + "accessStrategies": [ + { + "type": "open", + }, + ], + "mediaType": "application/json", + "type": "openapi-v3", + "url": "/.well-known/open-resource-discovery/v1/api-metadata/CatalogService.oas3.json", + }, + { + "accessStrategies": [ + { + "type": "open", + }, + ], + "mediaType": "application/xml", + "type": "edmx", + "url": "/.well-known/open-resource-discovery/v1/api-metadata/CatalogService.edmx", + }, + ], + "shortDescription": "short description for test CatalogService", + "title": "This is test Catalog Service title", + "version": "2.0.0", + "visibility": "public", + }, + { + "apiProtocol": "odata-v4", + "description": "Description for CinemaService", + "entityTypeMappings": [ + { + "entityTypeTargets": [ + { + "ordId": "sap.odm:entityType:odm.bookshop.Authors:v1", + }, + ], + }, + ], + "entryPoints": [ + "/browse", + ], + "extensible": { + "supported": "yes", + }, + "lastUpdate": "2024-11-04T14:33:25+01:00", + "ordId": "customer.capirebookshopordsample:apiResource:CinemaService:v1", + "partOfGroups": [ + "sap.cds:service:customer.capirebookshopordsample:CinemaService", + ], + "partOfPackage": "customer.capirebookshopordsample:package:capirebookshopordsample:v1", + "releaseStatus": "active", + "resourceDefinitions": [ + { + "accessStrategies": [ + { + "type": "open", + }, + ], + "mediaType": "application/json", + "type": "openapi-v3", + "url": "/.well-known/open-resource-discovery/v1/api-metadata/CinemaService.oas3.json", + }, + { + "accessStrategies": [ + { + "type": "open", + }, + ], + "mediaType": "application/xml", + "type": "edmx", + "url": "/.well-known/open-resource-discovery/v1/api-metadata/CinemaService.edmx", + }, + ], + "shortDescription": "short description for test CinemaService", + "title": "This is test Cinema Service title", + "version": "1.0.0", + "visibility": "public", + }, + ], + "consumptionBundles": [ + { + "description": "This Consumption Bundle contains all resources of the reference app which are unprotected and do not require authentication", + "lastUpdate": "2024-11-04T14:33:25+01:00", + "ordId": "capirebookshopordsample:consumptionBundle:noAuth:v1", + "shortDescription": "If we have another protected API then it will be another object", + "title": "Unprotected resources", + "version": "1.0.0", + }, + ], + "description": "this is an application description", + "eventResources": [ + { + "description": "CAP Event resource describing events / messages.", + "entityTypeMappings": { + "entityTypeTargets": [ + { + "ordId": "sap.odm:entityType:test-from-extension:v1", + }, + ], + }, + "extensible": { + "supported": "yes", + }, + "lastUpdate": "2024-11-04T14:33:25+01:00", + "ordId": "customer.capirebookshopordsample:eventResource:AdminService:v1", + "partOfGroups": [ + "sap.cds:service:customer.capirebookshopordsample:AdminService", + ], + "partOfPackage": "customer.capirebookshopordsample:package:capirebookshopordsample:v1", + "releaseStatus": "active", + "resourceDefinitions": [ + { + "accessStrategies": [ + { + "type": "open", + }, + ], + "mediaType": "application/json", + "type": "asyncapi-v2", + "url": "/.well-known/open-resource-discovery/v1/api-metadata/AdminService.asyncapi2.json", + }, + ], + "shortDescription": "short description for test AdminService", + "title": "This is test AdminService title", + "version": "2.0.0", + "visibility": "public", + }, + { + "description": "CAP Event resource describing events / messages.", + "extensible": { + "supported": "yes", + }, + "lastUpdate": "2024-11-04T14:33:25+01:00", + "ordId": "customer.capirebookshopordsample:eventResource:CatalogService:v1", + "partOfGroups": [ + "sap.cds:service:customer.capirebookshopordsample:CatalogService", + ], + "partOfPackage": "customer.capirebookshopordsample:package:capirebookshopordsample:v1", + "releaseStatus": "active", + "resourceDefinitions": [ + { + "accessStrategies": [ + { + "type": "open", + }, + ], + "mediaType": "application/json", + "type": "asyncapi-v2", + "url": "/.well-known/open-resource-discovery/v1/api-metadata/CatalogService.asyncapi2.json", + }, + ], + "shortDescription": "short description for test CatalogService", + "title": "This is test Catalog Service title", + "version": "2.0.0", + "visibility": "public", + }, + { + "description": "CAP Event resource describing events / messages.", + "extensible": { + "supported": "yes", + }, + "lastUpdate": "2024-11-04T14:33:25+01:00", + "ordId": "customer.capirebookshopordsample:eventResource:CinemaService:v1", + "partOfGroups": [ + "sap.cds:service:customer.capirebookshopordsample:CinemaService", + ], + "partOfPackage": "customer.capirebookshopordsample:package:capirebookshopordsample:v1", + "releaseStatus": "active", + "resourceDefinitions": [ + { + "accessStrategies": [ + { + "type": "open", + }, + ], + "mediaType": "application/json", + "type": "asyncapi-v2", + "url": "/.well-known/open-resource-discovery/v1/api-metadata/CinemaService.asyncapi2.json", + }, + ], + "shortDescription": "short description for test CinemaService", + "title": "This is test Cinema Service title", + "version": "1.0.0", + "visibility": "public", + }, + ], + "groups": [ + { + "groupId": "sap.cds:service:customer.capirebookshopordsample:AdminService", + "groupTypeId": "sap.cds:service", + "title": "This is test AdminService title", + }, + { + "groupId": "sap.cds:service:customer.capirebookshopordsample:CatalogService", + "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": [ + { + "description": "Description for capire bookshop ord sample", + "ordId": "customer.capirebookshopordsample:package:capirebookshopordsample:v1", + "partOfProducts": [ + "customer:product:capire.bookshop.ord.sample:", + ], + "shortDescription": "Short description for capire bookshop ord sample", + "title": "capire bookshop ord sample", + "vendor": "customer:vendor:Customer:", + "version": "1.0.0", + }, + ], + "policyLevel": "none", + "products": [ + { + "ordId": "customer:product:capire.bookshop.ord.sample:", + "shortDescription": "Description for capire bookshop ord sample", + "title": "capire bookshop ord sample", + "vendor": "customer:vendor:customer:", + }, + ], +} +`; diff --git a/__tests__/noOrdInCdsrc.test.js b/__tests__/noOrdInCdsrc.test.js new file mode 100644 index 0000000..a327140 --- /dev/null +++ b/__tests__/noOrdInCdsrc.test.js @@ -0,0 +1,26 @@ +const cds = require("@sap/cds"); +const ord = require("../lib/ord"); +const path = require("path"); +const csn = require("./__mocks__/publicResourcesCsn.json"); + +jest.mock("../lib/date", () => ({ + getRFC3339Date: jest.fn(() => "2024-11-04T14:33:25+01:00") +})); + +describe("Tests for ORD document when .cdsrc.json has no `ord` property", () => { + beforeAll(() => { + cds.root = path.join(__dirname, "bookshop"); + cds.env = {}; + }); + + afterAll(() => { + jest.clearAllMocks(); + }); + + test("Successfully create ORD Documents with no `ord` in .cdsrc.json", () => { + + const document = ord(csn); + expect(document).not.toBeUndefined(); + expect(document).toMatchSnapshot(); + }); +}); diff --git a/__tests__/ordCdsrc.test.js b/__tests__/ordCdsrc.test.js index dbf2e0e..3722e25 100644 --- a/__tests__/ordCdsrc.test.js +++ b/__tests__/ordCdsrc.test.js @@ -5,9 +5,10 @@ const path = require("path"); // Mock the @sap/cds module jest.mock("@sap/cds", () => { const path = require("path"); - let originalCds = jest.requireActual("@sap/cds"); - originalCds.root = path.join(__dirname, "bookshop"); - return originalCds; + let cds = jest.requireActual("@sap/cds"); + cds.root = path.join(__dirname, "bookshop"); + + return cds; }); jest.mock("../lib/date", () => ({ @@ -19,7 +20,7 @@ describe("Tests for default ORD document when .cdsrc.json is present", () => { let csn; beforeAll(async () => { - csn = await cds.load(path.join(__dirname, "bookshop", "srv")); + csn = await cds.load(path.join(cds.root, "srv")); }); test("Successfully create ORD Documents with defaults", () => { diff --git a/__tests__/ordPackageJson.test.js b/__tests__/ordPackageJson.test.js index 0b0558d..867cfee 100644 --- a/__tests__/ordPackageJson.test.js +++ b/__tests__/ordPackageJson.test.js @@ -2,15 +2,6 @@ const cds = require("@sap/cds"); const ord = require("../lib/ord"); const path = require("path"); - -// Mock the @sap/cds module -jest.mock("@sap/cds", () => { - const path = require("path"); - let originalCds = jest.requireActual("@sap/cds"); - originalCds.root = path.join(__dirname, "bookshop"); - return originalCds; -}); - jest.mock("../lib/date", () => ({ getRFC3339Date: jest.fn(() => "2024-11-04T14:33:25+01:00") })); @@ -19,9 +10,11 @@ describe("Tests for default ORD document when .cdsrc.json is not present", () => let csn; beforeAll(async () => { - cds.env["ord"] = ""; csn = await cds.load(path.join(__dirname, "bookshop", "srv")); + }); + beforeEach(() => { + cds.root = path.join(__dirname, "bookshop"); }); test("Successfully create ORD Documents with defaults", () => { diff --git a/__tests__/protectedServices.test.js b/__tests__/protectedServices.test.js new file mode 100644 index 0000000..67424a1 --- /dev/null +++ b/__tests__/protectedServices.test.js @@ -0,0 +1,43 @@ +const cds = require("@sap/cds"); +const internal_csn = require("./__mocks__/internalResourcesCsn.json"); +const ord = require("../lib/ord"); +const path = require("path"); +const private_csn = require("./__mocks__/privateResourcesCsn.json"); + +function checkOrdDocument(csn) { + const document = ord(csn); + + expect(document).not.toBeUndefined(); + expect(document.packages).not.toBeDefined(); + expect(document.apiResources).toHaveLength(0); + expect(document.eventResources).toHaveLength(0); +} + + +jest.mock("../lib/date", () => ({ + getRFC3339Date: jest.fn(() => "2024-11-04T14:33:25+01:00") +})); + +describe("Tests for ORD document when there is no public service", () => { + beforeAll(() => { + cds.root = path.join(__dirname, "bookshop"); + cds.env.ord = { + namespace: "sap.test.cdsrc.sample", + openResourceDiscovery: "1.10", + description: "this is my custom description", + policyLevel: "sap:core:v1" + }; + }); + + afterAll(() => { + jest.clearAllMocks(); + }); + + test("All services are private: Successfully create ORD Documents without packages, empty apiResources and eventResources lists", () => { + checkOrdDocument(private_csn); + }); + + test("All services are internal: Successfully create ORD Documents without packages, empty apiResources and eventResources lists", () => { + checkOrdDocument(internal_csn); + }); +}); diff --git a/lib/extendOrdWithCustom.js b/lib/extendOrdWithCustom.js index 981d5c2..bbdd16c 100644 --- a/lib/extendOrdWithCustom.js +++ b/lib/extendOrdWithCustom.js @@ -47,11 +47,12 @@ function compareAndHandleCustomORDContentWithExistingContent(ordContent, customO } function getCustomORDContent(appConfig) { + let customORDContent; + if (appConfig.env?.customOrdContentFile) { - const customORDContent = require(path.join(cds.root, appConfig.env.customOrdContentFile)); - return customORDContent; + customORDContent = require(path.join(cds.root, appConfig.env.customOrdContentFile)); } - return {}; + return customORDContent; } function extendCustomORDContentIfExists(appConfig, ordContent, logger) { diff --git a/lib/ord.js b/lib/ord.js index 9fe8f0d..760c63b 100644 --- a/lib/ord.js +++ b/lib/ord.js @@ -160,13 +160,8 @@ module.exports = (csn) => { let ordDocument = createDefaultORDDocument(linkedCsn, appConfig); const packageIds = extractPackageIds(ordDocument); - // TODO: add testcase without apiResources or event, no empty package ordDocument.apiResources = _getAPIResources(linkedCsn, appConfig, packageIds); - const eventResources = _getEventResources(linkedCsn, appConfig, packageIds); - if (eventResources.length) { - ordDocument.eventResources = eventResources; - } - + ordDocument.eventResources = _getEventResources(linkedCsn, appConfig, packageIds); ordDocument = extendCustomORDContentIfExists(appConfig, ordDocument, logger); return ordDocument;