diff --git a/suppliers/.vscode/settings.json b/suppliers/.vscode/settings.json new file mode 100644 index 00000000..fc7d5517 --- /dev/null +++ b/suppliers/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "sbas.lcnc.isCockpitVisibile": true +} \ No newline at end of file diff --git a/suppliers/package.json b/suppliers/package.json index 1193c73b..d523c66d 100644 --- a/suppliers/package.json +++ b/suppliers/package.json @@ -17,7 +17,11 @@ "requires": { "API_BUSINESS_PARTNER": { "kind": "odata", - "model": "srv/external/API_BUSINESS_PARTNER" + "model": "srv/external/API_BUSINESS_PARTNER", + "credentials": { + "destination": "blub", + "url": "http://localhost:3333" + } }, "[development]": { "messaging": { diff --git a/suppliers/requests.http b/suppliers/requests.http index b6678750..423e1d7c 100644 --- a/suppliers/requests.http +++ b/suppliers/requests.http @@ -3,7 +3,7 @@ @bpServer = http://localhost:5001 @authAlice = Authorization: Basic alice: -PATCH {{bpServer}}/api-business-partner/A_BusinessPartner('ACME') +PATCH {{server}}/api-business-partner/A_BusinessPartner('ACME') Content-Type: application/json { diff --git a/suppliers/server.js b/suppliers/server.js index 69bcb13c..ed3ff51e 100644 --- a/suppliers/server.js +++ b/suppliers/server.js @@ -1,6 +1,9 @@ const cds = require ('@sap/cds') +console.log("serverjs") + require('./monkey-patch'); cds.once('served', require('./srv/mashup')) + module.exports = cds.server diff --git a/suppliers/srv/external/data/sap.capire.bookshop-Suppliers.csv b/suppliers/srv/external/data/sap.capire.bookshop-Suppliers.csv index 9648db87..1096eb4a 100644 --- a/suppliers/srv/external/data/sap.capire.bookshop-Suppliers.csv +++ b/suppliers/srv/external/data/sap.capire.bookshop-Suppliers.csv @@ -1,5 +1,6 @@ ID;name -ACME;A Company Making Everything (X) +ACME;A Company Making Everything (local) B4U;Books for You S&C;Shakespeare & Co. WSL;Waterstones + diff --git a/suppliers/srv/mashup.cds b/suppliers/srv/mashup.cds index c0bf86fe..3b7894f7 100644 --- a/suppliers/srv/mashup.cds +++ b/suppliers/srv/mashup.cds @@ -24,6 +24,16 @@ entity sap.capire.bookshop.Suppliers as projection on S4.A_BusinessPartner { // REVISIT: following is not supported so far in cqn2odata... // to_BusinessPartnerAddress.CityCode as city, // to_BusinessPartnerAddress.CityName as city_name, + + //// REVISIT: Should this be here or in the service, when it is only used for Fiori? + //// Compositions should work as well + //// The version with "virtual" is prefered, as this makes clear that the association is "added" here + // virtual books: Association to Books on book.supplier = $self, + // books2: Association to Books on book.supplier = $self, + //// Add virtual field, that does'nt exisits in the persistence or the underlying service + // virtual saveEnabled: Boolean +} excluding { + OrganizationBPName1, OrganizationBPName2,OrganizationBPName3, OrganizationBPName4, to_BuPaIdentification, to_BuPaIndustry, to_BusinessPartnerAddress, to_BusinessPartnerBank, to_BusinessPartnerContact, to_BusinessPartnerRole, to_BusinessPartnerTax, to_Customer, to_Supplier }