This commit is contained in:
Daniel
2020-03-02 00:08:49 +01:00
parent d9df2930cb
commit 26d7fc767c
71 changed files with 141 additions and 34 deletions

View File

@@ -1,11 +1,12 @@
namespace sap.capire.bookshop;
using { Currency, managed, cuid } from '@sap/cds/common';
using { Currency, managed, cuid, sap } from '@sap/cds/common';
entity Books : managed {
key ID : Integer;
title : localized String(111);
descr : localized String(1111);
author : Association to Authors;
genre : Association to Genres;
stock : Integer;
price : Decimal(9,2);
currency : Currency;
@@ -21,6 +22,12 @@ entity Authors : managed {
books : Association to many Books on books.author = $self;
}
entity Genres : sap.common.CodeList {
key ID : Integer;
parent : Association to Genres;
children : Composition of many Genres on children.parent = $self;
}
entity Orders : cuid, managed {
OrderNo : String @title:'Order Number'; //> readable key
Items : Composition of many OrderItems on Items.parent = $self;