Skip to content

Commit

Permalink
Extend organizer service with participant tickets for check-in status s…
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorwolf authored and open-ui5 committed Oct 14, 2016
1 parent f46cd1b commit 787d4c7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
10 changes: 10 additions & 0 deletions odataorganizer/service.xsodata
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ service {
dependent "EventChangeable"("EventID") multiplicity "1";

"com.sap.sapmentors.sitreg.odataorganizer.procedures::ParticipantsRead" as "Participants" key ("ID")
navigates ("Participant_Ticket" as "Ticket" )
create forbidden
update forbidden
delete forbidden;
Expand All @@ -69,4 +70,13 @@ service {

association "Event_PrePostEveningEventNumbers" principal "Events"("ID") multiplicity "1"
dependent "PrePostEveningEventNumbers"("EventID") multiplicity "1";

// Read Ticket from View to restrict fields that can be read
"com.sap.sapmentors.sitreg.odatareceptionist.procedures::TicketRead" as "Ticket" key ("ParticipantID")
create forbidden
update forbidden
delete forbidden;

association "Participant_Ticket" principal "Participants"("ID") multiplicity "1"
dependent "Ticket"("ParticipantID") multiplicity "1";
}
6 changes: 3 additions & 3 deletions odatareceptionist/service.xsodata
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
service {

"com.sap.sapmentors.sitreg.odataparticipant.procedures::EventsRead" as "Events" key ("ID")
navigates ("Event_Ticket" as "Ticket",
navigates ("Event_Ticket" as "Tickets",
"Event_Participants" as "Participants",
"Event_RegistrationNumbers" as "RegistrationNumbers")
create forbidden
Expand All @@ -27,7 +27,7 @@ service {

// Read Participants from View to restrict fields that can be read
"com.sap.sapmentors.sitreg.odataparticipant.procedures::ParticipantsRead" as "Participants" key ("ID")
navigates ("Participant_Ticket" as "EventTicket" )
navigates ("Participant_Ticket" as "Ticket" )
create forbidden
update forbidden
delete forbidden;
Expand All @@ -45,7 +45,7 @@ service {
delete forbidden;

association "Event_Ticket" principal "Events"("ID") multiplicity "1"
dependent "Ticket"("EventID") multiplicity "1";
dependent "Ticket"("EventID") multiplicity "*";
association "Event_Participants" principal "Events"("ID") multiplicity "1"
dependent "Participants"("EventID") multiplicity "*";
association "Event_RegistrationNumbers" principal "Events"("ID") multiplicity "1"
Expand Down
1 change: 1 addition & 0 deletions roles/organizer.hdbrole
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ role com.sap.sapmentors.sitreg.roles::organizer {
sql object com.sap.sapmentors.sitreg.odataparticipant.procedures::RegistrationNumbersRead: SELECT;
sql object com.sap.sapmentors.sitreg.odataorganizer.procedures::PrePostEveningEventNumbersRead: SELECT;
sql object com.sap.sapmentors.sitreg.odataorganizer.procedures::ParticipantsRead: SELECT;
sql object com.sap.sapmentors.sitreg.odatareceptionist.procedures::TicketRead: SELECT;
sql object com.sap.sapmentors.sitreg.odataorganizer.procedures::EventChangeableRead: SELECT;
sql object com.sap.sapmentors.sitreg.odataorganizer.procedures::CoOrganizerCreate: //Objecttype: PROCEDURE
EXECUTE;
Expand Down
3 changes: 2 additions & 1 deletion test/spec/CoOrganizerReadParticipants.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ describe("Login COORGANIZER", function() {

describe("Read participant details of event 1", function() {
it("should return participant details", function() {
var participantUri = eventUri + "/Participants";
var participantUri = eventUri + "/Participants?$expand=Ticket";
var xhr = prepareRequest("GET", participantUri);
xhr.send();
expect(xhr.status).toBe(200);
var body = xhr.responseText ? JSON.parse(xhr.responseText) : "";
expect(body.d.results.length).toBe(1);
expect(body.d.results[0].EMail).toBe(EMail);
expect(body.d.results[0].Ticket.TicketUsed).toBe("N");
});
});

Expand Down

0 comments on commit 787d4c7

Please sign in to comment.