Namespaces

This commit is contained in:
Wolfgang Koch
2021-05-06 17:27:53 +02:00
parent 66d792d76d
commit d5a2df0965
4 changed files with 64 additions and 64 deletions

View File

@@ -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 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 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 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 ID modifiedAt createdAt createdBy modifiedBy Customer_ID Z_Customer_ID description Z_description street Z_street town Z_town country_code Z_country_code
2 1e2f2640-6866-4dcf-8f4d-3027aa831cad 2019-04-04 2019-01-31 admin@business.com admin@business.com 8e2f2640-6866-4dcf-8f4d-3027aa831cad 8e2f2640-6866-4dcf-8f4d-3027aa831cad Home Home Hauptstrasse 11 Hauptstrasse 11 Berlin Berlin DE DE
3 24e718c9-ff99-47f1-8ca3-950c850777d4 2019-04-04 2019-01-30 admin@business.com admin@business.com 74e718c9-ff99-47f1-8ca3-950c850777d4 74e718c9-ff99-47f1-8ca3-950c850777d4 Home Home Main Street 22 Main Street 22 London London GB GB
4 3e2f2640-6866-4dcf-8f4d-3027aa831cad 2019-04-04 2019-01-31 admin@business.com admin@business.com 8e2f2640-6866-4dcf-8f4d-3027aa831cad 8e2f2640-6866-4dcf-8f4d-3027aa831cad Work Work Siemensstrasse 21 Siemensstrasse 21 Berlin Berlin DE DE

View File

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

View File

@@ -12,42 +12,42 @@ namespace Z_bookshop.extension;
// extend existing entity // extend existing entity
extend orders.Orders with { extend orders.Orders with {
Z_Customer : Association to one Z_Customers; 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'; Z_priority : String @assert.range enum {high; medium; low} default 'medium';
} }
// new entity - as association target // new entity - as association target
entity Z_Customers : cuid, managed { entity Z_Customers : cuid, managed {
email : String; Z_email : String;
firstName : String; Z_firstName : String;
lastName : String; Z_lastName : String;
creditCardNo : String; Z_creditCardNo : String;
dateOfBirth : Date; Z_dateOfBirth : Date;
status : String @assert.range enum {platinum; gold; silver; bronze} default 'bronze'; Z_status : String @assert.range enum {platinum; gold; silver; bronze} default 'bronze';
creditScore : Decimal @assert.range: [ 1.0, 100.0 ] default 50.0; Z_creditScore : Decimal @assert.range: [ 1.0, 100.0 ] default 50.0;
PostalAddresses : Composition of many Z_CustomerPostalAddresses on PostalAddresses.Customer = $self; Z_PostalAddresses : Composition of many Z_CustomerPostalAddresses on Z_PostalAddresses.Z_Customer = $self;
} }
// new unique constraint (secondary index) // 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 // new entity - as composition target
entity Z_CustomerPostalAddresses : cuid, managed { entity Z_CustomerPostalAddresses : cuid, managed {
Customer : Association to one Z_Customers; Z_Customer : Association to one Z_Customers;
description : String; Z_description : String;
street : String; Z_street : String;
town : String; Z_town : String;
country : Country; Z_country : Country;
}; };
// new entity - as composition target // new entity - as composition target
entity Z_Remarks : cuid, managed entity Z_Remarks : cuid, managed
{ {
parent : Association to one orders.Orders; Z_parent : Association to one orders.Orders;
number : Integer; Z_number : Integer;
remarksLine : String; Z_remarksLine : String;
} }

View File

