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

[GET] An Activity's Attendees #96

Closed
Tracked by #14
arafaysaleem opened this issue Sep 14, 2021 · 0 comments · Fixed by #102
Closed
Tracked by #14

[GET] An Activity's Attendees #96

arafaysaleem opened this issue Sep 14, 2021 · 0 comments · Fixed by #102
Assignees
Labels
Status: Completed Type: Enhancement user story A brief explanation of a functionality or an interaction with the system, from a user's perspective

Comments

@arafaysaleem
Copy link
Collaborator

arafaysaleem commented Sep 14, 2021

Summary

As a student, I should be able to get attendees of an activity, so that I can see who's interested.

Acceptance Criteria

Scenario 1: Get All Attendees Of An Activities

GIVEN an student is requesting attendees of an activity in the app
WHEN the app hits the /activities/:id/attendees endpoint with a valid GET request, containing the path parameter:

  • :id, the unique id of the entity for which the attendees are needed.

THEN the app should receive a status 200
AND in the response, the following information should be returned:

  • headers
  • list of activity attendees

Sample Request/Sample Response

headers: {
    error: 0,
    message: "..."
}
body: [
    {
      student_erp: 17855,
      first_name: "Test",
      last_name: "User",
      profile_picture_url: "www.some-url.com/picture",
      involvement_type: "interested",
    },
    {
      student_erp: 17918,
      first_name: "Test",
      last_name: "User",
      profile_picture_url: "www.some-url.com/picture",
      involvement_type: "going",
    },
    {
      student_erp: 15030,
      first_name: "Test",
      last_name: "User",
      profile_picture_url: "www.some-url.com/picture",
      involvement_type: "will_try",
    },
]

Scenario 2: Get All Filtered Attendees Of An Activity

GIVEN a student is requesting attendees of an activities in the app
WHEN the app hits the /activities/:id/attendees endpoint with a valid GET request containing query parameters, either:

  • involvement_type

THEN the app should receive a status 200
AND in the response, the following information should be returned:

  • headers
  • list of activities

Sample Request/Sample Response
For e.g. we want all going attendees of an activity .i.e. involvment_type=going

headers: {
    error: 0,
    message: "..."
}
body: [
    {
      student_erp: 17855,
      first_name: "Test",
      last_name: "User",
      profile_picture_url: "www.some-url.com/picture",
      involvement_type: "going",
    },
    {
      student_erp: 17918,
      first_name: "Test",
      last_name: "User",
      profile_picture_url: "www.some-url.com/picture",
      involvement_type: "going",
    },
    {
      student_erp: 15030,
      first_name: "Test",
      last_name: "User",
      profile_picture_url: "www.some-url.com/picture",
      involvement_type: "going",
    },
]

Resources

  • Development URL: {Here goes a URL to the feature on development API}
  • Production URL: {Here goes a URL to the feature on production API}

Dev Notes

This endpoint is accessible by and serves the admin in the same way.

Testing Notes

Scenario 1: GET request is successful

GIVEN a student is requesting attendees of an activity in the app
WHEN the app hits the /activities/:id/attendees endpoint with a valid GET request, containing the path parameter:

  • :id

THEN the app should receive a status 200
AND the body should be an array
AND the first item of the array should be an object containing the following fields:

  • student_erp
  • first_name
  • last_name
  • profile_picture_url
  • involvement_type

Scenario 2: GET request is unsuccessful due to unknown activity_id

GIVEN a student is requesting attendees of an activity in the app
WHEN the app hits the /activities/:id/attendees endpoint with a valid GET request, containing the path parameter:

  • :id, a non-existent id

THEN the app should receive a status 404
AND the response headers' code parameter should contain "NotFoundException"
AND the response headers' message parameter should contain "Activity not found"

Scenario 3: GET request is unsuccessful due to zero attendees

GIVEN a student is requesting attendees of an activity in the app
AND no attendees of that activity exist yet
WHEN the app hits the /activities/:id/attendees endpoint with a valid GET request, containing the path parameter:

  • :id

THEN the app should receive a status 404
AND the response headers' code parameter should contain "NotFoundException"
AND the response headers' message parameter should contain "Activity attendees not found"

Scenario 4: GET request is unauthorized

GIVEN a student is requesting attendees of an activity in the app
WHEN the app hits the /activities/:id/attendees endpoint with a valid GET request
AND the request contains no authorization token
THEN the app should receive a status 401
AND the response headers' code parameter should contain "TokenMissingException"

@arafaysaleem arafaysaleem added Priority: Medium Status: Pending Type: Enhancement user story A brief explanation of a functionality or an interaction with the system, from a user's perspective labels Sep 14, 2021
@arafaysaleem arafaysaleem mentioned this issue Sep 14, 2021
16 tasks
@arafaysaleem arafaysaleem changed the title [GET] All Attendees Of An Activity [GET] An Activity's Attendees Sep 14, 2021
@arafaysaleem arafaysaleem self-assigned this Sep 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Completed Type: Enhancement user story A brief explanation of a functionality or an interaction with the system, from a user's perspective
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant