pdm service
This commit is contained in:
3
gdpr/db/data/sap.capire.bookshop-Customers.csv
Normal file
3
gdpr/db/data/sap.capire.bookshop-Customers.csv
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
ID;modifiedAt;createdAt;createdBy;modifiedBy;Email;FirstName;LastName;CreditCardNo;dateOfBirth
|
||||||
|
8e2f2640-6866-4dcf-8f4d-3027aa831cad;2019-04-04;2019-01-31;admin@business.com;admin@business.com;john.doe@test.com;John;Doe;9977-6655-4433-2211;1970-01-01
|
||||||
|
74e718c9-ff99-47f1-8ca3-950c850777d4;2019-04-04;2019-01-30;admin@business.com;admin@business.com;jane.doe@sap.com;Jane;Doe;2211-3344-5566-7788;1980-11-11
|
||||||
|
3
gdpr/db/data/sap.capire.bookshop-Orders.csv
Normal file
3
gdpr/db/data/sap.capire.bookshop-Orders.csv
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
ID;modifiedAt;createdAt;createdBy;modifiedBy;OrderNo;Customer_ID;currency_code
|
||||||
|
7e2f2640-6866-4dcf-8f4d-3027aa831cad;2019-04-04;2019-01-31;john.doe@test.com;john.doe@test.com;1;8e2f2640-6866-4dcf-8f4d-3027aa831cad;USD
|
||||||
|
64e718c9-ff99-47f1-8ca3-950c850777d4;2019-04-04;2019-01-30;jane.doe@test.com;jane.doe@test.com;2;74e718c9-ff99-47f1-8ca3-950c850777d4;USD
|
||||||
|
@@ -1,24 +1,14 @@
|
|||||||
// Proxy for importing schema from bookshop sample
|
// Proxy for importing schema from bookshop sample
|
||||||
using from '@capire/bookshop';
|
using { sap.capire.bookshop.Books } from '@capire/bookshop';
|
||||||
using { Currency, managed, cuid } from '@sap/cds/common';
|
using { sap.capire.bookshop.Orders } from '@capire/orders';
|
||||||
|
using { sap.capire.bookshop.OrderItems } from '@capire/orders';
|
||||||
|
using { Currency, managed, cuid } from '@sap/cds/common';
|
||||||
|
|
||||||
namespace sap.capire.bookshop;
|
namespace sap.capire.bookshop;
|
||||||
|
|
||||||
entity Orders : managed {
|
extend Orders with {
|
||||||
key ID : cds.UUID;
|
Customer : Association to Customers;
|
||||||
OrderNo : String @title:'Order Number'; //> readable key
|
}
|
||||||
Customer : Association to Customers;
|
|
||||||
Items : Composition of many OrderItems on Items.parent = $self;
|
|
||||||
total : Decimal(9,2) @readonly;
|
|
||||||
currency : Currency;
|
|
||||||
}
|
|
||||||
entity OrderItems {
|
|
||||||
key ID : cds.UUID;
|
|
||||||
parent : Association to Orders not null;
|
|
||||||
book : Association to bookshop.Books;
|
|
||||||
amount : Integer;
|
|
||||||
netAmount: Decimal(9,2);
|
|
||||||
}
|
|
||||||
|
|
||||||
entity Customers : managed {
|
entity Customers : managed {
|
||||||
key ID : UUID;
|
key ID : UUID;
|
||||||
|
|||||||
3
gdpr/index.cds
Normal file
3
gdpr/index.cds
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
namespace sap.capire.gdpr; //> important for reflection
|
||||||
|
using from './db/schema';
|
||||||
|
using from './srv/pdm-service';
|
||||||
22
gdpr/package.json
Normal file
22
gdpr/package.json
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"name": "@capire/fiori",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"dependencies": {
|
||||||
|
"@capire/bookshop": "../bookshop",
|
||||||
|
"@capire/orders": "../orders",
|
||||||
|
"@capire/common": "../common",
|
||||||
|
"@sap/cds": "^4",
|
||||||
|
"express": "^4.17.1"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"start": "cds run --in-memory?",
|
||||||
|
"watch": "cds watch"
|
||||||
|
},
|
||||||
|
"cds": {
|
||||||
|
"requires": {
|
||||||
|
"db": {
|
||||||
|
"kind": "sql"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,15 +1,18 @@
|
|||||||
using from '@capire/bookshop';
|
//using from '@capire/orders';
|
||||||
using { sap.capire.bookshop as db } from '../db/schema';
|
using { sap.capire.bookshop as db } from '../db/schema';
|
||||||
|
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'
|
//@requires: 'system-user'
|
||||||
service PDM_Service {
|
service PDM_Service {
|
||||||
|
|
||||||
entity Customers as projection on db.Customers;
|
entity Customers as projection on db.Customers;
|
||||||
|
|
||||||
entity OrderItems as
|
entity OrderItemView as
|
||||||
SELECT from db.Orders
|
SELECT from Orders
|
||||||
{ key ID,
|
{ //key ID,
|
||||||
key Items.ID as Item_ID,
|
//key Items.ID as Item_ID,
|
||||||
OrderNo,
|
OrderNo,
|
||||||
Customer.ID as Customer_ID,
|
Customer.ID as Customer_ID,
|
||||||
Customer.Email as Customer_Email,
|
Customer.Email as Customer_Email,
|
||||||
@@ -22,7 +25,7 @@ using { sap.capire.bookshop as db } from '../db/schema';
|
|||||||
PersonalData.EntitySemantics: 'DataSubject'
|
PersonalData.EntitySemantics: 'DataSubject'
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
ID @PersonalData.FieldSemantics: 'DataSubjectID';
|
ID @PersonalData.FieldSemantics: 'DataSubjectID';
|
||||||
FirstName @PersonalData.IsPotentiallyPersonal;
|
FirstName @PersonalData.IsPotentiallyPersonal;
|
||||||
LastName @PersonalData.IsPotentiallyPersonal;
|
LastName @PersonalData.IsPotentiallyPersonal;
|
||||||
CreditCardNo @PersonalData.IsPotentiallyPersonal;
|
CreditCardNo @PersonalData.IsPotentiallyPersonal;
|
||||||
3
orders/index.cds
Normal file
3
orders/index.cds
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
namespace sap.capire.orders; //> important for reflection
|
||||||
|
using from './db/schema';
|
||||||
|
using from './srv/orders-service';
|
||||||
Reference in New Issue
Block a user