First push

This commit is contained in:
nkaputnik
2022-07-26 09:47:56 +02:00
parent 9617e576f0
commit 9c2a7598f2
16 changed files with 414 additions and 10438 deletions

View File

@@ -0,0 +1,2 @@
using from '..\..\schema';

View File

@@ -1,43 +1,49 @@
using { Currency, managed, sap, extensible } from '@sap/cds/common';
using {
Currency,
managed,
sap,
extensible
} from '@sap/cds/common';
namespace sap.capire.bookshop;
@Extensibility.Any.Enabled : true
entity Books : managed, extensible {
key ID : Integer;
title : localized String(111);
descr : localized String(1111);
author : Association to Authors;
genre : Association to Genres;
stock : Integer;
price : Decimal;
currency : Currency;
image : LargeBinary @Core.MediaType : 'image/png';
authorName: String;
key ID : Integer;
title : localized String(111);
descr : localized String(1111);
author : Association to Authors;
genre : Association to Genres;
stock : Integer;
price : Decimal;
currency : Currency;
image : LargeBinary @Core.MediaType : 'image/png';
authorName : String;
}
@Extensibility : {
Fields.Enabled : true,
Relations.Enabled : false,
Annotations.Enabled : true,
Logic.Enabled : true,
Logic.constraints: true,
Logic.calculations: true,
Logic.Handler : [create, update, delete, read]
}
entity Authors : managed, extensible {
key ID : Integer;
name : String(111);
dateOfBirth : Date;
dateOfDeath : Date;
placeOfBirth : String;
placeOfDeath : String;
virtual age: Integer;
books : Association to many Books on books.author = $self;
key ID : Integer;
name : String(111);
dateOfBirth : Date;
dateOfDeath : Date;
placeOfBirth : String;
placeOfDeath : String;
books : Association to many Books
on books.author = $self;
}
/** Hierarchically organized Code List for Genres */
entity Genres : sap.common.CodeList {
key ID : Integer;
parent : Association to Genres;
children : Composition of many Genres on children.parent = $self;
extend Authors with {
virtual age : Integer;
}
/**
* Hierarchically organized Code List for Genres
*/
entity Genres : sap.common.CodeList {
key ID : Integer;
parent : Association to Genres;
children : Composition of many Genres
on children.parent = $self;
}