Files
cloud-cap-samples/orders/db/schema.cds
Christian Georgi 1b69064752 Make cuid.ID Core.Computed for now
+ TODO to check w/ Fiori
2020-07-31 17:18:14 +02:00

21 lines
714 B
Plaintext

using { sap.capire.bookshop.Books } from '@capire/bookshop';
using { Currency, managed, cuid } from '@sap/cds/common';
namespace sap.capire.bookshop;
entity Orders : cuid, managed {
OrderNo : String @title:'Order Number'; //> readable key
Items : Composition of many OrderItems on Items.parent = $self;
currency : Currency;
}
entity OrderItems : cuid {
parent : Association to Orders;
book : Association to Books;
amount : Integer;
netAmount : Decimal(9,2);
}
// Have IDs auto-computed. TODO revisit w/ Fiori how long this is needed
// see https://answers.sap.com/questions/13091274/sample-fiori-app-creating-a-new-order-shows-a-popu.html
annotate cuid with { ID @Core.Computed; }