rokwire / surveys-building-block

Building Block that manages surveys in the Rokwire Platform.
Apache License 2.0
0 stars 1 forks source link

[FEATURE] Integrate Calendar BB #19

Closed shurwit closed 1 year ago

shurwit commented 1 year ago

Is your feature request related to a problem? Please describe. We would like to be able to associate surveys with Calendar BB events. This will be similar to the Groups BB integration described in #13

Describe the solution you'd like When a survey is created, we should be able to specify a Calendar BB event ID with which it is associated. If one is configured, only users who have attended that Calendar BB event should be able to submit a response to that survey. To do this, we will need to first retrieve the associated survey from the database, check if it has an event ID associated, and if it does call the Calendar BB API mentioned below to see if the user submitting the response attended the event.

We should enhance the GET surveys API to allow a specific event ID to be provided to retrieve the associated survey,

We should also be able to specify an anonymous flag on the survey that cannot be changed after the survey is created. Event admins should be able to see the survey responses submitted by the event attendees. If the anonymous flag was set on the survey when it was created, the user ID must be removed from the response data before it is sent to the admins, otherwise it should be included. Similarly to the submit survey response, we will need to retrieve the associated survey from the database, check if it has an event ID associated, and if it does call the Calendar BB API mentioned below to see if the user submitting the response is an admin of the event.

When creating a survey with an event ID specified, we must also check that the user is an admin of the specified event as described above.

Note that we will require APIs to be added to the Calendar BB to retrieve the relevant user data. This is being tracked and discussed here: https://github.com/rokwire/calendar-building-block/issues/162