This commit is contained in:
Daniel
2020-11-20 17:02:57 +01:00
parent 394a8b5d12
commit 7a776c53d2
3 changed files with 11 additions and 14 deletions

View File

@@ -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'},

View File

@@ -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
1 ID order_ID up__ID amount product_ID title price
2 58040e66-1dcd-4ffb-ab10-fdce32028b79 7e2f2640-6866-4dcf-8f4d-3027aa831cad 7e2f2640-6866-4dcf-8f4d-3027aa831cad 1 201 Wuthering Heights 11.11
3 64e718c9-ff99-47f1-8ca3-950c850777d4 7e2f2640-6866-4dcf-8f4d-3027aa831cad 7e2f2640-6866-4dcf-8f4d-3027aa831cad 1 271 Catweazle 15
4 e9641166-e050-4261-bfee-d1e797e6cb7f 64e718c9-ff99-47f1-8ca3-950c850777d4 64e718c9-ff99-47f1-8ca3-950c850777d4 2 252 Eleonora 28

View File

@@ -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 {