From 673fec080ab6cd18ae551d78593452bfff81d085 Mon Sep 17 00:00:00 2001 From: D050513 Date: Sun, 30 Jul 2023 22:49:59 +0200 Subject: [PATCH] more --- gdpr/srv/log-service.cds | 15 ++++++------ gdpr/srv/pdm-service.cds | 49 ++++++++++++++++++++-------------------- 2 files changed, 31 insertions(+), 33 deletions(-) diff --git a/gdpr/srv/log-service.cds b/gdpr/srv/log-service.cds index 03ba7267..819f6c26 100644 --- a/gdpr/srv/log-service.cds +++ b/gdpr/srv/log-service.cds @@ -1,14 +1,13 @@ -using {sap.capire.bookshop as db} from '../db/data-privacy'; -using {sap.capire.orders as dbo} from '../db/data-privacy'; -using {sap.capire.auditLog as log} from '../db/AuditLogStore.cds'; +using {sap.capire.bookshop as db} from '../db/data-privacy'; +using {sap.capire.orders as dbo} from '../db/data-privacy'; +using {sap.capire.auditLog as log} from '../db/AuditLogStore.cds'; //@requires: 'PersonalDataManagerUser' // security check service LogService { - entity Customers as projection on db.Customers; - entity CustomerPostalAddress as projection on db.CustomerPostalAddress; - entity Orders as projection on dbo.Orders; + entity Customers as projection on db.Customers; + entity Addresses as projection on db.Addresses; + entity Orders as projection on dbo.Orders; + entity AuditLogStore as projection on log.AuditLogStore; - entity AuditLogStore as projection on log.AuditLogStore; - }; diff --git a/gdpr/srv/pdm-service.cds b/gdpr/srv/pdm-service.cds index 94150d61..458ffc8a 100644 --- a/gdpr/srv/pdm-service.cds +++ b/gdpr/srv/pdm-service.cds @@ -1,44 +1,43 @@ -using {sap.capire.bookshop as db} from '../db/data-privacy'; -using {sap.capire.bookshop.Books} from '../db/data-privacy'; -using {sap.capire.orders.Orders} from '../db/data-privacy'; -using {sap.capire.orders.OrderItems} from '../db/data-privacy'; +using {sap.capire.bookshop as db} from '../db/data-privacy'; +using {sap.capire.bookshop.Books} from '../db/data-privacy'; +using {sap.capire.orders.Orders} from '../db/data-privacy'; +using {sap.capire.orders.OrderItems} from '../db/data-privacy'; //@requires: 'PersonalDataManagerUser' // security check service PDMService { - entity Customers as projection on db.Customers; - entity CustomerPostalAddress as projection on db.CustomerPostalAddress; - entity CustomerBillingData as projection on db.CustomerBillingData; + // Data Privacy annotations on 'Customers', 'Addresses', and 'BillingData' are derived from original entity definitions + entity Customers as projection on db.Customers; + entity Addresses as projection on db.Addresses; + entity BillingData as projection on db.BillingData; // create view on Orders and Items as flat projection - entity OrderItemView as + entity OrderItemView as select from Orders { ID, - key Items.ID as Item_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 + 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 : 'Other') { - Item_ID @PersonalData.FieldSemantics : 'ContractRelatedID'; - Customer_ID @PersonalData.FieldSemantics : 'DataSubjectID'; - Customer_Email @PersonalData.IsPotentiallyPersonal; + annotate PDMService.OrderItemView with @(PersonalData.EntitySemantics: 'Other') { + item_ID @PersonalData.FieldSemantics: 'ContractRelatedID'; + customer_ID @PersonalData.FieldSemantics: 'DataSubjectID'; + customer_email @PersonalData.IsPotentiallyPersonal; }; // annotations for Personal Data Manager - Search Fields - annotate Customers with @(Communication.Contact : { - n : { - surname : lastName, - given : firstName + annotate Customers with @(Communication.Contact: { + n : { + surname: lastName, + given : firstName }, - bday : dateOfBirth + bday: dateOfBirth }); - // Data Privacy annotations on 'Customers' and 'CustomerPostalAddress' are derived from original entity definitions - };