[POST] A New Timetable #214
Labels
Status: Completed
Type: Feature
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 create timetables, so that I can save them for sharing.Acceptance Criteria
GIVEN a
student
is creating a timetable in the appWHEN the app hits the
/timetables
endpoint with a valid POST request, containing:term_id
int(10) unsigned NOT NULL,student_erp
varchar(5),is_active
tinyint(1) NOT NULL DEFAULT 0,classes
array, where each item is a:class_erp
varchar(5)THEN the app should receive a status
201
AND in the response, the following information should be returned:
Sample Request/Sample Response
Resources
Dev Notes
{Some complementary notes if necessary}
Testing Notes
Scenario 1: POST request is successful
/timetables
endpoint withstudent_erp
== erp instudent
account token and ensure a201
status code is returned.id
returned by the response in a subsequent GET request to/timetables/:id
endpoint and ensure a200
status code is returned./timetables/:id
endpoint and ensure a200
status code is returned.Scenario 2: POST request is incorrect
/timetables
endpoint with an incorrect key name in the body422
status code is returnedcode
parameter should contain "InvalidPropertiesException"data
parameter should contain the name of the invalid parameterScenario 3: POST request is forbidden
/timetables
endpoint withstudent_erp
!= erp instudent
account token.403
forbidden status code.code
parameter should contain "ForbiddenException"Scenario 4: POST request is unauthorized
/timetables
endpoint without an authorization token401
unauthorized status code is returned.code
parameter should contain "TokenMissingException"The text was updated successfully, but these errors were encountered: