Moving lifetime + age to where it is used

Signed-off-by: Daniel <daniel.hutzel@sap.com>
This commit is contained in:
Daniel
2021-11-24 19:30:47 +01:00
committed by Daniel Hutzel
parent 33380c0792
commit 19b680ab3d
6 changed files with 13 additions and 20 deletions

View File

@@ -1,8 +0,0 @@
using { sap.capire.bookshop } from '@capire/bookshop';
// Forward-declare calculated fields to be filled in database-specific ways
// TODO find a better way to have 'default' fields that still can be overwritten.
extend bookshop.Authors with {
virtual age: Integer;
virtual lifetime: String;
}

View File

@@ -1,4 +1,2 @@
namespace sap.capire.bookshop; //> important for reflection
using from '@capire/bookshop';
using from './db/schema';
using from './srv/mashup';

View File

@@ -25,13 +25,7 @@
"[production]": { "kind": "enterprise-messaging" }
},
"db": {
"kind": "sql",
"[development]": {
"model": "db/sqlite"
},
"[production]": {
"model": "db/hana"
}
"kind": "sql"
}
},
"log": { "service": true }

View File

@@ -2,7 +2,7 @@
// Add Author.age and .lifetime with a DB-specific function
//
using { AdminService } from '../schema';
using { AdminService } from '@capire/bookshop';
extend projection AdminService.Authors with {
YEARS_BETWEEN(dateOfBirth, dateOfDeath) as age: Integer,

View File

@@ -2,7 +2,7 @@
// Add Author.age and .lifetime with a DB-specific function
//
using { AdminService } from '../schema';
using { AdminService } from '@capire/bookshop';
extend projection AdminService.Authors with {
strftime('%Y',dateOfDeath)-strftime('%Y',dateOfBirth) as age: Integer,

View File

@@ -29,6 +29,15 @@
"[development]": { "kind": "file-based-messaging" },
"[hybrid!]": { "kind": "enterprise-messaging-shared" }
},
"db": {
"kind": "sql",
"[development]": {
"model": "db/sqlite"
},
"[production]": {
"model": "db/hana"
}
},
"hana": {
"deploy-format": "hdbtable"
}