Compare commits
30 Commits
openSAP-we
...
openSAP-we
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
27ed4b7af2 | ||
|
|
0601038f0f | ||
|
|
e657e2c398 | ||
|
|
f7a5809576 | ||
|
|
64adf115f3 | ||
|
|
b7aee4e0e0 | ||
|
|
13480ad99e | ||
|
|
8071faa62d | ||
|
|
9ea294586a | ||
|
|
a56a11ff3e | ||
|
|
b4084b45cb | ||
|
|
26e3c0d753 | ||
|
|
6d0194acc0 | ||
|
|
db75a99808 | ||
|
|
a04755efed | ||
|
|
6a9a1bc4d6 | ||
|
|
a0847e603f | ||
|
|
b1270bc0eb | ||
|
|
ba72d7f478 | ||
|
|
cd808c76dd | ||
|
|
3a77707f49 | ||
|
|
583c97a494 | ||
|
|
eb7431afed | ||
|
|
630bb2b19c | ||
|
|
f9a7aa59de | ||
|
|
c0bce5ae5b | ||
|
|
ad05e2b9db | ||
|
|
b7c2eee961 | ||
|
|
9205e0893a | ||
|
|
7137bf227e |
@@ -6,7 +6,7 @@
|
||||
"jest": true
|
||||
},
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2017
|
||||
"ecmaVersion": 2018
|
||||
},
|
||||
"globals": {
|
||||
"SELECT": true,
|
||||
|
||||
27
.vscode/launch.json
vendored
27
.vscode/launch.json
vendored
@@ -5,19 +5,17 @@
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "cds run",
|
||||
"request": "launch",
|
||||
"type": "node",
|
||||
"runtimeExecutable": "npx",
|
||||
"runtimeArgs": ["-n"],
|
||||
"args": ["--", "cds", "run", "--with-mocks", "--in-memory?"], // the leading "--" arg ensures it works with as well as without debugging
|
||||
"name": "bookshop", "request": "launch", "type": "node", "runtimeExecutable": "npx", "runtimeArgs": [ "-n" ],
|
||||
"args": [ "--", "cds", "run", "--in-memory" ],
|
||||
"cwd": "${workspaceFolder}/packages/bookshop",
|
||||
"console": "integratedTerminal",
|
||||
"skipFiles": ["<node_internals>/**"]
|
||||
},
|
||||
{
|
||||
"name": "cds run ...", "request": "launch", "type": "node", "runtimeExecutable": "npx", "runtimeArgs": [ "-n" ],
|
||||
"args": [ "--", "cds", "run", "--with-mocks", "--in-memory?" ],
|
||||
"cwd": "${workspaceFolder}/packages/${input:service}",
|
||||
"console": "integratedTerminal",
|
||||
"serverReadyAction": {
|
||||
"pattern": "server listening on (https?://\\S+|[0-9]+)",
|
||||
"uriFormat": "http://localhost:%s",
|
||||
"action": "openExternally"
|
||||
},
|
||||
"skipFiles": ["<node_internals>/**"]
|
||||
}
|
||||
],
|
||||
@@ -31,12 +29,9 @@
|
||||
"bookstore",
|
||||
"media-server",
|
||||
"office-supplies",
|
||||
"orders-service",
|
||||
"products-service",
|
||||
"reviews-service",
|
||||
"user-service"
|
||||
"reviews-service"
|
||||
],
|
||||
"default": "bookstore"
|
||||
"default": "bookshop"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"files.exclude": {
|
||||
"**/.gitignore": false,
|
||||
"**/.git": false,
|
||||
"**/.vscode": false
|
||||
"**/.gitignore": true,
|
||||
"**/.vscode": true
|
||||
}
|
||||
}
|
||||
|
||||
21
.vscode/tasks.json
vendored
21
.vscode/tasks.json
vendored
@@ -4,23 +4,14 @@
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"type": "shell", "label": "cds run bookshop",
|
||||
"command": "npx", "args": [ "cds", "watch", "packages/bookshop" ],
|
||||
"presentation": { "group": "A" },
|
||||
"problemMatcher": []
|
||||
"type": "npm", "script": "watch", "path": "packages/bookshop/",
|
||||
"options": { "env": { "PORT": "4004" }},
|
||||
"presentation": { "group": "A" }
|
||||
},
|
||||
{
|
||||
"type": "shell", "label": "cds run bookshop-enhanced",
|
||||
"command": "npx", "args": [ "cds", "watch", "packages/bookshop-enhanced" ],
|
||||
"presentation": { "group": "A" },
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"type": "shell", "label": "cds run reviews-service",
|
||||
"command": "npx", "args": [ "cds", "watch", "packages/reviews-service" ],
|
||||
"options": {"env": { "PORT":"5005" }},
|
||||
"presentation": { "group": "A" },
|
||||
"problemMatcher": []
|
||||
"type": "npm", "script": "watch", "path": "packages/reviews-service/",
|
||||
"options": { "env": { "PORT": "5005" }},
|
||||
"presentation": { "group": "A" }
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -11,7 +11,7 @@ In SAP Business Application Studio, open a terminal.
|
||||
Then clone the repo with this specific branch:
|
||||
|
||||
```sh
|
||||
git clone https://github.com/sap-samples/cloud-cap-samples projects/cloud-cap-samples -b openSAP-week4-unit2-final
|
||||
git clone https://github.com/sap-samples/cloud-cap-samples projects/cloud-cap-samples -b openSAP-week2-unit2
|
||||
cd projects/cloud-cap-samples
|
||||
```
|
||||
|
||||
|
||||
836
package-lock.json
generated
836
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
15
package.json
15
package.json
@@ -5,23 +5,20 @@
|
||||
"author": "daniel.hutzel@sap.com",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"cleanup": "lerna clean -y && rm -fr node_modules",
|
||||
"install": "(npm -s run lerna) && lerna bootstrap --hoist",
|
||||
"lerna": "npx --no-install lerna -v > /dev/null || npm i lerna --no-save",
|
||||
"test": "jest",
|
||||
"bookshop-enhanced": "cds watch packages/bookshop-enhanced",
|
||||
"bookshop": "cds watch packages/bookshop",
|
||||
"bookstore": "cds watch packages/bookstore",
|
||||
"products-service": "cds watch packages/products-service",
|
||||
"reviews-service": "cds watch packages/reviews-service"
|
||||
"install": "(npm -s run lerna) && lerna bootstrap --hoist",
|
||||
"cleanup": "lerna clean -y && rm -fr node_modules",
|
||||
"bookshop": "cds watch packages/bookshop"
|
||||
},
|
||||
"dependencies": {
|
||||
"@sap/cds": "^3",
|
||||
"express": "^4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"sqlite3": "*"
|
||||
},
|
||||
"--add-these-to-devDependencies-for-tests": {
|
||||
"@types/jest": "*",
|
||||
"sqlite3": "*",
|
||||
"jest": "*"
|
||||
},
|
||||
"license": "SAP SAMPLE CODE LICENSE"
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
Books = Books
|
||||
Book = Book
|
||||
ID = ID
|
||||
Title = Title
|
||||
Author = Author
|
||||
AuthorID = Author ID
|
||||
Stock = Stock
|
||||
Name = Name
|
||||
AuthorName = Author's Name
|
||||
Authors = Authors
|
||||
Order = Order
|
||||
Orders = Orders
|
||||
Price = Price
|
||||
@@ -1,13 +0,0 @@
|
||||
Books = Bücher
|
||||
Book = Buch
|
||||
ID = ID
|
||||
Title = Titel
|
||||
Authors = Autoren
|
||||
Author = Autor
|
||||
AuthorID = ID des Autors
|
||||
AuthorName = Name des Autors
|
||||
Name = Name
|
||||
Stock = Bestand
|
||||
Order = Bestellung
|
||||
Orders = Bestellungen
|
||||
Price = Preis
|
||||
@@ -1,37 +0,0 @@
|
||||
using AdminService from '../../srv/admin-service';
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Books Object Page
|
||||
//
|
||||
annotate AdminService.Books with @(
|
||||
UI: {
|
||||
Facets: [
|
||||
{$Type: 'UI.ReferenceFacet', Label: '{i18n>General}', Target: '@UI.FieldGroup#General'},
|
||||
{$Type: 'UI.ReferenceFacet', Label: '{i18n>Details}', Target: '@UI.FieldGroup#Details'},
|
||||
{$Type: 'UI.ReferenceFacet', Label: '{i18n>Admin}', Target: '@UI.FieldGroup#Admin'},
|
||||
],
|
||||
FieldGroup#General: {
|
||||
Data: [
|
||||
{Value: title},
|
||||
{Value: author_ID},
|
||||
{Value: descr},
|
||||
]
|
||||
},
|
||||
FieldGroup#Details: {
|
||||
Data: [
|
||||
{Value: stock},
|
||||
{Value: price},
|
||||
{Value: currency_code, Label: '{i18n>Currency}'},
|
||||
]
|
||||
},
|
||||
FieldGroup#Admin: {
|
||||
Data: [
|
||||
{Value: createdBy},
|
||||
{Value: createdAt},
|
||||
{Value: modifiedBy},
|
||||
{Value: modifiedAt}
|
||||
]
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -1,22 +0,0 @@
|
||||
sap.ui.define(["sap/fe/AppComponent"], ac => ac.extend("admin.Component", {
|
||||
metadata:{ manifest:'json' }
|
||||
}))
|
||||
|
||||
// sap.ui.define (["sap/ui/core/UIComponent"], ui5 => ui5.extend("bookshop.Component", {
|
||||
// metadata: { manifest: "json" }
|
||||
// }))
|
||||
// sap.ui.define (["sap/ui/generic/app/AppComponent"], ui5 => ui5.extend("bookshop.Component", {
|
||||
// metadata: { manifest: "json" }
|
||||
// }))
|
||||
|
||||
// jQuery.sap.declare("bookshop.Component");
|
||||
// sap.ui.getCore().loadLibrary("sap.ui.generic.app");
|
||||
// jQuery.sap.require("sap.ui.generic.app.AppComponent");
|
||||
|
||||
// sap.ui.generic.app.AppComponent.extend("bookshop.Component", {
|
||||
// metadata: {
|
||||
// manifest: "json"
|
||||
// }
|
||||
// });
|
||||
|
||||
/* eslint no-undef:0 */
|
||||
@@ -1,11 +0,0 @@
|
||||
# This is the resource bundle of itelo
|
||||
# __ldi.translation.uuid=c3431418-9caf-11e8-98d0-529269fb1459
|
||||
|
||||
# JCI app descriptor contains lower case TITLE
|
||||
appTitle=Bookshop Sample
|
||||
|
||||
# JCI app descriptor contains lower case DESCRIPTION
|
||||
appSubTitle=CAP Sample Application
|
||||
|
||||
# JCI app descriptor contains lower case DESCRIPTION
|
||||
appDescription=CDS Sample Service
|
||||
@@ -1,128 +0,0 @@
|
||||
{
|
||||
"_version": "1.8.0",
|
||||
"sap.app": {
|
||||
"id": "admin",
|
||||
"type": "application",
|
||||
"title": "Manage Books",
|
||||
"description": "Sample Application",
|
||||
"i18n": "i18n/i18n.properties",
|
||||
"dataSources": {
|
||||
"AdminService": {
|
||||
"uri": "/admin/",
|
||||
"type": "OData",
|
||||
"settings": {
|
||||
"odataVersion": "4.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"-sourceTemplate": {
|
||||
"id": "ui5template.basicSAPUI5ApplicationProject",
|
||||
"-id": "ui5template.smartTemplate",
|
||||
"-version": "1.40.12"
|
||||
}
|
||||
},
|
||||
"sap.ui5": {
|
||||
"dependencies": {
|
||||
"libs": {
|
||||
"sap.fe": {}
|
||||
}
|
||||
},
|
||||
"models": {
|
||||
"i18n": {
|
||||
"type": "sap.ui.model.resource.ResourceModel",
|
||||
"uri": "i18n/i18n.properties"
|
||||
},
|
||||
"": {
|
||||
"dataSource": "AdminService",
|
||||
"settings": {
|
||||
"synchronizationMode": "None",
|
||||
"operationMode": "Server",
|
||||
"autoExpandSelect" : true,
|
||||
"earlyRequests": true,
|
||||
"groupProperties": {
|
||||
"default": {
|
||||
"submit": "Auto"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"routing": {
|
||||
"routes": [
|
||||
{
|
||||
"pattern": ":?query:",
|
||||
"name": "BooksList",
|
||||
"target": "BooksList"
|
||||
},
|
||||
{
|
||||
"pattern": "Books({key}):?query:",
|
||||
"name": "BooksDetails",
|
||||
"target": "BooksDetails"
|
||||
},
|
||||
{
|
||||
"pattern": "Books({key}/author({key2}):?query:",
|
||||
"name": "AuthorsDetails",
|
||||
"target": "AuthorsDetails"
|
||||
}
|
||||
],
|
||||
"targets": {
|
||||
"BooksList": {
|
||||
"type": "Component",
|
||||
"id": "BooksList",
|
||||
"name": "sap.fe.templates.ListReport",
|
||||
"options": {
|
||||
"settings" : {
|
||||
"entitySet" : "Books",
|
||||
"navigation" : {
|
||||
"Books" : {
|
||||
"detail" : {
|
||||
"route" : "BooksDetails"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"BooksDetails": {
|
||||
"type": "Component",
|
||||
"id": "BooksDetailsList",
|
||||
"name": "sap.fe.templates.ObjectPage",
|
||||
"options": {
|
||||
"settings" : {
|
||||
"entitySet" : "Books",
|
||||
"navigation" : {
|
||||
"Authors" : {
|
||||
"detail" : {
|
||||
"route" : "AuthorsDetails"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"AuthorsDetails": {
|
||||
"type": "Component",
|
||||
"id": "AuthorsDetailsList",
|
||||
"name": "sap.fe.templates.ObjectPage",
|
||||
"options": {
|
||||
"settings" : {
|
||||
"entitySet" : "Authors"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"contentDensities": {
|
||||
"compact": true,
|
||||
"cozy": true
|
||||
}
|
||||
},
|
||||
"sap.ui": {
|
||||
"technology": "UI5",
|
||||
"fullWidth": false
|
||||
},
|
||||
"sap.fiori": {
|
||||
"registrationIds": [],
|
||||
"archeType": "transactional"
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
using CatalogService from '../../srv/cat-service';
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Books Object Page
|
||||
//
|
||||
annotate CatalogService.Books with @(
|
||||
UI: {
|
||||
HeaderInfo: {
|
||||
Description: {Value: author}
|
||||
},
|
||||
HeaderFacets: [
|
||||
{$Type: 'UI.ReferenceFacet', Label: '{i18n>Description}', Target: '@UI.FieldGroup#Descr'},
|
||||
],
|
||||
Facets: [
|
||||
{$Type: 'UI.ReferenceFacet', Label: '{i18n>Details}', Target: '@UI.FieldGroup#Price'},
|
||||
],
|
||||
FieldGroup#Descr: {
|
||||
Data: [
|
||||
{Value: descr},
|
||||
]
|
||||
},
|
||||
FieldGroup#Price: {
|
||||
Data: [
|
||||
{Value: price},
|
||||
{Value: currency.symbol, Label: '{i18n>Currency}'},
|
||||
]
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Books Object Page
|
||||
//
|
||||
annotate CatalogService.Books with @(
|
||||
UI: {
|
||||
SelectionFields: [ ID, price, currency_code ],
|
||||
LineItem: [
|
||||
{Value: title},
|
||||
{Value: author, Label:'{i18n>Author}'},
|
||||
{Value: price},
|
||||
{Value: currency.symbol, Label:' '},
|
||||
]
|
||||
},
|
||||
);
|
||||
@@ -1,22 +0,0 @@
|
||||
sap.ui.define(["sap/fe/AppComponent"], ac => ac.extend("bookshop.Component", {
|
||||
metadata:{ manifest:'json' }
|
||||
}))
|
||||
|
||||
// sap.ui.define (["sap/ui/core/UIComponent"], ui5 => ui5.extend("bookshop.Component", {
|
||||
// metadata: { manifest: "json" }
|
||||
// }))
|
||||
// sap.ui.define (["sap/ui/generic/app/AppComponent"], ui5 => ui5.extend("bookshop.Component", {
|
||||
// metadata: { manifest: "json" }
|
||||
// }))
|
||||
|
||||
// jQuery.sap.declare("bookshop.Component");
|
||||
// sap.ui.getCore().loadLibrary("sap.ui.generic.app");
|
||||
// jQuery.sap.require("sap.ui.generic.app.AppComponent");
|
||||
|
||||
// sap.ui.generic.app.AppComponent.extend("bookshop.Component", {
|
||||
// metadata: {
|
||||
// manifest: "json"
|
||||
// }
|
||||
// });
|
||||
|
||||
/* eslint no-undef:0 */
|
||||
@@ -1,11 +0,0 @@
|
||||
# This is the resource bundle of itelo
|
||||
# __ldi.translation.uuid=c3431418-9caf-11e8-98d0-529269fb1459
|
||||
|
||||
# JCI app descriptor contains lower case TITLE
|
||||
appTitle=Bookshop Sample
|
||||
|
||||
# JCI app descriptor contains lower case DESCRIPTION
|
||||
appSubTitle=CAP Sample Application
|
||||
|
||||
# JCI app descriptor contains lower case DESCRIPTION
|
||||
appDescription=CDS Sample Service
|
||||
@@ -1,106 +0,0 @@
|
||||
{
|
||||
"_version": "1.8.0",
|
||||
"sap.app": {
|
||||
"id": "bookshop",
|
||||
"type": "application",
|
||||
"title": "Browse Books",
|
||||
"description": "Sample Application",
|
||||
"i18n": "i18n/i18n.properties",
|
||||
"dataSources": {
|
||||
"CatalogService": {
|
||||
"uri": "/browse/",
|
||||
"type": "OData",
|
||||
"settings": {
|
||||
"odataVersion": "4.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"-sourceTemplate": {
|
||||
"id": "ui5template.basicSAPUI5ApplicationProject",
|
||||
"-id": "ui5template.smartTemplate",
|
||||
"-version": "1.40.12"
|
||||
}
|
||||
},
|
||||
"sap.ui5": {
|
||||
"dependencies": {
|
||||
"libs": {
|
||||
"sap.fe": {}
|
||||
}
|
||||
},
|
||||
"models": {
|
||||
"i18n": {
|
||||
"type": "sap.ui.model.resource.ResourceModel",
|
||||
"uri": "i18n/i18n.properties"
|
||||
},
|
||||
"": {
|
||||
"dataSource": "CatalogService",
|
||||
"settings": {
|
||||
"synchronizationMode": "None",
|
||||
"operationMode": "Server",
|
||||
"autoExpandSelect": true,
|
||||
"earlyRequests": true,
|
||||
"groupProperties": {
|
||||
"default": {
|
||||
"submit": "Auto"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"routing": {
|
||||
"routes": [
|
||||
{
|
||||
"pattern": ":?query:",
|
||||
"name": "BooksList",
|
||||
"target": "BooksList"
|
||||
},
|
||||
{
|
||||
"pattern": "Books({key}):?query:",
|
||||
"name": "BooksDetails",
|
||||
"target": "BooksDetails"
|
||||
}
|
||||
],
|
||||
"targets": {
|
||||
"BooksList": {
|
||||
"type": "Component",
|
||||
"id": "BooksList",
|
||||
"name": "sap.fe.templates.ListReport",
|
||||
"options": {
|
||||
"settings": {
|
||||
"entitySet": "Books",
|
||||
"navigation": {
|
||||
"Books": {
|
||||
"detail": {
|
||||
"route": "BooksDetails"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"BooksDetails": {
|
||||
"type": "Component",
|
||||
"id": "BooksDetailsList",
|
||||
"name": "sap.fe.templates.ObjectPage",
|
||||
"options": {
|
||||
"settings": {
|
||||
"entitySet": "Books"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"contentDensities": {
|
||||
"compact": true,
|
||||
"cozy": true
|
||||
}
|
||||
},
|
||||
"sap.ui": {
|
||||
"technology": "UI5",
|
||||
"fullWidth": false
|
||||
},
|
||||
"sap.fiori": {
|
||||
"registrationIds": [],
|
||||
"archeType": "transactional"
|
||||
}
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
/*
|
||||
Common Annotations shared by all apps
|
||||
*/
|
||||
|
||||
using { sap.capire.bookshop as my } from '../db/schema';
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Books Lists
|
||||
//
|
||||
annotate my.Books with @(
|
||||
UI: {
|
||||
Identification: [{Value:title}],
|
||||
SelectionFields: [ ID, author_ID, price, currency_code ],
|
||||
LineItem: [
|
||||
{Value: ID},
|
||||
{Value: title},
|
||||
{Value: author.name, Label:'{i18n>Author}'},
|
||||
{Value: stock},
|
||||
{Value: price},
|
||||
{Value: currency.symbol, Label:' '},
|
||||
]
|
||||
}
|
||||
) {
|
||||
author @ValueList.entity:'Authors';
|
||||
};
|
||||
|
||||
annotate my.Authors with @(
|
||||
UI: {
|
||||
Identification: [{Value:name}],
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Books Details
|
||||
//
|
||||
annotate my.Books with @(
|
||||
UI: {
|
||||
HeaderInfo: {
|
||||
TypeName: '{i18n>Book}',
|
||||
TypeNamePlural: '{i18n>Books}',
|
||||
Title: {Value: title},
|
||||
Description: {Value: author.name}
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Books Elements
|
||||
//
|
||||
annotate my.Books with {
|
||||
ID @title:'{i18n>ID}' @UI.HiddenFilter;
|
||||
title @title:'{i18n>Title}';
|
||||
author @title:'{i18n>AuthorID}';
|
||||
price @title:'{i18n>Price}';
|
||||
stock @title:'{i18n>Stock}';
|
||||
descr @UI.MultiLineText;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Authors Elements
|
||||
//
|
||||
annotate my.Authors with {
|
||||
ID @title:'{i18n>ID}' @UI.HiddenFilter;
|
||||
name @title:'{i18n>AuthorName}';
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Bookshop</title>
|
||||
|
||||
<script>
|
||||
window["sap-ushell-config"] = {
|
||||
defaultRenderer: "fiori2",
|
||||
applications: {
|
||||
"browse-books": {
|
||||
title: "Browse Books",
|
||||
description: "... testing FE v42",
|
||||
additionalInformation: "SAPUI5.Component=bookshop",
|
||||
applicationType : "URL",
|
||||
url: "/browse/webapp",
|
||||
navigationMode: "embedded"
|
||||
},
|
||||
"manage-books": {
|
||||
title: "Manage Books",
|
||||
description: "... testing FE v42",
|
||||
additionalInformation: "SAPUI5.Component=admin",
|
||||
applicationType : "URL",
|
||||
url: "/admin/webapp",
|
||||
navigationMode: "embedded"
|
||||
},
|
||||
"manage-orders": {
|
||||
title: "Manage Orders",
|
||||
description: "... testing FE v42",
|
||||
additionalInformation: "SAPUI5.Component=orders",
|
||||
applicationType : "URL",
|
||||
url: "/orders/webapp",
|
||||
navigationMode: "embedded"
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<script src="https://sapui5.hana.ondemand.com/test-resources/sap/ushell/bootstrap/sandbox.js"></script>
|
||||
<script src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"
|
||||
data-sap-ui-libs="sap.m, sap.ushell, sap.collaboration, sap.ui.layout"
|
||||
data-sap-ui-compatVersion="edge"
|
||||
data-sap-ui-theme="sap_belize"
|
||||
data-sap-ui-frameOptions="allow"
|
||||
></script>
|
||||
<script>
|
||||
sap.ui.getCore().attachInit(()=> sap.ushell.Container.createRenderer().placeAt("content"))
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body class="sapUiBody" id="content"></body>
|
||||
</html>
|
||||
@@ -1,8 +0,0 @@
|
||||
/*
|
||||
This model controls what gets served to Fiori frontends...
|
||||
*/
|
||||
|
||||
using from './admin/fiori-service';
|
||||
using from './browse/fiori-service';
|
||||
using from './orders/fiori-service';
|
||||
using from './common';
|
||||
@@ -1,117 +0,0 @@
|
||||
using AdminService from '../../srv/admin-service';
|
||||
|
||||
annotate AdminService.Books with {
|
||||
price @Common.FieldControl: #ReadOnly;
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Common
|
||||
//
|
||||
annotate AdminService.OrderItems with {
|
||||
book @(
|
||||
Common: {
|
||||
Text: book.title,
|
||||
FieldControl: #Mandatory
|
||||
},
|
||||
ValueList.entity:'Books',
|
||||
);
|
||||
amount @(
|
||||
Common.FieldControl: #Mandatory
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
annotate AdminService.Orders with @(
|
||||
UI: {
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Lists of Orders
|
||||
//
|
||||
SelectionFields: [ createdAt, createdBy ],
|
||||
LineItem: [
|
||||
{Value: createdBy, Label:'Customer'},
|
||||
{Value: createdAt, Label:'Date'}
|
||||
],
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Order Details
|
||||
//
|
||||
HeaderInfo: {
|
||||
TypeName: 'Order', TypeNamePlural: 'Orders',
|
||||
Title: {
|
||||
Label: 'Order number ', //A label is possible but it is not considered on the ObjectPage yet
|
||||
Value: OrderNo
|
||||
},
|
||||
Description: {Value: createdBy}
|
||||
},
|
||||
Identification: [ //Is the main field group
|
||||
{Value: createdBy, Label:'Customer'},
|
||||
{Value: createdAt, Label:'Date'},
|
||||
{Value: OrderNo },
|
||||
],
|
||||
HeaderFacets: [
|
||||
{$Type: 'UI.ReferenceFacet', Label: '{i18n>Created}', Target: '@UI.FieldGroup#Created'},
|
||||
{$Type: 'UI.ReferenceFacet', Label: '{i18n>Modified}', Target: '@UI.FieldGroup#Modified'},
|
||||
],
|
||||
Facets: [
|
||||
{$Type: 'UI.ReferenceFacet', Label: '{i18n>Details}', Target: '@UI.FieldGroup#Details'},
|
||||
{$Type: 'UI.ReferenceFacet', Label: '{i18n>OrderItems}', Target: 'Items/@UI.LineItem'},
|
||||
],
|
||||
FieldGroup#Details: {
|
||||
Data: [
|
||||
{Value: currency_code, Label:'Currency'}
|
||||
]
|
||||
},
|
||||
FieldGroup#Created: {
|
||||
Data: [
|
||||
{Value: createdBy},
|
||||
{Value: createdAt},
|
||||
]
|
||||
},
|
||||
FieldGroup#Modified: {
|
||||
Data: [
|
||||
{Value: modifiedBy},
|
||||
{Value: modifiedAt},
|
||||
]
|
||||
},
|
||||
},
|
||||
) {
|
||||
createdAt @UI.HiddenFilter:false;
|
||||
createdBy @UI.HiddenFilter:false;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//The enity types name is AdminService.my_bookshop_OrderItems
|
||||
//The annotations below are not generated in edmx WHY?
|
||||
annotate AdminService.OrderItems with @(
|
||||
UI: {
|
||||
HeaderInfo: {
|
||||
TypeName: 'Order Item', TypeNamePlural: ' ',
|
||||
Title: {
|
||||
Value: book.title
|
||||
},
|
||||
Description: {Value: book.descr}
|
||||
},
|
||||
// There is no filterbar for items so the selctionfileds is not needed
|
||||
SelectionFields: [ book_ID ],
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Lists of OrderItems
|
||||
//
|
||||
LineItem: [
|
||||
{Value: book_ID, Label:'Book'},
|
||||
//The following entry is only used to have the assoication followed in the read event
|
||||
{Value: book.price, Label:'Book Price'},
|
||||
{Value: amount, Label:'Quantity'},
|
||||
],
|
||||
Identification: [ //Is the main field group
|
||||
//{Value: ID, Label:'ID'}, //A guid shouldn't be on the UI
|
||||
{Value: book_ID, Label:'Book'},
|
||||
{Value: amount, Label:'Amount'},
|
||||
],
|
||||
Facets: [
|
||||
{$Type: 'UI.ReferenceFacet', Label: '{i18n>OrderItems}', Target: '@UI.Identification'},
|
||||
],
|
||||
},
|
||||
);
|
||||
@@ -1,22 +0,0 @@
|
||||
sap.ui.define(["sap/fe/AppComponent"], ac => ac.extend("orders.Component", {
|
||||
metadata:{ manifest:'json' }
|
||||
}))
|
||||
|
||||
// sap.ui.define (["sap/ui/core/UIComponent"], ui5 => ui5.extend("bookshop.Component", {
|
||||
// metadata: { manifest: "json" }
|
||||
// }))
|
||||
// sap.ui.define (["sap/ui/generic/app/AppComponent"], ui5 => ui5.extend("bookshop.Component", {
|
||||
// metadata: { manifest: "json" }
|
||||
// }))
|
||||
|
||||
// jQuery.sap.declare("bookshop.Component");
|
||||
// sap.ui.getCore().loadLibrary("sap.ui.generic.app");
|
||||
// jQuery.sap.require("sap.ui.generic.app.AppComponent");
|
||||
|
||||
// sap.ui.generic.app.AppComponent.extend("bookshop.Component", {
|
||||
// metadata: {
|
||||
// manifest: "json"
|
||||
// }
|
||||
// });
|
||||
|
||||
/* eslint no-undef:0 */
|
||||
@@ -1,11 +0,0 @@
|
||||
# This is the resource bundle of itelo
|
||||
# __ldi.translation.uuid=c3431418-9caf-11e8-98d0-529269fb1459
|
||||
|
||||
# JCI app descriptor contains lower case TITLE
|
||||
appTitle=Bookshop Sample
|
||||
|
||||
# JCI app descriptor contains lower case DESCRIPTION
|
||||
appSubTitle=CAP Sample Application
|
||||
|
||||
# JCI app descriptor contains lower case DESCRIPTION
|
||||
appDescription=CDS Sample Service
|
||||
@@ -1,170 +0,0 @@
|
||||
{
|
||||
"_version": "1.8.0",
|
||||
"sap.app": {
|
||||
"id": "orders",
|
||||
"type": "application",
|
||||
"title": "Manage Orders",
|
||||
"description": "Sample Application",
|
||||
"i18n": "i18n/i18n.properties",
|
||||
"dataSources": {
|
||||
"AdminService": {
|
||||
"uri": "/admin/",
|
||||
"type": "OData",
|
||||
"settings": {
|
||||
"odataVersion": "4.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"-sourceTemplate": {
|
||||
"id": "ui5template.basicSAPUI5ApplicationProject",
|
||||
"-id": "ui5template.smartTemplate",
|
||||
"-version": "1.40.12"
|
||||
}
|
||||
},
|
||||
"sap.ui5": {
|
||||
"dependencies": {
|
||||
"libs": {
|
||||
"sap.fe": {}
|
||||
}
|
||||
},
|
||||
"models": {
|
||||
"i18n": {
|
||||
"type": "sap.ui.model.resource.ResourceModel",
|
||||
"uri": "i18n/i18n.properties"
|
||||
},
|
||||
"": {
|
||||
"dataSource": "AdminService",
|
||||
"settings": {
|
||||
"synchronizationMode": "None",
|
||||
"operationMode": "Server",
|
||||
"autoExpandSelect" : true,
|
||||
"earlyRequests": true,
|
||||
"groupProperties": {
|
||||
"default": {
|
||||
"submit": "Auto"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"routing": {
|
||||
"routes": [
|
||||
{
|
||||
"pattern": ":?query:",
|
||||
"name": "OrdersList",
|
||||
"target": "OrdersList"
|
||||
},
|
||||
{
|
||||
"pattern": "Orders({key}):?query:",
|
||||
"name": "OrdersDetails",
|
||||
"target": "OrdersDetails"
|
||||
},
|
||||
{
|
||||
"pattern": "Orders({boo})/Items({boo2}):?query:",
|
||||
"name": "OrderItemsDetails",
|
||||
"target": "OrderItemsDetails"
|
||||
},
|
||||
{
|
||||
"pattern": "Books({key}):?query:",
|
||||
"name": "BooksDetails",
|
||||
"target": "BooksDetails"
|
||||
}
|
||||
],
|
||||
"targets": {
|
||||
"OrdersList": {
|
||||
"type": "Component",
|
||||
"id": "OrdersList",
|
||||
"name": "sap.fe.templates.ListReport",
|
||||
"options": {
|
||||
"settings" : {
|
||||
"entitySet" : "Orders",
|
||||
"navigation" : {
|
||||
"Orders" : {
|
||||
"detail" : {
|
||||
"route" : "OrdersDetails"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"OrdersDetails": {
|
||||
"type": "Component",
|
||||
"id": "OrdersDetails",
|
||||
"name": "sap.fe.templates.ObjectPage",
|
||||
"options": {
|
||||
"settings" : {
|
||||
"entitySet": "Orders",
|
||||
"navigation" : {
|
||||
"Items": {
|
||||
"detail": {
|
||||
"route": "OrderItemsDetails"
|
||||
}
|
||||
},
|
||||
"book": {
|
||||
"detail": {
|
||||
"route": "BooksDetails"
|
||||
}
|
||||
},
|
||||
"dummy": {
|
||||
"detail": {
|
||||
"route": "BooksDetails"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"OrderItemsDetails": {
|
||||
"type": "Component",
|
||||
"id": "OrderItemsDetails",
|
||||
"name": "sap.fe.templates.ObjectPage",
|
||||
"options": {
|
||||
"settings" : {
|
||||
"entitySet": "OrderItems"
|
||||
}
|
||||
}
|
||||
},
|
||||
"BooksDetails": {
|
||||
"type": "Component",
|
||||
"id": "BooksDetails",
|
||||
"name": "sap.fe.templates.ObjectPage",
|
||||
"options": {
|
||||
"settings" : {
|
||||
"entitySet": "Books",
|
||||
"navigation": {
|
||||
"author": {
|
||||
"detail": {
|
||||
"route": "AuthorsDetails"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"AuthorsDetails": {
|
||||
"type": "Component",
|
||||
"id": "AuthorsDetails",
|
||||
"name": "sap.fe.templates.ObjectPage",
|
||||
"options": {
|
||||
"settings" : {
|
||||
"entitySet": "Authors"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"contentDensities": {
|
||||
"compact": true,
|
||||
"cozy": true
|
||||
}
|
||||
},
|
||||
"sap.ui": {
|
||||
"technology": "UI5",
|
||||
"fullWidth": false
|
||||
},
|
||||
"sap.fiori": {
|
||||
"registrationIds": [],
|
||||
"archeType": "transactional"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
ID;modifiedAt;createdAt;createdBy;modifiedBy;OrderNo;currency_code;status
|
||||
da86efd0-4ba1-4078-b7f0-5c9c530297f7;;2019-01-31;ALICE;;1;EUR;processing
|
||||
2f2f2640-6866-4dcf-8f4d-3027aa831cad;;2019-03-25;ALICE;;10;EUR;completed
|
||||
64e718c9-ff99-47f1-8ca3-950c850777d4;;2019-01-30;BOB;;2;EUR;processing
|
||||
1af3322d-3cb1-46be-b312-0ae9ec311537;;2019-03-16;BOB;;9;EUR;completed
|
||||
ID;modifiedAt;createdAt;createdBy;modifiedBy;OrderNo;currency_code
|
||||
7e2f2640-6866-4dcf-8f4d-3027aa831cad;;2019-01-31;john.doe@test.com;;1;EUR
|
||||
64e718c9-ff99-47f1-8ca3-950c850777d4;;2019-01-30;jane.doe@test.com;;2;EUR
|
||||
|
@@ -1,50 +1,45 @@
|
||||
namespace sap.capire.bookshop;
|
||||
using { Currency, managed, cuid } from '@sap/cds/common';
|
||||
using { sap.capire.products.Products } from '../../products';
|
||||
|
||||
using {
|
||||
Currency,
|
||||
managed,
|
||||
cuid
|
||||
} from '@sap/cds/common';
|
||||
/*
|
||||
entity Books : managed {
|
||||
key ID : Integer;
|
||||
title : localized String(111);
|
||||
descr : localized String(1111);
|
||||
author : Association to Authors;
|
||||
stock : Integer;
|
||||
price : Decimal(9,2);
|
||||
currency : Currency;
|
||||
} */
|
||||
|
||||
type Status : String enum {
|
||||
completed;
|
||||
processing;
|
||||
blocked;
|
||||
entity Books : Products {
|
||||
author : Association to Authors;
|
||||
}
|
||||
|
||||
entity Books : managed {
|
||||
key ID : Integer;
|
||||
title : localized String(111);
|
||||
descr : localized String(1111);
|
||||
author : Association to Authors;
|
||||
stock : Integer;
|
||||
price : Decimal(9, 2);
|
||||
currency : Currency;
|
||||
entity Magazines : Products {
|
||||
publisher : String;
|
||||
}
|
||||
|
||||
entity Authors : managed {
|
||||
key ID : Integer;
|
||||
name : String(111);
|
||||
dateOfBirth : Date;
|
||||
dateOfDeath : Date;
|
||||
placeOfBirth : String;
|
||||
placeOfDeath : String;
|
||||
books : Association to many Books
|
||||
on books.author = $self;
|
||||
key ID : Integer;
|
||||
name : String(111);
|
||||
dateOfBirth : Date;
|
||||
dateOfDeath : Date;
|
||||
placeOfBirth : String;
|
||||
placeOfDeath : String;
|
||||
books : Association to many Books on books.author = $self;
|
||||
}
|
||||
|
||||
entity Orders : cuid, managed {
|
||||
OrderNo : String @title : 'Order Number'; //> readable key
|
||||
status : Status default 'processing';
|
||||
Items : Composition of many OrderItems
|
||||
on Items.parent = $self;
|
||||
total : Decimal(9, 2)@readonly;
|
||||
OrderNo : String @title:'Order Number'; //> readable key
|
||||
Items : Composition of many OrderItems on Items.parent = $self;
|
||||
total : Decimal(9,2) @readonly;
|
||||
currency : Currency;
|
||||
}
|
||||
|
||||
entity OrderItems : cuid {
|
||||
parent : Association to Orders;
|
||||
book : Association to Books;
|
||||
amount : Integer;
|
||||
netAmount : Decimal(9, 2);
|
||||
}
|
||||
netAmount : Decimal(9,2);
|
||||
}
|
||||
|
||||
@@ -5,23 +5,16 @@
|
||||
"license": "SAP SAMPLE CODE LICENSE",
|
||||
"dependencies": {
|
||||
"@sap/cds": "^3",
|
||||
"express": "^4",
|
||||
"@sap/xb-msg-amqp-v100": "^0.9.35"
|
||||
},
|
||||
"devDependencies": {
|
||||
"sqlite3": "^4.1.1"
|
||||
"express": "^4"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "npx cds run"
|
||||
"start": "cds run --in-memory?",
|
||||
"watch": "cds watch"
|
||||
},
|
||||
"cds": {
|
||||
"requires": {
|
||||
"API_BUSINESS_PARTNER": {
|
||||
"kind": "odata",
|
||||
"model": "srv/external/API_BUSINESS_PARTNER",
|
||||
"--credentials": {
|
||||
"destination": "cap-api098"
|
||||
}
|
||||
"db": {
|
||||
"kind": "sql"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ service AdminService @(_requires:'authenticated-user') {
|
||||
annotate AdminService.Orders with @odata.draft.enabled;
|
||||
// annotate AdminService.Books with @odata.draft.enabled;
|
||||
|
||||
// Temporary workaround -> https://github.wdf.sap.corp/cap/issues/issues/3121
|
||||
// Temporary workaround -> cap/issues#3121
|
||||
extend service AdminService with {
|
||||
entity OrderItems as select from my.OrderItems;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using { sap.capire.bookshop as my } from '../db/schema';
|
||||
using { API_BUSINESS_PARTNER as external } from './external/API_BUSINESS_PARTNER.csn';
|
||||
|
||||
@path:'/browse'
|
||||
service CatalogService {
|
||||
@@ -8,14 +7,6 @@ service CatalogService {
|
||||
author.name as author
|
||||
} excluding { createdBy, modifiedBy };
|
||||
|
||||
@readonly entity BusinessPartners as projection on external.A_BusinessPartner {
|
||||
key BusinessPartner as ID,
|
||||
FirstName,
|
||||
MiddleName,
|
||||
LastName,
|
||||
BusinessPartnerIsBlocked
|
||||
};
|
||||
|
||||
@requires_: 'authenticated-user'
|
||||
@insertonly entity Orders as projection on my.Orders;
|
||||
|
||||
|
||||
@@ -1,28 +1,26 @@
|
||||
const cds = require('@sap/cds')
|
||||
const { Books } = cds.entities
|
||||
|
||||
/** Service implementation for CatalogService */
|
||||
module.exports = cds.service.impl(async function () {
|
||||
const { Books, Orders, BusinessPartners } = this.entities
|
||||
const bupaSrv = await cds.connect.to('API_BUSINESS_PARTNER')
|
||||
this.after('READ', Books, each => each.stock > 111 && _addDiscount2(each, 11))
|
||||
this.before('CREATE', Orders, _reduceStock)
|
||||
this.on('READ', BusinessPartners, req => bupaSrv.tx(req).run(req.query))
|
||||
|
||||
/** Add some discount for overstocked books */
|
||||
function _addDiscount2(each, discount) {
|
||||
each.title += ` -- ${discount}% discount!`
|
||||
}
|
||||
|
||||
/** Reduce stock of ordered books if available stock suffices */
|
||||
async function _reduceStock(req) {
|
||||
const { Items: OrderItems } = req.data
|
||||
return cds.transaction(req).run(() => OrderItems.map(order =>
|
||||
UPDATE(Books).set('stock -=', order.amount)
|
||||
.where('ID =', order.book_ID).and('stock >=', order.amount)
|
||||
)).then(all => all.forEach((affectedRows, i) => {
|
||||
if (affectedRows === 0) req.error(409,
|
||||
`${OrderItems[i].amount} exceeds stock for book #${OrderItems[i].book_ID}`
|
||||
)
|
||||
}))
|
||||
}
|
||||
module.exports = cds.service.impl(function() {
|
||||
this.after ('READ', 'Books', each => each.stock > 111 && _addDiscount2(each,11))
|
||||
this.before ('CREATE', 'Orders', _reduceStock)
|
||||
})
|
||||
|
||||
/** Add some discount for overstocked books */
|
||||
function _addDiscount2 (each,discount) {
|
||||
each.title += ` -- ${discount}% discount!`
|
||||
}
|
||||
|
||||
/** Reduce stock of ordered books if available stock suffices */
|
||||
async function _reduceStock (req) {
|
||||
const { Items: OrderItems } = req.data
|
||||
return cds.transaction(req) .run (()=> OrderItems.map (order =>
|
||||
UPDATE (Books) .set ('stock -=', order.amount)
|
||||
.where ('ID =', order.book_ID) .and ('stock >=', order.amount)
|
||||
)) .then (all => all.forEach ((affectedRows,i) => {
|
||||
if (affectedRows === 0) req.error (409,
|
||||
`${OrderItems[i].amount} exceeds stock for book #${OrderItems[i].book_ID}`
|
||||
)
|
||||
}))
|
||||
}
|
||||
2426
packages/bookshop/srv/external/API_BUSINESS_PARTNER.csn
vendored
2426
packages/bookshop/srv/external/API_BUSINESS_PARTNER.csn
vendored
File diff suppressed because it is too large
Load Diff
3261
packages/bookshop/srv/external/API_BUSINESS_PARTNER.edmx
vendored
3261
packages/bookshop/srv/external/API_BUSINESS_PARTNER.edmx
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,4 +0,0 @@
|
||||
BusinessPartner;FirstName;MiddleName;LastName;BusinessPartnerIsBlocked
|
||||
ALICE;Alice;In;Wonderland;false
|
||||
BOB;Bob;The;Builder;false
|
||||
JABBA;Jabba;The;Hutt;true
|
||||
|
19
packages/products/db/schema.cds
Normal file
19
packages/products/db/schema.cds
Normal file
@@ -0,0 +1,19 @@
|
||||
namespace sap.capire.products;
|
||||
|
||||
using { Currency, managed, sap.common.CodeList } from '@sap/cds/common';
|
||||
|
||||
entity Products : managed {
|
||||
key ID : String;
|
||||
title : localized String(111);
|
||||
descr : localized String(1111);
|
||||
stock : Integer;
|
||||
price : Decimal(9,2);
|
||||
currency : Currency;
|
||||
category : Association to Categories;
|
||||
}
|
||||
|
||||
entity Categories : CodeList {
|
||||
key ID : Integer;
|
||||
parent : Association to Categories;
|
||||
children : Composition of many Categories on children.parent = $self;
|
||||
}
|
||||
1
packages/products/index.cds
Normal file
1
packages/products/index.cds
Normal file
@@ -0,0 +1 @@
|
||||
using from './db/schema';
|
||||
15
packages/products/package.json
Normal file
15
packages/products/package.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "@sap/products",
|
||||
"version": "1.0.0",
|
||||
"description": "A reuse package providing domain models and services to manage product catalogs.",
|
||||
"repository": "https://github.com/SAP-samples/cloud-cap-samples.git",
|
||||
"license": "SAP SAMPLE CODE LICENSE",
|
||||
"dependencies": {
|
||||
"@sap/cds": "^3",
|
||||
"express": "^4"
|
||||
},
|
||||
"files": [
|
||||
"db",
|
||||
"index.cds"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user