namespace correction

This commit is contained in:
Wolfgang Koch
2021-05-14 11:32:50 +02:00
parent 24ad6090d2
commit f1927f184e
9 changed files with 108 additions and 122 deletions

View File

@@ -1,5 +0,0 @@
ID;modifiedAt;createdAt;createdBy;modifiedBy;Z_Customer_ID;Z_description;Z_street;Z_town;Z_country_code
1e2f2640-6866-4dcf-8f4d-3027aa831cad;2019-04-04;2019-01-31;admin@business.com;admin@business.com;8e2f2640-6866-4dcf-8f4d-3027aa831cad;Home;Hauptstrasse 11;Berlin;DE
24e718c9-ff99-47f1-8ca3-950c850777d4;2019-04-04;2019-01-30;admin@business.com;admin@business.com;74e718c9-ff99-47f1-8ca3-950c850777d4;Home;Main Street 22;London;GB
3e2f2640-6866-4dcf-8f4d-3027aa831cad;2019-04-04;2019-01-31;admin@business.com;admin@business.com;8e2f2640-6866-4dcf-8f4d-3027aa831cad;Work;Siemensstrasse 21;Berlin;DE
44e718c9-ff99-47f1-8ca3-950c850777d4;2019-04-04;2019-01-30;admin@business.com;admin@business.com;74e718c9-ff99-47f1-8ca3-950c850777d4;Work;Work Street 34;London;GB

View File

@@ -1,5 +1,5 @@
Z_ID;Z_Customer_Z_ID;Z_description;Z_street;Z_town;Z_country_code
1e2f2640-6866-4dcf-8f4d-3027aa831cad;8e2f2640-6866-4dcf-8f4d-3027aa831cad;Home;Hauptstrasse 11;Berlin;DE
24e718c9-ff99-47f1-8ca3-950c850777d4;74e718c9-ff99-47f1-8ca3-950c850777d4;Home;Main Street 22;London;GB
3e2f2640-6866-4dcf-8f4d-3027aa831cad;8e2f2640-6866-4dcf-8f4d-3027aa831cad;Work;Siemensstrasse 21;Berlin;DE
44e718c9-ff99-47f1-8ca3-950c850777d4;74e718c9-ff99-47f1-8ca3-950c850777d4;Work;Work Street 34;London;GB
ID;modifiedAt;createdAt;createdBy;modifiedBy;Customer_ID;description;street;town;country_code
1e2f2640-6866-4dcf-8f4d-3027aa831cad;2019-04-04;2019-01-31;admin@business.com;admin@business.com;8e2f2640-6866-4dcf-8f4d-3027aa831cad;Home;Hauptstrasse 11;Berlin;DE
24e718c9-ff99-47f1-8ca3-950c850777d4;2019-04-04;2019-01-30;admin@business.com;admin@business.com;74e718c9-ff99-47f1-8ca3-950c850777d4;Home;Main Street 22;London;GB
3e2f2640-6866-4dcf-8f4d-3027aa831cad;2019-04-04;2019-01-31;admin@business.com;admin@business.com;8e2f2640-6866-4dcf-8f4d-3027aa831cad;Work;Siemensstrasse 21;Berlin;DE
44e718c9-ff99-47f1-8ca3-950c850777d4;2019-04-04;2019-01-30;admin@business.com;admin@business.com;74e718c9-ff99-47f1-8ca3-950c850777d4;Work;Work Street 34;London;GB
1 Z_ID ID Z_Customer_Z_ID modifiedAt Z_description createdAt Z_street createdBy Z_town modifiedBy Z_country_code Customer_ID description street town country_code
2 1e2f2640-6866-4dcf-8f4d-3027aa831cad 1e2f2640-6866-4dcf-8f4d-3027aa831cad 8e2f2640-6866-4dcf-8f4d-3027aa831cad 2019-04-04 Home 2019-01-31 Hauptstrasse 11 admin@business.com Berlin admin@business.com DE 8e2f2640-6866-4dcf-8f4d-3027aa831cad Home Hauptstrasse 11 Berlin DE
3 24e718c9-ff99-47f1-8ca3-950c850777d4 24e718c9-ff99-47f1-8ca3-950c850777d4 74e718c9-ff99-47f1-8ca3-950c850777d4 2019-04-04 Home 2019-01-30 Main Street 22 admin@business.com London admin@business.com GB 74e718c9-ff99-47f1-8ca3-950c850777d4 Home Main Street 22 London GB
4 3e2f2640-6866-4dcf-8f4d-3027aa831cad 3e2f2640-6866-4dcf-8f4d-3027aa831cad 8e2f2640-6866-4dcf-8f4d-3027aa831cad 2019-04-04 Work 2019-01-31 Siemensstrasse 21 admin@business.com Berlin admin@business.com DE 8e2f2640-6866-4dcf-8f4d-3027aa831cad Work Siemensstrasse 21 Berlin DE
5 44e718c9-ff99-47f1-8ca3-950c850777d4 44e718c9-ff99-47f1-8ca3-950c850777d4 74e718c9-ff99-47f1-8ca3-950c850777d4 2019-04-04 Work 2019-01-30 Work Street 34 admin@business.com London admin@business.com GB 74e718c9-ff99-47f1-8ca3-950c850777d4 Work Work Street 34 London GB

