Merged from master

This commit is contained in:
Daniel
2021-05-19 15:07:52 +02:00
6 changed files with 9 additions and 13 deletions

View File

@@ -70,7 +70,7 @@ annotate AdminService.Authors with @(
annotate sap.capire.bookshop.Books with @fiori.draft.enabled; annotate sap.capire.bookshop.Books with @fiori.draft.enabled;
annotate AdminService.Books with @odata.draft.enabled; annotate AdminService.Books with @odata.draft.enabled;
annotate AdminService.Books_texts with @( annotate AdminService.Books.texts with @(
UI: { UI: {
Identification: [{Value:title}], Identification: [{Value:title}],
SelectionFields: [ locale, title ], SelectionFields: [ locale, title ],
@@ -83,7 +83,7 @@ annotate AdminService.Books_texts with @(
); );
// Add Value Help for Locales // Add Value Help for Locales
annotate AdminService.Books_texts { annotate AdminService.Books.texts {
locale @ValueList:{entity:'Languages',type:#fixed} locale @ValueList:{entity:'Languages',type:#fixed}
} }
// In addition we need to expose Languages through AdminService // In addition we need to expose Languages through AdminService

View File

@@ -7,8 +7,8 @@
"@capire/orders": "*", "@capire/orders": "*",
"@capire/reviews": "*", "@capire/reviews": "*",
"@capire/suppliers": "*", "@capire/suppliers": "*",
"@sap/cds": ">=4", "@sap/cds": "^5",
"express": "^4", "express": "^4.17.1",
"passport": "^0.4.1" "passport": "^0.4.1"
}, },
"scripts": { "scripts": {

View File

@@ -2,6 +2,6 @@
"name": "@capire/orders", "name": "@capire/orders",
"version": "1.0.0", "version": "1.0.0",
"dependencies": { "dependencies": {
"@sap/cds": ">=4.3.0" "@sap/cds": "^5"
} }
} }

View File

@@ -7,7 +7,7 @@
"index.cds" "index.cds"
], ],
"dependencies": { "dependencies": {
"@sap/cds": ">=4", "@sap/cds": "^5",
"express": "^4.17.1" "express": "^4.17.1"
}, },
"scripts": { "scripts": {

View File

@@ -6,13 +6,9 @@ else cds.User = cds.User.Privileged // hard core monkey patch for older cds rele
describe('Custom Handlers', () => { describe('Custom Handlers', () => {
it('should reject out-of-stock orders', async () => { it('should reject out-of-stock orders', async () => {
await expect( await POST('/browse/submitOrder', { book: 201, amount: 5 })
Promise.all([ await POST('/browse/submitOrder', { book: 201, amount: 5 })
POST('/browse/submitOrder', { book: 201, amount: 5 }), await expect(POST('/browse/submitOrder', { book: 201, amount: 5 })).to.be.rejectedWith(/409 - 5 exceeds stock for book #201/)
POST('/browse/submitOrder', { book: 201, amount: 5 }),
POST('/browse/submitOrder', { book: 201, amount: 5 }),
])
).to.be.rejectedWith(/409 - 5 exceeds stock for book #201/)
const { data } = await GET`/admin/Books/201/stock/$value` const { data } = await GET`/admin/Books/201/stock/$value`
expect(data).to.equal(2) expect(data).to.equal(2)
}) })