- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1
 
Projection Layer
The Projection Layer defines which fields and associations from the Interface Layer are exposed to consumers (UI or service layer).
It acts as the public contract of the business objectβhiding internal details and exposing only what's needed for applications.
In this project, projection views are created for:
- Root Vehicle Interface
 - Trip Interface
 - Maintenance Interface
 
The root projection is based on the root interface view ZAKS_I_ROOT_VEHICLE.
It exposes vehicle master data along with compositions for Trips and Maintenance.
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Projection View -- Root Interface'
@Metadata.ignorePropagatedAnnotations: true
@Metadata.allowExtensions: true
define root view entity ZAKS_P_ROOT_VEHICLE as projection on ZAKS_I_ROOT_VEHICLE
{
    key VehicleUUID,
    key VehicleId,
    RegdNo,
    VehicleType,
    Brand,
    Model,
    PurchaseDate,
    @Semantics.amount.currencyCode: 'Currency'
    CostPrice,
    Currency,
    FuelType,
    Capacity,
    CapacityUnit,
    Status,
    Plant,
    CreatedBy,
    CreatedOn,
    /* Associations */
    _Maintenance : redirected to composition child ZAKS_P_CDS_MAINTENANCE,
    _Trip        : redirected to composition child ZAKS_P_CDS_TRIP
}Key Highlights:
- 
VehicleUUIDandVehicleIdare the technical keys. - Cost fields are annotated with 
@Semantics.amount.currencyCodefor proper UI handling. - 
Associations are redirected to child projections (
_Maintenance,_Trip). 
The trip projection is created on the trip interface view ZAKS_I_CDS_TRIP.
It exposes trip details, including the computed total_trip_cost, and links back to the parent vehicle.
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Projection View -- CDS Interface (Trip)'
@Metadata.ignorePropagatedAnnotations: true
@Metadata.allowExtensions: true
define view entity ZAKS_P_CDS_TRIP as projection on ZAKS_I_CDS_TRIP
{
    key TripUUID,
    key TripId,
    VehicleUUID,
    VehicleId,
    DriverId,
    Origin,
    Destination,
    StartDate,
    EndDate, 
    DistanceKm,
    @Semantics.amount.currencyCode: 'Currency'
    total_trip_cost,
    Currency,
    CargoType,
    CreatedBy,
    CreatedOn,
    /* Associations */
    _Vehicle : redirected to parent ZAKS_P_ROOT_VEHICLE
}Key Highlights:
- 
TripUUIDandTripIdare the technical keys. - Exposes the computed field 
total_trip_costfrom CDS. - Association 
_Vehicleis redirected to the parent vehicle projection. 
The maintenance projection is created on the maintenance interface view ZAKS_I_CDS_MAINTENANCE.
It exposes maintenance history details and links back to the parent vehicle.
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Projection View -- Maintenance Interface'
@Metadata.ignorePropagatedAnnotations: true
@Metadata.allowExtensions: true
define view entity ZAKS_P_CDS_MAINTENANCE as projection on ZAKS_I_CDS_MAINTENANCE
{
    key MaintUUID,
    key MaintId,
    VehicleUUID,
    VehicleId,
    ServiceDate,
    ServiceType,
    WorkshopName,
    @Semantics.amount.currencyCode: 'Currency'
    ServiceCost,
    Currency,
    OdometerReading,
    PartsChanged,
    WarrantyClaim,
    NextServiceDate,
    MaterialNumber,
    VendorNumber,
    CreatedBy,
    CreatedOn,
    /* Associations */
    _Vehicle : redirected to parent ZAKS_P_ROOT_VEHICLE
}Key Highlights:
- 
MaintUUIDandMaintIdare the technical keys. - Cost fields are annotated with 
@Semantics.amount.currencyCode. - Association 
_Vehicleis redirected to the parent vehicle projection. 
- The Projection Layer filters and shapes data from the interface views for service exposure.
 - Root Vehicle Projection exposes all relevant vehicle fields and compositions.
 - Child Projections (Trip & Maintenance) redirect back to the parent vehicle, maintaining navigational integrity.
 - 
Semantic Annotations (e.g., 
@Semantics.amount.currencyCode) ensure correct representation in Fiori/UI for amounts and currencies. 
π Next: π¨ UI Annotations