View File

@@ -1,3 +0,0 @@
ID;modifiedAt;createdAt;createdBy;modifiedBy;Z_email;Z_firstName;Z_lastName;Z_creditCardNo;Z_dateOfBirth;Z_status;Z_creditScore
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;gold;80.0
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;platinum;100.0

View File

@@ -1,3 +1,3 @@
Z_ID;Z_email;Z_firstName;Z_lastName;Z_creditCardNo;Z_dateOfBirth;Z_status;Z_creditScore
8e2f2640-6866-4dcf-8f4d-3027aa831cad;john.doe@test.com;John;Doe;9977-6655-4433-2211;1970-01-01;gold;80.0
74e718c9-ff99-47f1-8ca3-950c850777d4;jane.doe@sap.com;Jane;Doe;2211-3344-5566-7788;1980-11-11;platinum;100.0
ID;modifiedAt;createdAt;createdBy;modifiedBy;email;firstName;lastName;creditCardNo;dateOfBirth;status;creditScore
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;gold;80.0
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;platinum;100.0
1 Z_ID ID Z_email modifiedAt Z_firstName createdAt Z_lastName createdBy Z_creditCardNo modifiedBy Z_dateOfBirth email Z_status firstName Z_creditScore lastName creditCardNo dateOfBirth status creditScore
2 8e2f2640-6866-4dcf-8f4d-3027aa831cad 8e2f2640-6866-4dcf-8f4d-3027aa831cad john.doe@test.com 2019-04-04 John 2019-01-31 Doe admin@business.com 9977-6655-4433-2211 admin@business.com 1970-01-01 john.doe@test.com gold John 80.0 Doe 9977-6655-4433-2211 1970-01-01 gold 80.0
3 74e718c9-ff99-47f1-8ca3-950c850777d4 74e718c9-ff99-47f1-8ca3-950c850777d4 jane.doe@sap.com 2019-04-04 Jane 2019-01-30 Doe admin@business.com 2211-3344-5566-7788 admin@business.com 1980-11-11 jane.doe@sap.com platinum Jane 100.0 Doe 2211-3344-5566-7788 1980-11-11 platinum 100.0

View File

@@ -1,4 +1,4 @@
Z_regionCode
AMER
EMEA
APJ
regionCode;name;descr
AMER;Americas;North, Central and South America
EMEA;Europe, the Middle East and Africa;Europe, the Middle East and Africa
APJ;Asia Pacific and Japan;Asia Pacific and Japan
1 Z_regionCode regionCode name descr
2 AMER AMER Americas North, Central and South America
3 EMEA EMEA Europe, the Middle East and Africa Europe, the Middle East and Africa
4 APJ APJ Asia Pacific and Japan Asia Pacific and Japan

View File

@@ -1,3 +0,0 @@
ID;createdAt;createdBy;buyer;OrderNo;currency_code;Z_Customer_ID;Z_priority
7e2f2640-6866-4dcf-8f4d-3027aa831cad;2019-01-31;john.doe@test.com;john.doe@test.com;1;EUR;8e2f2640-6866-4dcf-8f4d-3027aa831cad;high
64e718c9-ff99-47f1-8ca3-950c850777d4;2019-01-30;jane.doe@test.com;jane.doe@test.com;2;EUR;74e718c9-ff99-47f1-8ca3-950c850777d4;low

View File

