Update code sample
This commit is contained in:
@@ -1,12 +0,0 @@
|
|||||||
namespace sap.capire.bookshop;
|
|
||||||
|
|
||||||
using { Currency, managed } from '@sap/cds/common';
|
|
||||||
|
|
||||||
entity Products : managed {
|
|
||||||
key ID : Integer;
|
|
||||||
title : localized String(111);
|
|
||||||
descr : localized String(1111);
|
|
||||||
stock : Integer;
|
|
||||||
price : Decimal(9,2);
|
|
||||||
currency : Currency;
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace sap.capire.bookshop;
|
namespace sap.capire.bookshop;
|
||||||
using { Currency, managed, cuid } from '@sap/cds/common';
|
using { Currency, managed, cuid } from '@sap/cds/common';
|
||||||
using { sap.capire.bookshop.Products } from './products';
|
using { sap.capire.products.Products } from '../../products';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
entity Books : managed {
|
entity Books : managed {
|
||||||
|
|||||||
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": "latest",
|
||||||
|
"express": "*"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"db",
|
||||||
|
"index.cds"
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user