Using fake Products entity in @capire/orders

This commit is contained in:
Daniel
2020-11-20 12:33:18 +01:00
committed by Daniel Hutzel
parent 932f56812c
commit 8f01bf911e
6 changed files with 25 additions and 18 deletions

View File

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

View File

@@ -12,8 +12,15 @@ entity Orders : cuid, managed {
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;
article : String; //> to allow for arbitrary keys
title : String;
price : Double;
}
/** This is a stand-in for arbitrary ordered Products */
@cds.persistence.skip:'always'
entity Products {
key ID : String;
}