From 692ea3ddd2e1b271c67a6d1df8ee4e74f943f6a7 Mon Sep 17 00:00:00 2001 From: Christian Georgi Date: Mon, 25 Jul 2022 17:36:17 +0200 Subject: [PATCH] Fiori extension project --- .gitignore | 5 + fiori-ext/README.md | 22 + fiori-ext/app/extension.cds | 31 + fiori-ext/app/i18n/i18n.properties | 2 + .../node_modules/@capire/fiori/index.csn | 4369 +++++++++++++++++ fiori-ext/package.json | 45 + .../Z_bookshop.extension-Z_SalesRegion.csv | 4 + .../test/data/sap.capire.orders-Orders.csv | 3 + 8 files changed, 4481 insertions(+) create mode 100644 fiori-ext/README.md create mode 100644 fiori-ext/app/extension.cds create mode 100644 fiori-ext/app/i18n/i18n.properties create mode 100644 fiori-ext/node_modules/@capire/fiori/index.csn create mode 100644 fiori-ext/package.json create mode 100644 fiori-ext/test/data/Z_bookshop.extension-Z_SalesRegion.csv create mode 100644 fiori-ext/test/data/sap.capire.orders-Orders.csv diff --git a/.gitignore b/.gitignore index 9f14d60b..2c04c25c 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,8 @@ reviews/msg-box reviews/db/test.db *.openapi3.json +*.db + +!fiori-ext/node_modules/ +!fiori-ext/node_modules/@capire/ +!fiori-ext/node_modules/@capire/fiori/ diff --git a/fiori-ext/README.md b/fiori-ext/README.md new file mode 100644 index 00000000..dfa00377 --- /dev/null +++ b/fiori-ext/README.md @@ -0,0 +1,22 @@ +# Welcome to your Extension Project for the CAP Bookshop Fiori App + +It contains these folders and files, following our recommended project layout: + +File or Folder | Purpose +---------|---------- +`app/` | content for UI frontends goes here +`db/` | your domain models and data go here +`srv/` | your service models and code go here +`package.json` | project metadata and configuration +`readme.md` | this getting started guide + + +## Next Steps + +- Runs `cds login ...` +- Runs `cds pull ...` + + +## Learn More + +Learn more at https://cap.cloud.sap/docs/get-started/. diff --git a/fiori-ext/app/extension.cds b/fiori-ext/app/extension.cds new file mode 100644 index 00000000..5579bfff --- /dev/null +++ b/fiori-ext/app/extension.cds @@ -0,0 +1,31 @@ +using { sap.capire.orders, OrdersService, sap.common } from '@capire/fiori'; +// using { sap.common } from '@sap/cds/common'; //> TODO this creates duplicated definitions + +namespace Z_bookshop.extension; + +extend orders.Orders with { + Z_priority : String @assert.range enum {high; medium; low} default 'medium' ; + Z_SalesRegion : Association to Z_SalesRegion; +} + +entity Z_SalesRegion: common.CodeList { + key regionCode : String(11); +} + + +// --- UI --- + +annotate orders.Orders with { + Z_priority @title : '{i18n>Orders_priority_col}' +}; + +annotate Z_SalesRegion with { + name @title : '{i18n>SalesRegion_name_col}' +}; + +annotate OrdersService.Orders with @UI.LineItem : [ + ... up to { Value: OrderNo }, + { Value : Z_priority }, + { Value : Z_SalesRegion.name }, + ... +]; diff --git a/fiori-ext/app/i18n/i18n.properties b/fiori-ext/app/i18n/i18n.properties new file mode 100644 index 00000000..d5e4c2ca --- /dev/null +++ b/fiori-ext/app/i18n/i18n.properties @@ -0,0 +1,2 @@ +SalesRegion_name_col = Sales Region +Orders_priority_col = Priority diff --git a/fiori-ext/node_modules/@capire/fiori/index.csn b/fiori-ext/node_modules/@capire/fiori/index.csn new file mode 100644 index 00000000..9f31d76e --- /dev/null +++ b/fiori-ext/node_modules/@capire/fiori/index.csn @@ -0,0 +1,4369 @@ +{ + "definitions": { + "sap.capire.bookshop.GenreHierarchy": { + "kind": "entity", + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "includes": [ + "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" + }, + "hierarchyLevel": { + "type": "cds.Integer", + "default": { + "val": 0 + } + }, + "drillState": { + "type": "cds.String", + "default": { + "val": "leaf" + } + }, + "parent": { + "type": "cds.Association", + "target": "sap.capire.bookshop.GenreHierarchy", + "keys": [ + { + "ref": [ + "ID" + ] + } + ] + }, + "children": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.capire.bookshop.GenreHierarchy", + "on": [ + { + "ref": [ + "children", + "parent" + ] + }, + "=", + { + "ref": [ + "$self" + ] + } + ] + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.capire.bookshop.GenreHierarchy.texts", + "on": [ + { + "ref": [ + "texts", + "ID" + ] + }, + "=", + { + "ref": [ + "ID" + ] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "sap.capire.bookshop.GenreHierarchy.texts", + "on": [ + { + "ref": [ + "localized", + "ID" + ] + }, + "=", + { + "ref": [ + "ID" + ] + }, + "and", + { + "ref": [ + "localized", + "locale" + ] + }, + "=", + { + "ref": [ + "$user", + "locale" + ] + } + ] + } + } + }, + "CatalogService.GenreHierarchy": { + "kind": "entity", + "@readonly": true, + "@cds.autoexpose": true, + "@cds.persistence.skip": "if-unused", + "@UI.Identification": [ + { + "Value": { + "=": "name" + } + } + ], + "@cds.odata.valuelist": true, + "projection": { + "from": { + "ref": [ + "sap.capire.bookshop.GenreHierarchy" + ] + } + }, + "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" + }, + "hierarchyLevel": { + "type": "cds.Integer", + "default": { + "val": 0 + } + }, + "drillState": { + "type": "cds.String", + "default": { + "val": "leaf" + } + }, + "parent": { + "type": "cds.Association", + "target": "CatalogService.GenreHierarchy", + "keys": [ + { + "ref": [ + "ID" + ] + } + ] + }, + "children": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "CatalogService.GenreHierarchy", + "on": [ + { + "ref": [ + "children", + "parent" + ] + }, + "=", + { + "ref": [ + "$self" + ] + } + ] + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "CatalogService.GenreHierarchy.texts", + "on": [ + { + "ref": [ + "texts", + "ID" + ] + }, + "=", + { + "ref": [ + "ID" + ] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "CatalogService.GenreHierarchy.texts", + "on": [ + { + "ref": [ + "localized", + "ID" + ] + }, + "=", + { + "ref": [ + "ID" + ] + }, + "and", + { + "ref": [ + "localized", + "locale" + ] + }, + "=", + { + "ref": [ + "$user", + "locale" + ] + } + ] + } + } + }, + "sap.common.countries": { + "kind": "context" + }, + "sap.common.countries.Regions": { + "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": { + "key": true, + "type": "cds.String", + "length": 5 + }, + "children": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.common.countries.Regions", + "on": [ + { + "ref": [ + "children", + "_parent" + ] + }, + "=", + { + "ref": [ + "$self", + "code" + ] + } + ] + }, + "cities": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.common.countries.Cities", + "on": [ + { + "ref": [ + "cities", + "region" + ] + }, + "=", + { + "ref": [ + "$self" + ] + } + ] + }, + "_parent": { + "type": "cds.String", + "length": 11 + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.common.countries.Regions.texts", + "on": [ + { + "ref": [ + "texts", + "code" + ] + }, + "=", + { + "ref": [ + "code" + ] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "sap.common.countries.Regions.texts", + "on": [ + { + "ref": [ + "localized", + "code" + ] + }, + "=", + { + "ref": [ + "code" + ] + }, + "and", + { + "ref": [ + "localized", + "locale" + ] + }, + "=", + { + "ref": [ + "$user", + "locale" + ] + } + ] + } + } + }, + "sap.common.countries.Cities": { + "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": { + "key": true, + "type": "cds.String", + "length": 11 + }, + "region": { + "type": "cds.Association", + "target": "sap.common.countries.Regions", + "keys": [ + { + "ref": [ + "code" + ] + } + ] + }, + "districts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.common.countries.Districts", + "on": [ + { + "ref": [ + "districts", + "city" + ] + }, + "=", + { + "ref": [ + "$self" + ] + } + ] + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.common.countries.Cities.texts", + "on": [ + { + "ref": [ + "texts", + "code" + ] + }, + "=", + { + "ref": [ + "code" + ] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "sap.common.countries.Cities.texts", + "on": [ + { + "ref": [ + "localized", + "code" + ] + }, + "=", + { + "ref": [ + "code" + ] + }, + "and", + { + "ref": [ + "localized", + "locale" + ] + }, + "=", + { + "ref": [ + "$user", + "locale" + ] + } + ] + } + } + }, + "sap.common.countries.Districts": { + "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": { + "key": true, + "type": "cds.String", + "length": 11 + }, + "city": { + "type": "cds.Association", + "target": "sap.common.countries.Cities", + "keys": [ + { + "ref": [ + "code" + ] + } + ] + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.common.countries.Districts.texts", + "on": [ + { + "ref": [ + "texts", + "code" + ] + }, + "=", + { + "ref": [ + "code" + ] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "sap.common.countries.Districts.texts", + "on": [ + { + "ref": [ + "localized", + "code" + ] + }, + "=", + { + "ref": [ + "code" + ] + }, + "and", + { + "ref": [ + "localized", + "locale" + ] + }, + "=", + { + "ref": [ + "$user", + "locale" + ] + } + ] + } + } + }, + "sap.capire.bookshop.Books": { + "kind": "entity", + "includes": [ + "managed" + ], + "elements": { + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "createdBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@UI.HiddenFilter": 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, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@cds.on.update": { + "=": "$user" + }, + "@UI.HiddenFilter": 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" + }, + "currency": { + "@title": "{i18n>Currency}", + "@description": "{i18n>CurrencyCode.Description}", + "type": "Currency", + "target": "sap.common.Currencies", + "keys": [ + { + "ref": [ + "code" + ] + } + ] + }, + "image": { + "@Core.MediaType": "image/png", + "type": "cds.LargeBinary" + }, + "reviews": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "ReviewsService.Reviews", + "on": [ + { + "ref": [ + "reviews", + "subject" + ] + }, + "=", + { + "ref": [ + "$self", + "ID" + ] + } + ] + }, + "rating": { + "type": "cds.Decimal" + }, + "numberOfReviews": { + "type": "cds.Integer" + }, + "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", + "includes": [ + "managed" + ], + "elements": { + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "createdBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@UI.HiddenFilter": 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, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@cds.on.update": { + "=": "$user" + }, + "@UI.HiddenFilter": 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 + }, + "dateOfBirth": { + "type": "cds.Date" + }, + "dateOfDeath": { + "type": "cds.Date" + }, + "placeOfBirth": { + "type": "cds.String" + }, + "placeOfDeath": { + "type": "cds.String" + }, + "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" + ] + } + ] + } + } + }, + "CatalogService": { + "kind": "service", + "@path": "/browse" + }, + "CatalogService.ListOfBooks": { + "kind": "entity", + "@readonly": true, + "projection": { + "from": { + "ref": [ + "CatalogService.Books" + ] + }, + "excluding": [ + "descr" + ] + }, + "elements": { + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@cds.on.update": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "ID": { + "key": true, + "type": "cds.Integer" + }, + "title": { + "localized": true, + "type": "cds.String", + "length": 111 + }, + "author": { + "type": "cds.String", + "length": 111 + }, + "genre": { + "type": "cds.Association", + "target": "CatalogService.GenreHierarchy", + "keys": [ + { + "ref": [ + "ID" + ] + } + ] + }, + "stock": { + "type": "cds.Integer" + }, + "price": { + "type": "cds.Decimal" + }, + "currency": { + "@title": "{i18n>Currency}", + "@description": "{i18n>CurrencyCode.Description}", + "type": "Currency", + "target": "CatalogService.Currencies", + "keys": [ + { + "ref": [ + "code" + ] + } + ] + }, + "image": { + "@Core.MediaType": "image/png", + "type": "cds.LargeBinary" + }, + "reviews": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "CatalogService.Reviews", + "on": [ + { + "ref": [ + "reviews", + "subject" + ] + }, + "=", + { + "ref": [ + "$self", + "ID" + ] + } + ] + }, + "rating": { + "type": "cds.Decimal" + }, + "numberOfReviews": { + "type": "cds.Integer" + }, + "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.Books": { + "kind": "entity", + "@readonly": true, + "projection": { + "from": { + "ref": [ + "sap.capire.bookshop.Books" + ] + }, + "columns": [ + "*", + { + "ref": [ + "author", + "name" + ], + "as": "author" + } + ], + "excluding": [ + "createdBy", + "modifiedBy" + ] + }, + "elements": { + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@cds.on.update": { + "=": "$now" + }, + "@UI.HiddenFilter": 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.GenreHierarchy", + "keys": [ + { + "ref": [ + "ID" + ] + } + ] + }, + "stock": { + "type": "cds.Integer" + }, + "price": { + "type": "cds.Decimal" + }, + "currency": { + "@title": "{i18n>Currency}", + "@description": "{i18n>CurrencyCode.Description}", + "type": "Currency", + "target": "CatalogService.Currencies", + "keys": [ + { + "ref": [ + "code" + ] + } + ] + }, + "image": { + "@Core.MediaType": "image/png", + "type": "cds.LargeBinary" + }, + "reviews": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "CatalogService.Reviews", + "on": [ + { + "ref": [ + "reviews", + "subject" + ] + }, + "=", + { + "ref": [ + "$self", + "ID" + ] + } + ] + }, + "rating": { + "type": "cds.Decimal" + }, + "numberOfReviews": { + "type": "cds.Integer" + }, + "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" + } + }, + "returns": { + "elements": { + "stock": { + "type": "cds.Integer" + } + } + } + }, + "CatalogService.OrderedBook": { + "kind": "event", + "elements": { + "book": { + "type": { + "ref": [ + "CatalogService.Books", + "ID" + ] + } + }, + "quantity": { + "type": "cds.Integer" + }, + "buyer": { + "type": "cds.String" + } + } + }, + "AdminService": { + "kind": "service", + "@requires": "admin" + }, + "AdminService.Books": { + "kind": "entity", + "projection": { + "from": { + "ref": [ + "sap.capire.bookshop.Books" + ] + } + }, + "elements": { + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "createdBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@UI.HiddenFilter": 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, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@cds.on.update": { + "=": "$user" + }, + "@UI.HiddenFilter": 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" + }, + "currency": { + "@title": "{i18n>Currency}", + "@description": "{i18n>CurrencyCode.Description}", + "type": "Currency", + "target": "AdminService.Currencies", + "keys": [ + { + "ref": [ + "code" + ] + } + ] + }, + "image": { + "@Core.MediaType": "image/png", + "type": "cds.LargeBinary" + }, + "reviews": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "AdminService.Reviews", + "on": [ + { + "ref": [ + "reviews", + "subject" + ] + }, + "=", + { + "ref": [ + "$self", + "ID" + ] + } + ] + }, + "rating": { + "type": "cds.Decimal" + }, + "numberOfReviews": { + "type": "cds.Integer" + }, + "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", + "projection": { + "from": { + "ref": [ + "sap.capire.bookshop.Authors" + ] + } + }, + "elements": { + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "createdBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@UI.HiddenFilter": 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, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@cds.on.update": { + "=": "$user" + }, + "@UI.HiddenFilter": 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 + }, + "dateOfBirth": { + "type": "cds.Date" + }, + "dateOfDeath": { + "type": "cds.Date" + }, + "placeOfBirth": { + "type": "cds.String" + }, + "placeOfDeath": { + "type": "cds.String" + }, + "books": { + "type": "cds.Association", + "cardinality": { + "max": "*" + }, + "target": "AdminService.Books", + "on": [ + { + "ref": [ + "books", + "author" + ] + }, + "=", + { + "ref": [ + "$self" + ] + } + ] + } + } + }, + "ReviewsService": { + "kind": "service", + "@restrict": [ + { + "grant": "like", + "to": "identified-user" + }, + { + "grant": "unlike", + "to": "identified-user", + "where": "user=$user" + } + ] + }, + "ReviewsService.Reviews": { + "kind": "entity", + "@restrict": [ + { + "grant": "READ", + "to": "any" + }, + { + "grant": "CREATE", + "to": "authenticated-user" + }, + { + "grant": "UPDATE", + "to": "authenticated-user", + "where": "reviewer=$user" + }, + { + "grant": "DELETE", + "to": "admin" + } + ], + "projection": { + "from": { + "ref": [ + "sap.capire.reviews.Reviews" + ] + }, + "excluding": [ + "likes" + ] + }, + "elements": { + "ID": { + "key": true, + "type": "cds.UUID" + }, + "subject": { + "@mandatory": true, + "type": "sap.capire.reviews.ReviewedSubject", + "length": 111 + }, + "reviewer": { + "@cds.on.insert": { + "=": "$user" + }, + "@title": "{i18n>UserID}", + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "rating": { + "@assert.range": true, + "type": "sap.capire.reviews.Rating" + }, + "title": { + "@mandatory": true, + "type": "cds.String", + "length": 111 + }, + "text": { + "type": "cds.String", + "length": 1111 + }, + "date": { + "@cds.on.insert": { + "=": "$now" + }, + "@cds.on.update": { + "=": "$now" + }, + "type": "cds.DateTime" + }, + "liked": { + "type": "cds.Integer", + "default": { + "val": 0 + } + } + } + }, + "ReviewsService.like": { + "kind": "action", + "params": { + "review": { + "type": { + "ref": [ + "ReviewsService.Reviews", + "ID" + ] + } + } + } + }, + "ReviewsService.unlike": { + "kind": "action", + "params": { + "review": { + "type": { + "ref": [ + "ReviewsService.Reviews", + "ID" + ] + } + } + } + }, + "ReviewsService.reviewed": { + "kind": "event", + "elements": { + "subject": { + "@mandatory": true, + "type": { + "ref": [ + "ReviewsService.Reviews", + "subject" + ] + }, + "length": 111 + }, + "count": { + "type": "cds.Integer" + }, + "rating": { + "type": "cds.Decimal" + } + } + }, + "OrdersService": { + "kind": "service" + }, + "OrdersService.Orders": { + "kind": "entity", + "@odata.draft.enabled": true, + "@UI.SelectionFields": [ + { + "=": "createdAt" + }, + { + "=": "createdBy" + } + ], + "@UI.LineItem": [ + { + "Value": { + "=": "OrderNo" + }, + "Label": "OrderNo" + }, + { + "Value": { + "=": "buyer" + }, + "Label": "Customer" + }, + { + "Value": { + "=": "createdAt" + }, + "Label": "Date" + } + ], + "@UI.HeaderInfo.TypeName": "Order", + "@UI.HeaderInfo.TypeNamePlural": "Orders", + "@UI.HeaderInfo.Title.Label": "Order number ", + "@UI.HeaderInfo.Title.Value": { + "=": "OrderNo" + }, + "@UI.HeaderInfo.Description.Value": { + "=": "createdBy" + }, + "@UI.Identification": [ + { + "Value": { + "=": "createdBy" + }, + "Label": "Customer" + }, + { + "Value": { + "=": "createdAt" + }, + "Label": "Date" + }, + { + "Value": { + "=": "OrderNo" + } + } + ], + "@UI.HeaderFacets": [ + { + "$Type": "UI.ReferenceFacet", + "Label": "{i18n>Created}", + "Target": "@UI.FieldGroup#Created" + }, + { + "$Type": "UI.ReferenceFacet", + "Label": "{i18n>Modified}", + "Target": "@UI.FieldGroup#Modified" + } + ], + "@UI.Facets": [ + { + "$Type": "UI.ReferenceFacet", + "Label": "{i18n>Details}", + "Target": "@UI.FieldGroup#Details" + }, + { + "$Type": "UI.ReferenceFacet", + "Label": "{i18n>OrderItems}", + "Target": "Items/@UI.LineItem" + } + ], + "@UI.FieldGroup#Details.Data": [ + { + "Value": { + "=": "currency.code" + }, + "Label": "Currency" + } + ], + "@UI.FieldGroup#Created.Data": [ + { + "Value": { + "=": "createdBy" + } + }, + { + "Value": { + "=": "createdAt" + } + } + ], + "@UI.FieldGroup#Modified.Data": [ + { + "Value": { + "=": "modifiedBy" + } + }, + { + "Value": { + "=": "modifiedAt" + } + } + ], + "projection": { + "from": { + "ref": [ + "sap.capire.orders.Orders" + ] + } + }, + "elements": { + "ID": { + "key": true, + "type": "cds.UUID" + }, + "createdAt": { + "@UI.HiddenFilter": false, + "@cds.on.insert": { + "=": "$now" + }, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "createdBy": { + "@UI.HiddenFilter": false, + "@cds.on.insert": { + "=": "$user" + }, + "@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, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@cds.on.update": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@title": "{i18n>ChangedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "OrderNo": { + "@title": "Order Number", + "type": "cds.String" + }, + "Items": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "targetAspect": { + "elements": { + "ID": { + "key": true, + "type": "cds.UUID" + }, + "product": { + "type": "cds.Association", + "target": "sap.capire.orders.Products", + "keys": [ + { + "ref": [ + "ID" + ] + } + ] + }, + "quantity": { + "type": "cds.Integer" + }, + "title": { + "type": "cds.String" + }, + "price": { + "type": "cds.Double" + }, + "book": { + "type": "cds.Association", + "target": "sap.capire.bookshop.Books", + "on": [ + { + "ref": [ + "product", + "ID" + ] + }, + "=", + { + "ref": [ + "book", + "ID" + ] + } + ] + } + } + }, + "target": "OrdersService.Orders.Items", + "on": [ + { + "ref": [ + "Items", + "up_" + ] + }, + "=", + { + "ref": [ + "$self" + ] + } + ] + }, + "buyer": { + "@title": "{i18n>UserID}", + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "currency": { + "@title": "{i18n>Currency}", + "@description": "{i18n>CurrencyCode.Description}", + "type": "Currency", + "target": "OrdersService.Currencies", + "keys": [ + { + "ref": [ + "code" + ] + } + ] + } + } + }, + "sap.capire.orders.Orders": { + "kind": "entity", + "includes": [ + "cuid", + "managed" + ], + "elements": { + "ID": { + "key": true, + "type": "cds.UUID" + }, + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "createdBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@UI.HiddenFilter": 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, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@cds.on.update": { + "=": "$user" + }, + "@UI.HiddenFilter": true, + "@title": "{i18n>ChangedBy}", + "@readonly": true, + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "OrderNo": { + "@title": "Order Number", + "type": "cds.String" + }, + "Items": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "targetAspect": { + "elements": { + "ID": { + "key": true, + "type": "cds.UUID" + }, + "product": { + "type": "cds.Association", + "target": "sap.capire.orders.Products", + "keys": [ + { + "ref": [ + "ID" + ] + } + ] + }, + "quantity": { + "type": "cds.Integer" + }, + "title": { + "type": "cds.String" + }, + "price": { + "type": "cds.Double" + }, + "book": { + "type": "cds.Association", + "target": "sap.capire.bookshop.Books", + "on": [ + { + "ref": [ + "product", + "ID" + ] + }, + "=", + { + "ref": [ + "book", + "ID" + ] + } + ] + } + } + }, + "target": "sap.capire.orders.Orders.Items", + "on": [ + { + "ref": [ + "Items", + "up_" + ] + }, + "=", + { + "ref": [ + "$self" + ] + } + ] + }, + "buyer": { + "@title": "{i18n>UserID}", + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "currency": { + "@title": "{i18n>Currency}", + "@description": "{i18n>CurrencyCode.Description}", + "type": "Currency", + "target": "sap.common.Currencies", + "keys": [ + { + "ref": [ + "code" + ] + } + ] + } + } + }, + "sap.capire.orders.Products": { + "kind": "entity", + "@cds.persistence.skip": "always", + "elements": { + "ID": { + "key": true, + "type": "cds.String" + } + } + }, + "DataService": { + "kind": "service", + "@requires": "authenticated-user", + "@path": "-data" + }, + "DataService.Entities": { + "kind": "entity", + "elements": { + "name": { + "key": true, + "type": "cds.String" + }, + "columns": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "targetAspect": { + "elements": { + "name": { + "type": "cds.String" + }, + "type": { + "type": "cds.String" + }, + "isKey": { + "type": "cds.Boolean" + } + } + }, + "target": "DataService.Entities.columns", + "on": [ + { + "ref": [ + "columns", + "up_" + ] + }, + "=", + { + "ref": [ + "$self" + ] + } + ] + } + } + }, + "DataService.Data": { + "kind": "entity", + "elements": { + "record": { + "items": { + "elements": { + "column": { + "type": "cds.String" + }, + "data": { + "type": "cds.String" + } + } + } + } + } + }, + "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" + ] + } + ] + }, + "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 + }, + "regions": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.common.countries.Regions", + "on": [ + { + "ref": [ + "regions", + "_parent" + ] + }, + "=", + { + "ref": [ + "$self", + "code" + ] + } + ] + }, + "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 + }, + "numcode": { + "type": "cds.Integer" + }, + "exponent": { + "type": "cds.Integer" + }, + "minor": { + "type": "cds.String" + }, + "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.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 + } + } + }, + "cuid": { + "kind": "aspect", + "elements": { + "ID": { + "key": true, + "type": "cds.UUID" + } + } + }, + "managed": { + "kind": "aspect", + "elements": { + "createdAt": { + "@cds.on.insert": { + "=": "$now" + }, + "@UI.HiddenFilter": true, + "@Core.Immutable": true, + "@title": "{i18n>CreatedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "createdBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@UI.HiddenFilter": 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, + "@title": "{i18n>ChangedAt}", + "@readonly": true, + "type": "cds.Timestamp" + }, + "modifiedBy": { + "@cds.on.insert": { + "=": "$user" + }, + "@cds.on.update": { + "=": "$user" + }, + "@UI.HiddenFilter": 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 + }, + "extensible": { + "kind": "aspect", + "elements": { + "extensions__": { + "@cds.api.ignore": true, + "type": "cds.String" + } + } + }, + "sap.capire.reviews.ReviewedSubject": { + "kind": "type", + "type": "cds.String", + "length": 111 + }, + "sap.capire.reviews.Reviews": { + "kind": "entity", + "elements": { + "ID": { + "key": true, + "type": "cds.UUID" + }, + "subject": { + "type": "sap.capire.reviews.ReviewedSubject", + "length": 111 + }, + "reviewer": { + "@cds.on.insert": { + "=": "$user" + }, + "@title": "{i18n>UserID}", + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "rating": { + "type": "sap.capire.reviews.Rating" + }, + "title": { + "type": "cds.String", + "length": 111 + }, + "text": { + "type": "cds.String", + "length": 1111 + }, + "date": { + "@cds.on.insert": { + "=": "$now" + }, + "@cds.on.update": { + "=": "$now" + }, + "type": "cds.DateTime" + }, + "likes": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "sap.capire.reviews.Likes", + "on": [ + { + "ref": [ + "likes", + "review" + ] + }, + "=", + { + "ref": [ + "$self" + ] + } + ] + }, + "liked": { + "type": "cds.Integer", + "default": { + "val": 0 + } + } + } + }, + "sap.capire.reviews.Rating": { + "kind": "type", + "type": "cds.Integer", + "enum": { + "Best": { + "val": 5 + }, + "Good": { + "val": 4 + }, + "Avg": { + "val": 3 + }, + "Poor": { + "val": 2 + }, + "Worst": { + "val": 1 + } + } + }, + "sap.capire.reviews.Likes": { + "kind": "entity", + "elements": { + "review": { + "key": true, + "type": "cds.Association", + "target": "sap.capire.reviews.Reviews", + "keys": [ + { + "ref": [ + "ID" + ] + } + ] + }, + "user": { + "@title": "{i18n>UserID}", + "@description": "{i18n>UserID.Description}", + "key": true, + "type": "User", + "length": 255 + } + } + }, + "sap.capire.bookshop.GenreHierarchy.texts": { + "kind": "entity", + "@odata.draft.enabled": false, + "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.common.countries.Regions.texts": { + "kind": "entity", + "@odata.draft.enabled": false, + "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, + "key": true, + "type": "cds.String", + "length": 5 + } + } + }, + "sap.common.countries.Cities.texts": { + "kind": "entity", + "@odata.draft.enabled": false, + "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, + "key": true, + "type": "cds.String", + "length": 11 + } + } + }, + "sap.common.countries.Districts.texts": { + "kind": "entity", + "@odata.draft.enabled": false, + "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, + "key": true, + "type": "cds.String", + "length": 11 + } + } + }, + "sap.capire.bookshop.Books.texts": { + "kind": "entity", + "@odata.draft.enabled": false, + "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, + "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.orders.Orders.Items": { + "kind": "entity", + "elements": { + "up_": { + "key": true, + "type": "cds.Association", + "cardinality": { + "min": 1, + "max": 1 + }, + "target": "sap.capire.orders.Orders", + "keys": [ + { + "ref": [ + "ID" + ] + } + ], + "notNull": true + }, + "ID": { + "key": true, + "type": "cds.UUID" + }, + "product": { + "type": "cds.Association", + "target": "sap.capire.orders.Products", + "keys": [ + { + "ref": [ + "ID" + ] + } + ] + }, + "quantity": { + "type": "cds.Integer" + }, + "title": { + "type": "cds.String" + }, + "price": { + "type": "cds.Double" + }, + "book": { + "type": "cds.Association", + "target": "sap.capire.bookshop.Books", + "on": [ + { + "ref": [ + "product", + "ID" + ] + }, + "=", + { + "ref": [ + "book", + "ID" + ] + } + ] + } + } + }, + "DataService.Entities.columns": { + "kind": "entity", + "elements": { + "up_": { + "key": true, + "type": "cds.Association", + "cardinality": { + "min": 1, + "max": 1 + }, + "target": "DataService.Entities", + "keys": [ + { + "ref": [ + "name" + ] + } + ], + "notNull": true + }, + "name": { + "type": "cds.String" + }, + "type": { + "type": "cds.String" + }, + "isKey": { + "type": "cds.Boolean" + } + } + }, + "sap.common.Languages.texts": { + "kind": "entity", + "@odata.draft.enabled": false, + "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, + "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, + "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.GenreHierarchy.texts": { + "kind": "entity", + "@cds.autoexposed": true, + "@odata.draft.enabled": false, + "projection": { + "from": { + "ref": [ + "sap.capire.bookshop.GenreHierarchy.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": { + "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 + }, + "numcode": { + "type": "cds.Integer" + }, + "exponent": { + "type": "cds.Integer" + }, + "minor": { + "type": "cds.String" + }, + "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.Reviews": { + "kind": "entity", + "@cds.autoexposed": true, + "@restrict": [ + { + "grant": "READ", + "to": "any" + }, + { + "grant": "CREATE", + "to": "authenticated-user" + }, + { + "grant": "UPDATE", + "to": "authenticated-user", + "where": "reviewer=$user" + }, + { + "grant": "DELETE", + "to": "admin" + } + ], + "projection": { + "from": { + "ref": [ + "ReviewsService.Reviews" + ] + } + }, + "elements": { + "ID": { + "key": true, + "type": "cds.UUID" + }, + "subject": { + "@mandatory": true, + "type": "sap.capire.reviews.ReviewedSubject", + "length": 111 + }, + "reviewer": { + "@cds.on.insert": { + "=": "$user" + }, + "@title": "{i18n>UserID}", + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "rating": { + "@assert.range": true, + "type": "sap.capire.reviews.Rating" + }, + "title": { + "@mandatory": true, + "type": "cds.String", + "length": 111 + }, + "text": { + "type": "cds.String", + "length": 1111 + }, + "date": { + "@cds.on.insert": { + "=": "$now" + }, + "@cds.on.update": { + "=": "$now" + }, + "type": "cds.DateTime" + }, + "liked": { + "type": "cds.Integer", + "default": { + "val": 0 + } + } + } + }, + "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 + } + } + }, + "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 + }, + "numcode": { + "type": "cds.Integer" + }, + "exponent": { + "type": "cds.Integer" + }, + "minor": { + "type": "cds.String" + }, + "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.Reviews": { + "kind": "entity", + "@cds.autoexposed": true, + "@restrict": [ + { + "grant": "READ", + "to": "any" + }, + { + "grant": "CREATE", + "to": "authenticated-user" + }, + { + "grant": "UPDATE", + "to": "authenticated-user", + "where": "reviewer=$user" + }, + { + "grant": "DELETE", + "to": "admin" + } + ], + "projection": { + "from": { + "ref": [ + "ReviewsService.Reviews" + ] + } + }, + "elements": { + "ID": { + "key": true, + "type": "cds.UUID" + }, + "subject": { + "@mandatory": true, + "type": "sap.capire.reviews.ReviewedSubject", + "length": 111 + }, + "reviewer": { + "@cds.on.insert": { + "=": "$user" + }, + "@title": "{i18n>UserID}", + "@description": "{i18n>UserID.Description}", + "type": "User", + "length": 255 + }, + "rating": { + "@assert.range": true, + "type": "sap.capire.reviews.Rating" + }, + "title": { + "@mandatory": true, + "type": "cds.String", + "length": 111 + }, + "text": { + "type": "cds.String", + "length": 1111 + }, + "date": { + "@cds.on.insert": { + "=": "$now" + }, + "@cds.on.update": { + "=": "$now" + }, + "type": "cds.DateTime" + }, + "liked": { + "type": "cds.Integer", + "default": { + "val": 0 + } + } + } + }, + "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 + } + } + }, + "OrdersService.Orders.Items": { + "kind": "entity", + "@cds.autoexposed": true, + "@UI.LineItem": [ + { + "Value": { + "=": "product_ID" + }, + "Label": "Product ID" + }, + { + "Value": { + "=": "title" + }, + "Label": "Product Title" + }, + { + "Value": { + "=": "price" + }, + "Label": "Unit Price" + }, + { + "Value": { + "=": "quantity" + }, + "Label": "Quantity" + } + ], + "@UI.Identification": [ + { + "Value": { + "=": "quantity" + }, + "Label": "Quantity" + }, + { + "Value": { + "=": "title" + }, + "Label": "Product" + }, + { + "Value": { + "=": "price" + }, + "Label": "Unit Price" + } + ], + "@UI.Facets": [ + { + "$Type": "UI.ReferenceFacet", + "Label": "{i18n>OrderItems}", + "Target": "@UI.Identification" + } + ], + "projection": { + "from": { + "ref": [ + "sap.capire.orders.Orders.Items" + ] + } + }, + "elements": { + "up_": { + "key": true, + "type": "cds.Association", + "cardinality": { + "min": 1, + "max": 1 + }, + "target": "OrdersService.Orders", + "keys": [ + { + "ref": [ + "ID" + ] + } + ], + "notNull": true + }, + "ID": { + "key": true, + "type": "cds.UUID" + }, + "product": { + "type": "cds.Association", + "target": "sap.capire.orders.Products", + "keys": [ + { + "ref": [ + "ID" + ] + } + ] + }, + "quantity": { + "@Common.FieldControl": { + "#": "Mandatory" + }, + "type": "cds.Integer" + }, + "title": { + "type": "cds.String" + }, + "price": { + "type": "cds.Double" + }, + "book": { + "type": "cds.Association", + "target": "sap.capire.bookshop.Books", + "on": [ + { + "ref": [ + "product", + "ID" + ] + }, + "=", + { + "ref": [ + "book", + "ID" + ] + } + ] + } + } + }, + "OrdersService.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 + }, + "numcode": { + "type": "cds.Integer" + }, + "exponent": { + "type": "cds.Integer" + }, + "minor": { + "type": "cds.String" + }, + "texts": { + "type": "cds.Composition", + "cardinality": { + "max": "*" + }, + "target": "OrdersService.Currencies.texts", + "on": [ + { + "ref": [ + "texts", + "code" + ] + }, + "=", + { + "ref": [ + "code" + ] + } + ] + }, + "localized": { + "type": "cds.Association", + "target": "OrdersService.Currencies.texts", + "on": [ + { + "ref": [ + "localized", + "code" + ] + }, + "=", + { + "ref": [ + "code" + ] + }, + "and", + { + "ref": [ + "localized", + "locale" + ] + }, + "=", + { + "ref": [ + "$user", + "locale" + ] + } + ] + } + } + }, + "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 + } + } + }, + "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 + } + } + }, + "OrdersService.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 + } + } + } + }, + "meta": { + "creator": "CDS Compiler v3.0.3", + "flavor": "inferred" + }, + "$version": "2.0" +} diff --git a/fiori-ext/package.json b/fiori-ext/package.json new file mode 100644 index 00000000..6647af4b --- /dev/null +++ b/fiori-ext/package.json @@ -0,0 +1,45 @@ +{ + "name": "@capire/fiori-ext", + "version": "1.0.0", + "description": "A simple CAP project.", + "repository": "", + "license": "UNLICENSED", + "private": true, + "dependencies": { + "@sap/cds": "^6" + }, + "devDependencies": { + "sqlite3": "^5.0.4" + }, + "scripts": { + "start": "cds run" + }, + "cds": { + "extends": "@capire/fiori" + }, + "eslintConfig": { + "extends": "eslint:recommended", + "env": { + "es2020": true, + "node": true, + "jest": true, + "mocha": true + }, + "globals": { + "SELECT": true, + "INSERT": true, + "UPDATE": true, + "DELETE": true, + "CREATE": true, + "DROP": true, + "CDL": true, + "CQL": true, + "CXL": true, + "cds": true + }, + "rules": { + "no-console": "off", + "require-atomic-updates": "off" + } + } +} diff --git a/fiori-ext/test/data/Z_bookshop.extension-Z_SalesRegion.csv b/fiori-ext/test/data/Z_bookshop.extension-Z_SalesRegion.csv new file mode 100644 index 00000000..b5aeca0e --- /dev/null +++ b/fiori-ext/test/data/Z_bookshop.extension-Z_SalesRegion.csv @@ -0,0 +1,4 @@ +regionCode;name;descr +AMER;Americas;North, Central and South America +EMEA;Europe, the Middle East and Africa;Europe, the Middle East and Africa +APJ;Asia Pacific and Japan;Asia Pacific and Japan \ No newline at end of file diff --git a/fiori-ext/test/data/sap.capire.orders-Orders.csv b/fiori-ext/test/data/sap.capire.orders-Orders.csv new file mode 100644 index 00000000..395847d0 --- /dev/null +++ b/fiori-ext/test/data/sap.capire.orders-Orders.csv @@ -0,0 +1,3 @@ +ID;createdAt;createdBy;buyer;OrderNo;currency_code;Z_priority;Z_SalesRegion_regionCode +7e2f2640-6866-4dcf-8f4d-3027aa831cad;2019-01-31;john.doe@test.com;john.doe@test.com;1;EUR;high;AMER +64e718c9-ff99-47f1-8ca3-950c850777d4;2019-01-30;jane.doe@test.com;jane.doe@test.com;2;EUR;low;APJ \ No newline at end of file