diff --git a/fiori/srv/mashup.cds b/fiori/srv/mashup.cds index 97f21771..e7fa90d8 100644 --- a/fiori/srv/mashup.cds +++ b/fiori/srv/mashup.cds @@ -19,7 +19,7 @@ extend Books with { // Extend Orders with Books as Products // -using { sap.capire.orders.Orders_Items } from '@capire/orders'; -extend Orders_Items with { +using { sap.capire.orders.Orders } from '@capire/orders'; +extend Orders.Items with { book : Association to Books on product.ID = book.ID } diff --git a/orders/app/orders/fiori-service.cds b/orders/app/orders/fiori-service.cds index 3a204ac8..efb5fb9a 100644 --- a/orders/app/orders/fiori-service.cds +++ b/orders/app/orders/fiori-service.cds @@ -11,6 +11,7 @@ using { OrdersService } from '../../srv/orders-service'; +using { sap.common } from '@capire/common'; @odata.draft.enabled @@ -77,13 +78,22 @@ annotate OrdersService.Orders.Items with @( {Value: amount, Label:'Quantity'}, ], Identification: [ //Is the main field group + {Value: product_ID, Label:'Product ID'}, + {Value: title, Label:'Product Title'}, {Value: amount, Label:'Amount'}, - {Value: title, Label:'Product'}, {Value: price, Label:'Unit Price'}, ], Facets: [ {$Type: 'UI.ReferenceFacet', Label: '{i18n>OrderItems}', Target: '@UI.Identification'}, ], + HeaderInfo: { + TypeName: 'Order Item', TypeNamePlural: 'Order Items', + Title: { + Label: 'Product ID ', //A label is possible but it is not considered on the ObjectPage yet + Value: product_ID + }, + Description: {Value: createdBy} + }, }, ) { amount @( diff --git a/orders/db/schema.cds b/orders/db/schema.cds index 322aa103..af6322ab 100644 --- a/orders/db/schema.cds +++ b/orders/db/schema.cds @@ -11,7 +11,7 @@ entity Orders : cuid, managed { entity Orders.Items { key ID : UUID; /*key*/ up_ : Association to Orders; // REVISIT: 'key' doesn't work due to bug in runtime - product : Association to Products @assert.integrity:false; // REVISIT: this is a temporary workaround for a glitch in cds-runtime + product : Association to Products; amount : Integer; title : String; //> intentionally replicated as snapshot from product.title or alike price : Double; @@ -21,7 +21,3 @@ entity Orders.Items { entity Products @(cds.persistence.skip:'always') { key ID : String; } - - -// REVISIT: below is a workaround for a GAP in Fiori elements, which crashes for proxies -// annotate Products with @cds.autoexpose; \ No newline at end of file diff --git a/orders/o-v4.edmx b/orders/o-v4.edmx deleted file mode 100644 index 4e2b134a..00000000 --- a/orders/o-v4.edmx +++ /dev/null @@ -1,473 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - createdAt - createdBy - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/orders/o-w4.edmx b/orders/o-w4.edmx deleted file mode 100644 index 77eb80ab..00000000 --- a/orders/o-w4.edmx +++ /dev/null @@ -1,443 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - createdAt - createdBy - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/orders/o-x4-with-product-entity.edmx b/orders/o-x4-with-product-entity.edmx deleted file mode 100644 index 873aadb2..00000000 --- a/orders/o-x4-with-product-entity.edmx +++ /dev/null @@ -1,413 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - createdAt - createdBy - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/orders/o-x4-with-product-proxy.edmx b/orders/o-x4-with-product-proxy.edmx deleted file mode 100644 index 3872f55f..00000000 --- a/orders/o-x4-with-product-proxy.edmx +++ /dev/null @@ -1,414 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - createdAt - createdBy - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/orders/srv/orders-service.js b/orders/srv/orders-service.js index 10420410..639f23ca 100644 --- a/orders/srv/orders-service.js +++ b/orders/srv/orders-service.js @@ -3,7 +3,7 @@ class OrdersService extends cds.ApplicationService { /** register custom handlers */ init(){ - const { Orders_Items:OrderItems } = this.entities + const { 'Orders.Items':OrderItems } = this.entities this.before ('UPDATE', 'Orders', async function(req) { const { ID, Items } = req.data