From a14c0e4eeb314087d56765c7db9d234d47de9bf9 Mon Sep 17 00:00:00 2001 From: Wolfgang Koch Date: Fri, 13 Nov 2020 12:02:01 +0100 Subject: [PATCH] pdm binding --- gdpr/db/data-privacy.cds | 2 ++ gdpr/srv/pdm-service.cds | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gdpr/db/data-privacy.cds b/gdpr/db/data-privacy.cds index a505dee5..96501959 100644 --- a/gdpr/db/data-privacy.cds +++ b/gdpr/db/data-privacy.cds @@ -2,6 +2,7 @@ using { sap.capire.bookshop } from './schema'; // annotations for Data Privacy +annotate bookshop.Customers with @PersonalData.DataSubjectRole: 'Customer'; annotate bookshop.Customers with @PersonalData.EntitySemantics: 'DataSubject' { ID @PersonalData.FieldSemantics: 'DataSubjectID'; @@ -12,6 +13,7 @@ annotate bookshop.Customers with @PersonalData.EntitySemantics: 'DataSubject' dateOfBirth @PersonalData.IsPotentiallyPersonal; } +annotate bookshop.CustomerPostalAddress with @PersonalData.DataSubjectRole: 'Customer'; annotate bookshop.CustomerPostalAddress with @PersonalData.EntitySemantics: 'DataSubjectDetails' { Customer @PersonalData.FieldSemantics: 'DataSubjectID'; diff --git a/gdpr/srv/pdm-service.cds b/gdpr/srv/pdm-service.cds index 6e1e27e6..2fe68a04 100644 --- a/gdpr/srv/pdm-service.cds +++ b/gdpr/srv/pdm-service.cds @@ -14,7 +14,7 @@ using { sap.capire.bookshop.OrderItems } from '@capire/orders'; // create view on Orders and Items as flat projection entity OrderItemView as SELECT from Orders - { key ID, + { ID, key Items.ID as Item_ID, OrderNo, Customer.ID as Customer_ID, @@ -25,11 +25,15 @@ using { sap.capire.bookshop.OrderItems } from '@capire/orders'; // annotate new view annotate PDMService.OrderItemView with @(PersonalData.EntitySemantics: 'LegalGround') - { + { + Item_ID @PersonalData.FieldSemantics: 'LegalGroundID'; Customer_ID @PersonalData.FieldSemantics: 'DataSubjectID'; Customer_Email @PersonalData.IsPotentiallyPersonal; }; + annotate Customers with @PersonalData.DataSubjectRole: 'Customer'; + annotate CustomerPostalAddress with @PersonalData.DataSubjectRole: 'Customer'; + annotate PDMService.OrderItemView with @PersonalData.DataSubjectRole: 'Customer'; // Data Privacy annotations on 'Customers' and 'CustomerPostalAddress' are derived from original entity definitions }; \ No newline at end of file