Namespaces
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
ID;modifiedAt;createdAt;createdBy;modifiedBy;Customer_ID;description;street;town;country_code
|
||||
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
|
||||
|
||||
|
@@ -1,3 +1,3 @@
|
||||
ID;modifiedAt;createdAt;createdBy;modifiedBy;email;firstName;lastName;creditCardNo;dateOfBirth;status;creditScore
|
||||
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
|
||||
|
@@ -12,42 +12,42 @@ namespace Z_bookshop.extension;
|
||||
// extend existing entity
|
||||
extend orders.Orders with {
|
||||
Z_Customer : Association to one Z_Customers;
|
||||
Z_Remarks : Composition of many Z_Remarks on Z_Remarks.parent = $self;
|
||||
Z_Remarks : Composition of many Z_Remarks on Z_Remarks.Z_parent = $self;
|
||||
Z_priority : String @assert.range enum {high; medium; low} default 'medium';
|
||||
}
|
||||
|
||||
// new entity - as association target
|
||||
entity Z_Customers : cuid, managed {
|
||||
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;
|
||||
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;
|
||||
}
|
||||
|
||||
// new unique constraint (secondary index)
|
||||
annotate Z_Customers with @assert.unique: { email: [ email ] }
|
||||
annotate Z_Customers with @assert.unique: { Z_email: [ Z_email ] }
|
||||
{
|
||||
email @mandatory; // mandatory check
|
||||
Z_email @mandatory; // mandatory check
|
||||
}
|
||||
|
||||
// new entity - as composition target
|
||||
entity Z_CustomerPostalAddresses : cuid, managed {
|
||||
Customer : Association to one Z_Customers;
|
||||
description : String;
|
||||
street : String;
|
||||
town : String;
|
||||
country : Country;
|
||||
Z_Customer : Association to one Z_Customers;
|
||||
Z_description : String;
|
||||
Z_street : String;
|
||||
Z_town : String;
|
||||
Z_country : Country;
|
||||
};
|
||||
|
||||
// new entity - as composition target
|
||||
entity Z_Remarks : cuid, managed
|
||||
{
|
||||
parent : Association to one orders.Orders;
|
||||
number : Integer;
|
||||
remarksLine : String;
|
||||
Z_parent : Association to one orders.Orders;
|
||||
Z_number : Integer;
|
||||
Z_remarksLine : String;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user