From fc3ca6dc7d7904f15a7962113ef9f6ef99e01c4b Mon Sep 17 00:00:00 2001 From: Tobias Queck Date: Fri, 24 Nov 2023 13:03:06 +0000 Subject: [PATCH] ex4 completed --- app/managetravels/annotations.cds | 109 ++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) diff --git a/app/managetravels/annotations.cds b/app/managetravels/annotations.cds index 451c1ec..c99a7bf 100644 --- a/app/managetravels/annotations.cds +++ b/app/managetravels/annotations.cds @@ -62,3 +62,112 @@ annotate service.Travel with @( }, } ); +annotate service.Travel with @( + UI.Identification : [ + { + $Type : 'UI.DataFieldForAction', + Action : 'TravelService.rejectTravel', + Label : '{i18n>Rejecttravel}', + }, + { + $Type : 'UI.DataFieldForAction', + Action : 'TravelService.acceptTravel', + Label : '{i18n>Accepttravel}', + }, + ] +); +annotate service.Travel with @( + UI.Facets : [ + { + $Type : 'UI.CollectionFacet', + Label : '{i18n>Travel}', + ID : 'Travel', + Facets : [ + { + $Type : 'UI.ReferenceFacet', + Label : '{i18n>Travel}', + ID : 'i18nTravel', + Target : '@UI.FieldGroup#i18nTravel', + }, + { + $Type : 'UI.ReferenceFacet', + Label : '{i18n>Prices}', + ID : 'i18nPrices', + Target : '@UI.FieldGroup#i18nPrices', + }, + { + $Type : 'UI.ReferenceFacet', + Label : '{i18n>Dates}', + ID : 'Dates', + Target : '@UI.FieldGroup#Dates', + }, + { + $Type : 'UI.ReferenceFacet', + Label : '{i18n>Sustainability}', + ID : 'i18nSustainability', + Target : '@UI.FieldGroup#i18nSustainability', + },], + }, + ] +); +annotate service.Travel with @( + UI.FieldGroup #i18nTravel : { + $Type : 'UI.FieldGroupType', + Data : [ + { + $Type : 'UI.DataField', + Value : TravelID, + },{ + $Type : 'UI.DataField', + Value : to_Agency_AgencyID, + },{ + $Type : 'UI.DataField', + Value : to_Customer_CustomerID, + },{ + $Type : 'UI.DataField', + Value : TravelStatus_code, + },], + } +); +annotate service.Travel with @( + UI.FieldGroup #i18nPrices : { + $Type : 'UI.FieldGroupType', + Data : [ + { + $Type : 'UI.DataField', + Value : BookingFee, + },{ + $Type : 'UI.DataField', + Value : TotalPrice, + },], + } +); +annotate service.Travel with @( + UI.FieldGroup #Dates : { + $Type : 'UI.FieldGroupType', + Data : [ + { + $Type : 'UI.DataField', + Value : BeginDate, + },{ + $Type : 'UI.DataField', + Value : EndDate, + },], + } +); +annotate service.Travel with @( + UI.FieldGroup #i18nSustainability : { + $Type : 'UI.FieldGroupType', + Data : [ + { + $Type : 'UI.DataField', + Value : GoGreen, + },{ + $Type : 'UI.DataField', + Value : GreenFee, + },{ + $Type : 'UI.DataField', + Value : TreesPlanted, + },], + } +);