@@ -9,33 +9,33 @@ annotate OrdersService.Z_Customers with @odata.draft.enabled;
annotate OrdersService.Z_Customers with { annotate OrdersService.Z_Customers with {
ID @( ID @(
UI.Hidden, UI.Hidden,
Common : {Text : email} Common : {Text : Z_email}
); );
firstName @title : 'First Name'; Z_firstName @title : 'First Name';
lastName @title : 'Last Name'; Z_lastName @title : 'Last Name';
email @title : 'Email'; Z_email @title : 'Email';
creditCardNo @title : 'Credit Card No'; Z_creditCardNo @title : 'Credit Card No';
dateOfBirth @title : 'Date of Birth'; Z_dateOfBirth @title : 'Date of Birth';
status @title : 'Status'; Z_status @title : 'Status';
creditScore @title : 'Credit Score'; Z_creditScore @title : 'Credit Score';
} }
// new entity -- titles // new entity -- titles
annotate OrdersService.Z_CustomerPostalAddresses with { annotate OrdersService.Z_CustomerPostalAddresses with {
ID @( ID @(
UI.Hidden, UI.Hidden,
Common : {Text : description} Common : {Text : Z_description}
); );
description @title : 'Description'; Z_description @title : 'Description';
street @title : 'Street'; Z_street @title : 'Street';
town @title : 'Town'; Z_town @title : 'Town';
country @title : 'Country'; Z_country @title : 'Country';
} }
// new entity -- titles // new entity -- titles
annotate OrdersService.Z_Remarks with { annotate OrdersService.Z_Remarks with {
number @title: 'Remark Number'; Z_number @title: 'Remark Number';
remarksLine @title: 'Remark'; Z_remarksLine @title: 'Remark';
} }
// new entity in service -- UI // new entity in service -- UI
@@ -45,26 +45,26 @@ annotate OrdersService.Z_Customers with @(UI : {
TypeNamePlural : 'Customers', TypeNamePlural : 'Customers',
Title : { Title : {
$Type : 'UI.DataField', $Type : 'UI.DataField',
Value : email Value : Z_email
} }
}, },
LineItem : [ LineItem : [
{Value : firstName}, {Value : Z_firstName},
{Value : lastName}, {Value : Z_lastName},
{Value : email}, {Value : Z_email},
{Value : status}, {Value : Z_status},
{Value : creditScore} {Value : Z_creditScore}
], ],
Facets : [ Facets : [
{$Type: 'UI.ReferenceFacet', Label: 'Main', Target : '@UI.FieldGroup#Main'}, {$Type: 'UI.ReferenceFacet', Label: 'Main', Target : '@UI.FieldGroup#Main'},
{$Type: 'UI.ReferenceFacet', Label: 'Customer Postal Addresses', Target: 'PostalAddresses/@UI.LineItem'} {$Type: 'UI.ReferenceFacet', Label: 'Customer Postal Addresses', Target: 'Z_PostalAddresses/@UI.LineItem'}
], ],
FieldGroup #Main : {Data : [ FieldGroup #Main : {Data : [
{Value : firstName}, {Value : Z_firstName},
{Value : lastName}, {Value : Z_lastName},
{Value : email}, {Value : Z_email},
{Value : status}, {Value : Z_status},
{Value : creditScore} {Value : Z_creditScore}
]} ]}
} ) ; } ) ;
@@ -75,23 +75,23 @@ annotate OrdersService.Z_CustomerPostalAddresses with @(UI : {
TypeNamePlural : 'CustomerPostalAddresses', TypeNamePlural : 'CustomerPostalAddresses',
Title : { Title : {
$Type : 'UI.DataField', $Type : 'UI.DataField',
Value : description Value : Z_description
} }
}, },
LineItem : [ LineItem : [
{Value : description}, {Value : Z_description},
{Value : street}, {Value : Z_street},
{Value : town}, {Value : Z_town},
{Value : country_code} {Value : Z_country_code}
], ],
Facets : [ Facets : [
{$Type: 'UI.ReferenceFacet', Label: 'Main', Target : '@UI.FieldGroup#Main'} {$Type: 'UI.ReferenceFacet', Label: 'Main', Target : '@UI.FieldGroup#Main'}
], ],
FieldGroup #Main : {Data : [ FieldGroup #Main : {Data : [
{Value : description}, {Value : Z_description},
{Value : street}, {Value : Z_street},
{Value : town}, {Value : Z_town},
{Value : country_code} {Value : Z_country_code}
]} ]}
}, ) { }, ) {
@@ -107,20 +107,20 @@ annotate OrdersService.Z_Remarks with @(
TypeNamePlural: 'Remarks', TypeNamePlural: 'Remarks',
Title : { Title : {
$Type : 'UI.DataField', $Type : 'UI.DataField',
Value : number Value : Z_number
} }
}, },
LineItem: [ LineItem: [
{Value: number}, {Value: Z_number},
{Value: remarksLine} {Value: Z_remarksLine}
], ],
Facets: [ Facets: [
{$Type: 'UI.ReferenceFacet', Label: 'Main', Target: '@UI.FieldGroup#Main'} {$Type: 'UI.ReferenceFacet', Label: 'Main', Target: '@UI.FieldGroup#Main'}
], ],
FieldGroup#Main: { FieldGroup#Main: {
Data: [ Data: [
{Value: number}, {Value: Z_number},
{Value: remarksLine} {Value: Z_remarksLine}
] ]
} }
}, },
@@ -193,7 +193,7 @@ annotate OrdersService.Orders with @(
Z_Customer @( Z_Customer @(
Common: { Common: {
//show email, not id for Customer in the context of Orders //show email, not id for Customer in the context of Orders
Text: Z_Customer.email , TextArrangement: #TextOnly, Text: Z_Customer.Z_email , TextArrangement: #TextOnly,
ValueList: { ValueList: {
Label: 'Customers', Label: 'Customers',
CollectionPath: 'Z_Customers', CollectionPath: 'Z_Customers',
@@ -203,7 +203,7 @@ annotate OrdersService.Orders with @(
ValueListProperty: 'ID' ValueListProperty: 'ID'
}, },
{ $Type: 'Common.ValueListParameterDisplayOnly', { $Type: 'Common.ValueListParameterDisplayOnly',
ValueListProperty: 'email' ValueListProperty: 'Z_email'
} }
] ]
} }