18 lines
538 B
Plaintext
18 lines
538 B
Plaintext
using { sap.capire.bookshop.Books } from '@capire/bookshop/db/schema';
|
|
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;
|
|
total : Decimal(9,2) @readonly;
|
|
currency : Currency;
|
|
}
|
|
|
|
entity OrderItems : cuid {
|
|
parent : Association to Orders;
|
|
book : Association to Books;
|
|
amount : Integer;
|
|
netAmount : Decimal(9,2);
|
|
}
|