From 7a776c53d2fd7bacb08c1135dc83da63f318d2ea Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 20 Nov 2020 17:02:57 +0100 Subject: [PATCH] . --- orders/app/orders/fiori-service.cds | 4 ++-- .../db/data/sap.capire.orders-OrderItems.csv | 2 +- orders/db/schema.cds | 19 ++++++++----------- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/orders/app/orders/fiori-service.cds b/orders/app/orders/fiori-service.cds index 99356ea9..e58c8ccd 100644 --- a/orders/app/orders/fiori-service.cds +++ b/orders/app/orders/fiori-service.cds @@ -10,7 +10,7 @@ -using { OrdersService, sap.capire.orders.OrderItems } from '../../srv/orders-service'; +using { OrdersService } from '../../srv/orders-service'; @odata.draft.enabled @@ -68,7 +68,7 @@ annotate OrdersService.Orders with @( -annotate OrderItems with @( +annotate OrdersService.Orders_Items with @( UI: { LineItem: [ {Value: product_ID, Label:'Product ID'}, diff --git a/orders/db/data/sap.capire.orders-OrderItems.csv b/orders/db/data/sap.capire.orders-OrderItems.csv index a3349b28..b3025abe 100644 --- a/orders/db/data/sap.capire.orders-OrderItems.csv +++ b/orders/db/data/sap.capire.orders-OrderItems.csv @@ -1,4 +1,4 @@ -ID;order_ID;amount;product_ID;title;price +ID;up__ID;amount;product_ID;title;price 58040e66-1dcd-4ffb-ab10-fdce32028b79;7e2f2640-6866-4dcf-8f4d-3027aa831cad;1;201;Wuthering Heights;11.11 64e718c9-ff99-47f1-8ca3-950c850777d4;7e2f2640-6866-4dcf-8f4d-3027aa831cad;1;271;Catweazle;15 e9641166-e050-4261-bfee-d1e797e6cb7f;64e718c9-ff99-47f1-8ca3-950c850777d4;2;252;Eleonora;28 \ No newline at end of file diff --git a/orders/db/schema.cds b/orders/db/schema.cds index 1cde2e22..920d27d2 100644 --- a/orders/db/schema.cds +++ b/orders/db/schema.cds @@ -4,21 +4,18 @@ namespace sap.capire.orders; entity Orders : cuid, managed { OrderNo : String @title:'Order Number'; //> readable key - Items : Composition of many OrderItems on Items.order = $self; + Items : Composition of many { + key ID : UUID; + @assert.integrity:false // REVISIT: this is a temporary workaround for a glitch in cds-runtime + product : Association to Products; + amount : Integer; + title : String; + price : Double; + }; buyer : User; currency : Currency; } -entity OrderItems { - key ID : UUID; - order : Association to Orders; - @assert.integrity:false // REVISIT: this is a temporary workaround for a glitch in cds-runtime - product : Association to Products; - amount : Integer; - title : String; - price : Double; -} - /** This is a stand-in for arbitrary ordered Products */ @cds.persistence.skip:'always' entity Products {