cosmetics

This commit is contained in:
Daniel Hutzel
2025-01-31 14:42:40 +01:00
parent 8c6ba30673
commit 23bea0f629
2 changed files with 52 additions and 52 deletions

View File

@@ -28,8 +28,8 @@ module.exports = async()=>{ // called by server.js
// //
CatalogService.on ('OrderedBook', async (msg) => { CatalogService.on ('OrderedBook', async (msg) => {
const { book, quantity, buyer } = msg.data const { book, quantity, buyer } = msg.data
const { title, price } = await db.tx(msg).read (Books, book, b => { b.title, b.price }) const { title, price } = await db.read (Books, book, b => { b.title, b.price })
return OrdersService.tx(msg).create ('Orders').entries({ return OrdersService.create ('Orders').entries({
OrderNo: 'Order at '+ (new Date).toLocaleString(), OrderNo: 'Order at '+ (new Date).toLocaleString(),
Items: [{ product:{ID:`${book}`}, title, price, quantity }], Items: [{ product:{ID:`${book}`}, title, price, quantity }],
buyer, createdBy: buyer buyer, createdBy: buyer

View File

@@ -1,51 +1,51 @@
{ {
"name": "@capire/samples", "name": "@capire/samples",
"version": "2.1.0", "version": "2.1.0",
"description": "A monorepo with several samples for CAP.", "description": "A monorepo with several samples for CAP.",
"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": {
"@sap/cds": ">=8" "@sap/cds": ">=8"
}, },
"workspaces": [ "workspaces": [
"./bookshop", "./bookshop",
"./bookstore", "./bookstore",
"./common", "./common",
"./data-viewer", "./data-viewer",
"./fiori", "./fiori",
"./hello", "./hello",
"./media", "./media",
"./orders", "./orders",
"./loggers", "./loggers",
"./reviews" "./reviews"
], ],
"devDependencies": { "devDependencies": {
"@cap-js/cds-types": "^0", "@cap-js/cds-types": "^0",
"@cap-js/sqlite": "^1", "@cap-js/sqlite": "^1",
"axios": "^1", "axios": "^1",
"chai": "^4.3.4", "chai": "^4.3.4",
"chai-as-promised": "^7.1.1", "chai-as-promised": "^7.1.1",
"chai-subset": "^1.6.0", "chai-subset": "^1.6.0",
"eslint": "^9", "eslint": "^9",
"semver": "^7" "semver": "^7"
}, },
"scripts": { "scripts": {
"bookshop": "cds watch bookshop", "bookshop": "cds watch bookshop",
"start": "cds watch fiori", "start": "cds watch fiori",
"fiori": "cds watch fiori", "fiori": "cds watch fiori",
"hello": "cds watch hello", "hello": "cds watch hello",
"media": "cds watch media", "media": "cds watch media",
"lint": "eslint", "lint": "eslint",
"test": "npx jest --silent", "test": "npx jest --silent",
"jest": "npx jest --silent", "jest": "npx jest --silent",
"mocha": "CDS_TEST_SILENT=y npx mocha", "mocha": "CDS_TEST_SILENT=y npx mocha",
"test:hello": "cd hello && npm test" "test:hello": "cd hello && npm test"
}, },
"mocha": { "mocha": {
"recursive": true, "recursive": true,
"parallel": true, "parallel": true,
"timeout": 6666 "timeout": 6666
}, },
"license": "SEE LICENSE IN LICENSE", "license": "SEE LICENSE IN LICENSE",
"private": true "private": true
} }