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] All Classes #177

Closed
Tracked by #25
arafaysaleem opened this issue Nov 29, 2021 · 0 comments · Fixed by #205
Closed
Tracked by #25

[GET] All Classes #177

arafaysaleem opened this issue Nov 29, 2021 · 0 comments · Fixed by #205
Assignees
Labels
Status: Completed Type: Feature 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 Nov 29, 2021

Summary

As a student, I should be able to get all possible classes, so that I can choose one for my timetable.

Acceptance Criteria

GIVEN an student is requesting all possible classes in the app
WHEN the app hits the /classes endpoint with a valid GET request
THEN the app should receive a status 200
AND in the response, the following information should be returned:

  • headers
  • list of classes

Sample Request/Sample Response

headers: {
    error: 0,
    message: "..."
}
body: [
    {
        class_erp: 14892,
  	semester: CS-4,
        term_id: 1,
  	classroom: {
		classroom_id: 1,
		classroom: "MTC-21",
		campus: {
			campus_id: 1,
			campus: "MAIN"
		},
	},
  	subject: {
		subject_code: CSE104,
		subject: "Data Structures"
	}
  	teacher: {
		teacher_id: 1,
		full_name: "Shakeel Khoja",
		average_rating: 4.5,
		total_reviews: 10
	}
  	parent_class_erp: null, // this is not a lab class
  	timeslot_1: {
		timeslot_id: 1,
		start_time: 8:30,
		end_time: 9:45,
		slot_number: 1
	},
  	timeslot_2: {
		timeslot_id: 1,
		start_time: 8:30,
		end_time: 9:45,
		slot_number: 1
	},
  	day_1: monday,
  	day_2: wednesday
    },
    {
        class_erp: 14893,
  	semester: CS-4,
        term_id: 1,
  	classroom: {
		classroom_id: 11,
		classroom: "MTL-4",
		campus: {
			campus_id: 1,
			campus: "MAIN"
		},
	},
  	subject: {
		subject_code: CSE104,
		subject: "Data Structures"
	}
  	teacher: {
		teacher_id: 1,
		full_name: "Shakeel Khoja",
		average_rating: 4.5,
		total_reviews: 10
	}
  	parent_class_erp: 14892, // this is not a lab class
  	timeslot_1: {
		timeslot_id: 2,
		start_time: 10:00,
		end_time: 11:15,
		slot_number: 2
	},
  	timeslot_2: {
		timeslot_id: 2,
		start_time: 10:00,
		end_time: 11:15,
		slot_number: 2
	},
  	day_1: monday,
  	day_2: wednesday
    },
    ....
]

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

None.

Testing Notes

Scenario 1: GET request is successful

GIVEN a student is requesting all possible classes in the app
WHEN the app hits the /classes endpoint with a valid GET request
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:

  • class_erp
  • semester
  • classroom
  • subject
  • teacher
  • parent_class_erp
  • timeslot_1
  • timeslot_2
  • day_1
  • day_2
  • term_id
    AND the key classroom should be an object containing the following fields:
  • classroom_id
  • classroom
  • campus
    AND the key campus should be an object containing the following fields:
  • campus_id
  • campus
    AND the key subject should be an object containing the following fields:
  • subject_code
  • subject
    AND the key teacher should be an object containing the following fields:
  • teacher_id
  • full_name
  • average_rating
  • total_reviews
    AND the keys timeslot_1 and timeslot_2 should be objects containing the following fields:
  • timeslot_id
  • start_time
  • end_time
  • slot_number

Scenario 2: GET request with query parameters is successful

GIVEN a student is requesting all classes in the app
WHEN the app hits the /classes endpoint with a valid GET request
AND the query parameter contains subject_code="MKT201"
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:

  • class_erp
  • term_id
  • semester
  • classroom
  • subject
  • teacher
  • parent_class_erp
  • timeslot_1
  • timeslot_2
  • day_1
  • day_2
    AND the key subject_code should be equal to MKT201

Scenario 3: GET request is unsuccessful due to no classes

GIVEN a student is requesting all possible classes in the app
WHEN the app hits the /classes endpoint with a valid GET request
THEN the app should receive a status 404
AND the response headers' code parameter should contain "NotFoundException"

Scenario 4: GET request is incorrect due to unknown query parameters

GIVEN a student is requesting all possible reviews of a teacher in the app
WHEN the app hits the /classes endpoint with a valid GET request
AND contains 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 parameters

Scenario 5: GET request is unauthorized

GIVEN a student is requesting all possible classes in the app
WHEN the app hits the /classes 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 Status: Pending Priority: Medium user story A brief explanation of a functionality or an interaction with the system, from a user's perspective Type: Feature labels Nov 29, 2021
@arafaysaleem arafaysaleem self-assigned this Nov 29, 2021
@arafaysaleem arafaysaleem mentioned this issue Nov 29, 2021
9 tasks
@arafaysaleem arafaysaleem mentioned this issue Dec 13, 2021
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Completed Type: Feature 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