Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PARKED:] Enhancements for analytics demo @d-com #630

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions app/analytics.cds
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

using { sap.fe.cap.travel as my } from '../db/schema';
namespace sap.fe.cap.travel;

entity TravelAnalytics as projection on my.Travel {
*, TreesPlanted @(AnalyticsDetails.measureType: #BASE)
};

annotate my.TravelAnalytics with @ObjectModel.supportedCapabilities: [
#ANALYTICAL_PROVIDER
];

annotate my.TravelStatus with @ObjectModel.supportedCapabilities: [
#ANALYTICAL_DIMENSION
];

annotate my.TravelAgency with @ObjectModel.supportedCapabilities: [
#ANALYTICAL_DIMENSION
];

annotate my.Travel with @ObjectModel.supportedCapabilities: [
#ANALYTICAL_FACT
]{
BookingFee @Aggregation.default: #SUM;
TotalPrice @Aggregation.default: #SUM;
GreenFee @Aggregation.default: #SUM;
TreesPlanted @Aggregation.default: #SUM;
};

annotate my.Travel with {
BookingFee @Semantics.amount.CurrencyCode: Currency;
TotalPrice @Semantics.amount.CurrencyCode: Currency;
GreenFee @Semantics.amount.CurrencyCode: Currency;
};
4 changes: 0 additions & 4 deletions db/master-data.cds
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ entity Supplement : managed, MasterData {
};

entity Flight : MasterData {
// TODO:
// when cuid is added, the to_Airline & to_Connection can be made managed association,
// furthermore the AirlineID and ConnectionID can be removed,
// they will be replaced by the generate FKs for to_Airline & to_Connection
key AirlineID : String(3);
key FlightDate : Date;
key ConnectionID : String(4);
Expand Down
2 changes: 2 additions & 0 deletions db/schema.cds
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ entity Travel : managed {
to_Agency : Association to TravelAgency;
to_Customer : Association to Passenger;
to_Booking : Composition of many Booking on to_Booking.to_Travel = $self;
GreenFee : Integer;
TreesPlanted : Integer;
};

annotate Travel with @(
Expand Down