This commit is contained in:
D065023
2020-01-28 18:14:24 +01:00
parent fa880e2987
commit 29840afc0b
2 changed files with 4 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
ID;modifiedAt;createdAt;createdBy;modifiedBy;OrderNo;currency_code ID;modifiedAt;createdAt;createdBy;modifiedBy;OrderNo;currency_code
7e2f2640-6866-4dcf-8f4d-3027aa831cad;;2019-01-31;ALICE;;1;EUR 7e2f2640-6866-4dcf-8f4d-3027aa831cad;;2019-01-31;ALICE;;1;EUR
7f2f2640-6866-4dcf-8f4d-3027aa831cad;;2019-03-25;ALICE;;10;EUR
64e718c9-ff99-47f1-8ca3-950c850777d4;;2019-01-30;BOB;;2;EUR 64e718c9-ff99-47f1-8ca3-950c850777d4;;2019-01-30;BOB;;2;EUR
1 ID modifiedAt createdAt createdBy modifiedBy OrderNo currency_code
2 7e2f2640-6866-4dcf-8f4d-3027aa831cad 2019-01-31 ALICE 1 EUR
3 7f2f2640-6866-4dcf-8f4d-3027aa831cad 2019-03-25 ALICE 10 EUR
4 64e718c9-ff99-47f1-8ca3-950c850777d4 2019-01-30 BOB 2 EUR

View File

@@ -11,7 +11,9 @@ module.exports = cds.service.impl(async function () {
console.log('>> Received message', msg.data) console.log('>> Received message', msg.data)
const BUSINESSPARTNER = msg.data.KEY[0].BUSINESSPARTNER const BUSINESSPARTNER = msg.data.KEY[0].BUSINESSPARTNER
const orders = await cds.tx(msg).run(SELECT.from(Orders).where({ createdBy: BUSINESSPARTNER })) const orders = await cds.tx(msg).run(SELECT.from(Orders).where({ createdBy: BUSINESSPARTNER }))
this.emit('ContactDetailsChanged', { orders }) const payload = { orders }
this.emit('ContactDetailsChanged', payload)
console.log('<< Emitting message', payload)
}) })
/** Add some discount for overstocked books */ /** Add some discount for overstocked books */