@@ -1,3 +1,3 @@
ID;createdAt;createdBy;buyer;OrderNo;currency_code;Z_Customer_Z_ID;Z_priority
7e2f2640-6866-4dcf-8f4d-3027aa831cad;2019-01-31;john.doe@test.com;john.doe@test.com;1;EUR;8e2f2640-6866-4dcf-8f4d-3027aa831cad;high
64e718c9-ff99-47f1-8ca3-950c850777d4;2019-01-30;jane.doe@test.com;jane.doe@test.com;2;EUR;74e718c9-ff99-47f1-8ca3-950c850777d4;low
ID;createdAt;createdBy;buyer;OrderNo;currency_code;Z_Customer_ID;Z_priority;Z_SalesRegion_regionCode
7e2f2640-6866-4dcf-8f4d-3027aa831cad;2019-01-31;john.doe@test.com;john.doe@test.com;1;EUR;8e2f2640-6866-4dcf-8f4d-3027aa831cad;high;EMEA
64e718c9-ff99-47f1-8ca3-950c850777d4;2019-01-30;jane.doe@test.com;jane.doe@test.com;2;EUR;74e718c9-ff99-47f1-8ca3-950c850777d4;low;APJ
1 ID createdAt createdBy buyer OrderNo currency_code Z_Customer_Z_ID Z_Customer_ID Z_priority Z_SalesRegion_regionCode
2 7e2f2640-6866-4dcf-8f4d-3027aa831cad 2019-01-31 john.doe@test.com john.doe@test.com 1 EUR 8e2f2640-6866-4dcf-8f4d-3027aa831cad 8e2f2640-6866-4dcf-8f4d-3027aa831cad high EMEA
3 64e718c9-ff99-47f1-8ca3-950c850777d4 2019-01-30 jane.doe@test.com jane.doe@test.com 2 EUR 74e718c9-ff99-47f1-8ca3-950c850777d4 74e718c9-ff99-47f1-8ca3-950c850777d4 low APJ

View File

@@ -10,58 +10,56 @@ using {
namespace Z_bookshop.extension;
// extend existing entity
extend orders.Orders with {
Z_Customer : Association to one Z_Customers;
Z_SalesRegion : Association to one Z_SalesRegion;
Z_priority : String @assert.range enum {high; medium; low} default 'medium';
Z_Remarks : Composition of many Z_Remarks on Z_Remarks.Z_parent = $self;
// Z_Remarks : Composition of many Z_Remarks on Z_Remarks.parent = $self;
}
// new entity - as association target
entity Z_Customers // : cuid, managed
entity Z_Customers : cuid, managed
{
key Z_ID : UUID; // workaround
Z_email : String;
Z_firstName : String;
Z_lastName : String;
Z_creditCardNo : String;
Z_dateOfBirth : Date;
Z_status : String @assert.range enum {platinum; gold; silver; bronze} default 'bronze';
Z_creditScore : Decimal @assert.range: [ 1.0, 100.0 ] default 50.0;
Z_PostalAddresses : Composition of many Z_CustomerPostalAddresses on Z_PostalAddresses.Z_Customer = $self;
email : String;
firstName : String;
lastName : String;
creditCardNo : String;
dateOfBirth : Date;
status : String @assert.range enum {platinum; gold; silver; bronze} default 'bronze';
creditScore : Decimal @assert.range: [ 1.0, 100.0 ] default 50.0;
PostalAddresses : Composition of many Z_CustomerPostalAddresses on PostalAddresses.Customer = $self;
}
// new unique constraint (secondary index)
annotate Z_Customers with @assert.unique: { Z_email: [ Z_email ] }
annotate Z_Customers with @assert.unique: { email: [ email ] }
{
Z_email @mandatory; // mandatory check
email @mandatory; // mandatory check
}
// new entity - as composition target
entity Z_CustomerPostalAddresses // :
entity Z_CustomerPostalAddresses : cuid, managed
{
key Z_ID : UUID; // workaround
Z_Customer : Association to one Z_Customers;
Z_description : String;
Z_street : String;
Z_town : String;
Z_country : Country;
Customer : Association to one Z_Customers;
description : String;
street : String;
town : String;
country : Country;
}
// new entity - as code list
entity Z_SalesRegion: CodeList {
key Z_regionCode : String(11);
key regionCode : String(11);
}
// new entity - as composition target
entity Z_Remarks // : cuid, managed
entity Z_Remarks : cuid, managed
{
key Z_ID : UUID; // workaround
Z_parent : Association to one orders.Orders;
// number : Integer; // try without Z_
Z_number : Integer;
Z_remarksLine : String;
parent : Association to one orders.Orders;
number : Integer;
remarksLine : String;
}