pdm annotations

This commit is contained in:
Wolfgang Koch
2021-02-12 11:52:36 +01:00
parent caab8ed120
commit cd3f139544
2 changed files with 70 additions and 57 deletions

View File

@@ -1,36 +1,35 @@
//using from '@capire/orders';
using { sap.capire.bookshop as db } from '../db/data-privacy';
using { sap.capire.bookshop.Books } from '@capire/bookshop';
using { sap.capire.bookshop.Orders } from '@capire/orders';
using { sap.capire.bookshop.OrderItems } from '@capire/orders';
using {sap.capire.bookshop as db} from '../db/data-privacy';
using {sap.capire.bookshop.Books} from '@capire/bookshop';
using {sap.capire.bookshop.Orders} from '@capire/orders';
using {sap.capire.bookshop.OrderItems} from '@capire/orders';
//@requires: 'system-user'
service PDMService {
// @requires:'system-user' - todo - security check
service PDMService{
entity Customers as projection on db.Customers;
entity Customers as projection on db.Customers;
entity CustomerPostalAddress as projection on db.CustomerPostalAddress;
entity CustomerPostalAddress as projection on db.CustomerPostalAddress;
// create view on Orders and Items as flat projection
entity OrderItemView as
select from Orders {
ID,
key Items.ID as Item_ID,
OrderNo,
Customer.ID as Customer_ID,
Customer.email as Customer_Email,
Items.book.ID as Item_Book_ID,
Items.amount as Item_Amount,
Items.netAmount as Item_NetAmount
};
// create view on Orders and Items as flat projection
entity OrderItemView as
SELECT from Orders
{ ID,
key Items.ID as Item_ID,
OrderNo,
Customer.ID as Customer_ID,
Customer.email as Customer_Email,
Items.book.ID as Item_Book_ID,
Items.amount as Item_Amount,
Items.netAmount as Item_NetAmount};
// annotate new view
annotate PDMService.OrderItemView with @(PersonalData.EntitySemantics: 'ContractRelated')
{
Item_ID @PersonalData.FieldSemantics: 'LegalGroundID';
Customer_ID @PersonalData.FieldSemantics: 'DataSubjectID';
Customer_Email @PersonalData.IsPotentiallyPersonal;
};
// annotate new view
annotate PDMService.OrderItemView with @(PersonalData.EntitySemantics : 'Other') {
Item_ID @PersonalData.FieldSemantics : 'ContractRelatedID';
Customer_ID @PersonalData.FieldSemantics : 'DataSubjectID';
Customer_Email @PersonalData.IsPotentiallyPersonal;
};
// Data Privacy annotations on 'Customers' and 'CustomerPostalAddress' are derived from original entity definitions
// Data Privacy annotations on 'Customers' and 'CustomerPostalAddress' are derived from original entity definitions
};
};