it works
This commit is contained in:
@@ -18,8 +18,7 @@
|
|||||||
"API_BUSINESS_PARTNER": {
|
"API_BUSINESS_PARTNER": {
|
||||||
"kind": "odata",
|
"kind": "odata",
|
||||||
"model": "srv/external/API_BUSINESS_PARTNER",
|
"model": "srv/external/API_BUSINESS_PARTNER",
|
||||||
"--credentials": {
|
"credentials": { "destination": "cap-api532" }
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"messaging": {
|
"messaging": {
|
||||||
"kind": "enterprise-messaging"
|
"kind": "enterprise-messaging"
|
||||||
@@ -30,9 +29,7 @@
|
|||||||
"strategy": "mock",
|
"strategy": "mock",
|
||||||
"users": {
|
"users": {
|
||||||
"alice": {
|
"alice": {
|
||||||
"roles": [
|
"roles": ["admin"],
|
||||||
"admin"
|
|
||||||
],
|
|
||||||
"password": "secret",
|
"password": "secret",
|
||||||
"ID": "ALICE"
|
"ID": "ALICE"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,21 +20,20 @@ const _qlsToUpdateDifferences = (ownAddresses, remoteAddresses) =>
|
|||||||
)
|
)
|
||||||
if (remoteAddress) {
|
if (remoteAddress) {
|
||||||
const diff = _diff(ownAddress, remoteAddress)
|
const diff = _diff(ownAddress, remoteAddress)
|
||||||
return (
|
if(Object.keys(diff).length) {
|
||||||
Object.keys(diff).length &&
|
console.log('changing', diff)
|
||||||
console.log('changing', diff) &&
|
return UPDATE(ShippingAddresses)
|
||||||
UPDATE(ShippingAddresses)
|
|
||||||
.set(diff)
|
.set(diff)
|
||||||
.where({
|
.where({
|
||||||
BusinessPartner: ownAddress.BusinessPartner,
|
BusinessPartner: ownAddress.BusinessPartner,
|
||||||
AddressID: ownAddress.AddressID
|
AddressID: ownAddress.AddressID
|
||||||
})
|
})
|
||||||
)
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.filter(el => el)
|
.filter(el => el)
|
||||||
|
|
||||||
bupaSrv.on('sap/messaging/ccf/BO/BusinessPartner/Changed', async msg => {
|
bupaSrv.on('sap/S4HANAOD/c532/BO/BusinessPartner/Changed', async msg => {
|
||||||
console.log('>> Message:', msg.data)
|
console.log('>> Message:', msg.data)
|
||||||
|
|
||||||
const BusinessPartner = msg.data.KEY[0].BUSINESSPARTNER
|
const BusinessPartner = msg.data.KEY[0].BUSINESSPARTNER
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ module.exports = srv => {
|
|||||||
KEY: [{ BUSINESSPARTNER: req.data.BusinessPartner }]
|
KEY: [{ BUSINESSPARTNER: req.data.BusinessPartner }]
|
||||||
}
|
}
|
||||||
console.log('<< Message:', payload)
|
console.log('<< Message:', payload)
|
||||||
srv.emit('sap/messaging/ccf/BO/BusinessPartner/Changed', payload)
|
srv.emit('sap/S4HANAOD/c532/BO/BusinessPartner/Changed', payload)
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user