This commit is contained in:
Koch
2023-04-21 14:59:10 +02:00
parent 57d7d66533
commit f872286440
3 changed files with 19 additions and 19 deletions

View File

@@ -1,25 +1,22 @@
<<<<<<< HEAD using { sap.capire.bookshop.Books } from '../../bookshop/db/schema';
using { sap.capire.bookshop.Books } from '../../bookshop/db/schema'; using { User, Currency, managed, cuid } from '../../common';
using { Currency, managed, cuid } from '@sap/cds/common';
namespace sap.capire.bookshop;
=======
using { Currency, User, managed, cuid } from '@sap/cds/common';
namespace sap.capire.orders; namespace sap.capire.orders;
>>>>>>> 534af7ffee60e086c563dbaa450e86e5fca5cf2b
entity Orders : cuid, managed { entity Orders : cuid, managed {
OrderNo : String(22) @title:'Order Number'; //> readable key OrderNo : String(22) @title:'Order Number'; //> readable key
Items : Composition of many { Items : Composition of many OrderItems;
key ID : UUID;
product : Association to Products;
quantity : Integer;
title : String; //> intentionally replicated as snapshot from product.title
price : Double; //> materialized calculated field
};
buyer : User; buyer : User;
currency : Currency; currency : Currency;
} }
entity OrderItems : cuid, managed {
book : Association to Products;
quantity : Integer;
title : String; //> intentionally replicated as snapshot from product.title
amount : Double; //> materialized calculated field
netAmount : Double;
}
/** This is a stand-in for arbitrary ordered Products */ /** This is a stand-in for arbitrary ordered Products */
entity Products @(cds.persistence.skip:'always') { entity Products @(cds.persistence.skip:'always') {
key ID : String; key ID : String;
@@ -27,4 +24,4 @@ entity Products @(cds.persistence.skip:'always') {
// this is to ensure we have filled-in currencies // this is to ensure we have filled-in currencies
using from '@capire/common'; // using from '@capire/common';

6
package-lock.json generated
View File

@@ -21,6 +21,12 @@
"./reviews" "./reviews"
], ],
"dependencies": { "dependencies": {
"@capire/bookshop": "./bookshop",
"@capire/common": "./common",
"@capire/fiori": "./fiori",
"@capire/media": "./media",
"@capire/orders": "./orders",
"@capire/reviews": "./reviews",
"@sap/cds": ">=5.5.3" "@sap/cds": ">=5.5.3"
}, },
"devDependencies": { "devDependencies": {

View File

@@ -5,16 +5,13 @@
"repository": "https://github.com/sap-samples/cloud-cap-samples.git", "repository": "https://github.com/sap-samples/cloud-cap-samples.git",
"author": "daniel.hutzel@sap.com", "author": "daniel.hutzel@sap.com",
"dependencies": { "dependencies": {
<<<<<<< HEAD
"@capire/bookshop": "./bookshop", "@capire/bookshop": "./bookshop",
"@capire/common": "./common", "@capire/common": "./common",
"@capire/fiori": "./fiori", "@capire/fiori": "./fiori",
"@capire/media": "./media", "@capire/media": "./media",
"@capire/orders": "./orders", "@capire/orders": "./orders",
"@capire/reviews": "./reviews" "@capire/reviews": "./reviews",
=======
"@sap/cds": ">=5.5.3" "@sap/cds": ">=5.5.3"
>>>>>>> 534af7ffee60e086c563dbaa450e86e5fca5cf2b
}, },
"workspaces": [ "workspaces": [
"./bookshop", "./bookshop",