Update for unit 6

This commit is contained in:
Elena Oresharova
2020-02-09 13:13:02 +01:00
parent 13480ad99e
commit edc2fdae91
95 changed files with 52 additions and 2635 deletions

View File

@@ -1,35 +1,8 @@
namespace sap.capire.bookshop;
using { Currency, managed, cuid } from '@sap/cds/common';
entity Books : managed {
key ID : Integer;
title : localized String(111);
descr : localized String(1111);
author : Association to Authors;
stock : Integer;
price : Decimal(9,2);
currency : Currency;
}
entity Authors : managed {
key ID : Integer;
name : String(111);
dateOfBirth : Date;
dateOfDeath : Date;
placeOfBirth : String;
placeOfDeath : String;
books : Association to many Books on books.author = $self;
}
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);
@cds.persistence.exists
entity Books {
key ID: UUID;
title : String(111);
descr : String(1111);
}