8. Wertehilfen implementieren
- Die Interface View
ZI_CustomerVHerstellen - Die Interface View
ZI_StatusVHerstellen - Die BO Projection View
ZC_TravelTPum Annotationen für Wertehilfen erweitern - Die BO Projection View
ZC_BookingTPum Annotationen für Wertehilfen erweitern
Interface View ZI_CustomerVH
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Value Help for Customer'
define view entity ZI_CustomerVH
as select from /dmo/customer
{
key customer_id as CustomerId,
first_name as FirstName,
last_name as LastName,
title as Title,
street as Street,
postal_code as PostalCode,
city as City,
country_code as CountryCode
}
Interface View ZI_StatusVH
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Value Help for Status'
define view entity ZI_StatusVH
as select from DDCDS_CUSTOMER_DOMAIN_VALUE_T( p_domain_name : '/DMO/STATUS') as Text
inner join DDCDS_CUSTOMER_DOMAIN_VALUE( p_domain_name : '/DMO/STATUS') as Value
on Text.domain_name = Value.domain_name and Text.value_position = Value.value_position
{
@EndUserText.label: 'Status'
@EndUserText.quickInfo: 'Status'
key Value.value_low as Status,
@EndUserText.label: 'Status Text'
@EndUserText.quickInfo: 'Status Text'
Text.text as StatusText
}
where Text.language = $session.system_language
BO Projection View ZC_TravelTP
@EndUserText.label: 'Travel'
@AccessControl.authorizationCheck: #NOT_REQUIRED
@Search.searchable: true
@Metadata.allowExtensions: true
define root view entity ZC_TravelTP
provider contract transactional_query
as projection on ZR_TravelTP
{
key TravelUuid,
TravelId,
@Consumption.valueHelpDefinition: [{ entity: { name: '/DMO/I_Agency_StdVH', element: 'AgencyID' } }]
AgencyId,
@Consumption.valueHelpDefinition: [{ entity: { name: 'ZI_CustomerVH', element: 'CustomerId' } }]
CustomerId,
BeginDate,
EndDate,
BookingFee,
TotalPrice,
@Consumption.valueHelpDefinition: [{ entity: { name: 'I_CurrencyStdVH', element: 'Currency' } }]
CurrencyCode,
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.7
Description,
@Consumption.valueHelpDefinition: [{ entity: { name: 'ZI_StatusVH', element: 'Status' } }]
Status,
/* Administrative Data */
CreatedBy,
CreatedAt,
LastChangedBy,
LastChangedAt,
/* Associations */
_Bookings : redirected to composition child ZC_BookingTP
}
BO Projection View ZC_BookingTP
@EndUserText.label: 'Booking'
@AccessControl.authorizationCheck: #NOT_REQUIRED
@Metadata.allowExtensions: true
define view entity ZC_BookingTP
as projection on ZR_BookingTP
{
key BookingUuid,
TravelUuid,
BookingId,
BookingDate,
@Consumption.valueHelpDefinition: [{ entity: { name: '/DMO/I_Carrier_StdVH', element: 'AirlineID' } }]
CarrierId,
ConnectionId,
FlightDate,
FlightPrice,
@Consumption.valueHelpDefinition: [{ entity: { name: 'I_CurrencyStdVH', element: 'Currency' } }]
CurrencyCode,
/* Associations */
_Travel : redirected to parent ZC_TravelTP
}