[GET] A Student's Organized Activities #105
Labels
Status: Completed
Type: Enhancement
user story
A brief explanation of a functionality or an interaction with the system, from a user's perspective
Summary
As a
student
, I should be able to get a student's activities, so that I can view the their or my organized activities.Acceptance Criteria
Scenario 1: Get All Organized Activities
GIVEN a
student
is requesting a student's organized activities in the appWHEN the app hits the
/students/:erp/organized-activities
endpoint with a valid GET request, containing the path parameter::erp
, the unique id of the entity for which the details are needed.THEN the app should receive a status
200
AND in the response, the following information should be returned:
Sample Request/Sample Response
For e.g. we are requesting activities organized by a student with
erp=17855
Scenario 2: Get All Filtered Activities
GIVEN a
student
is requesting a student's organized activities in the appWHEN the app hits the
/students/:erp/organized-activities
endpoint with a valid GET request containing:path parameter:
:erp
, the unique id of the entity for which the details are neededquery parameters, either:
THEN the app should receive a status
200
AND in the response, the following information should be returned:
Sample Request/Sample Response
For e.g. we want a student's all private activities organized by me and happening on friday i.e.
erp
=17855 (in path parameter)friday
=1privacy
=privateResources
Dev Notes
This endpoint is going to be accessible and work the same way for the admin as well.
Testing Notes
Scenario 1: GET request is successful
GIVEN a
student
is requesting a student's organized activities in the appWHEN the app hits the
/students/:erp/organized-activities
endpoint with a valid GET requestTHEN the app should receive a status 200
AND the body should be an array
AND the organizer_erp of each item should be equal to path
:erp
AND the first item of the array should be an object containing the following fields:
Scenario 2: GET request with query parameters is successful
GIVEN a
student
is requesting all public activities organized by a student in the appWHEN the app hits the
/students/:erp/organized-activities
endpoint with a valid GET requestAND the query parameter contains
privacy
=publicTHEN the app should receive a status 200
AND the body should be an array
AND the organizer_erp of each item should be equal to the path
:erp
AND the privacy of each item should be equal to my "public"
AND the first item of the array should be an object containing the following activity fields
Scenario 3: GET request is unsuccessful due to unknown erp
GIVEN a
student
is requesting a student's organized activities in the app, containing the path parameter:WHEN the app hits the
/students/:erp/organized-activities
endpoint with a valid GET requestTHEN the app should receive a status
404
AND the response headers'
code
parameter should contain "NotFoundException"AND the response headers'
message
parameter should contain "Student not found"Scenario 4: GET request is unsuccessful due to no organized activities
GIVEN a
student
is requesting a student's organized activities in the app, containing the path parameter:WHEN the app hits the
/students/:erp/organized-activities
endpoint with a valid GET requestTHEN the app should receive a status
404
AND the response headers'
code
parameter should contain "NotFoundException"AND the response headers'
message
parameter should contain "No organized activities found"Scenario 5: GET request is incorrect
GIVEN a
student
is requesting a student's organized activities in the appWHEN the app hits the
/students/:erp/organized-activities
endpoint with a valid GET requestAND contains invalid/unknown query parameters
THEN the app should receive a status
422
AND the response headers'
code
parameter should contain "InvalidPropertiesException"AND the response headers'
data
parameter should contain the name of the invalid parameterScenario 6: GET request is unauthorized
GIVEN a
student
is requesting a student's organized activities in the appWHEN the app hits the
/students/:erp/organized-activities
endpoint with a valid GET requestAND the request contains no authorization token
THEN the app should receive a status
401
UnauthorizedAND the response headers'
code
parameter should contain "TokenMissingException"The text was updated successfully, but these errors were encountered: