GET ./staff_att/report

Handles the GET request for retrieving staff attendance reports

Query Params

NameValue TypeValidationDetails
cadIDintegerOptionalMust be a natural number excluding zero
ascIDintegerRequiredMust be a natural number excluding zero
startDatestringRequiredMust be a valid date
endDatestringRequiredMust be a valid date
attendanceStatusFilterstringOptionalMust be one of ['missed', 'present', 'time-off']

Example

GET /api/v2/staff_att/report?cadID=12&ascID=34&startDate=2022-01-01&endDate=2022-01-31&attendanceStatusFilter=missed

Response

{
"meta": {
"countTotal": "30",
"countData": "30",
"countOffset": "0"
},
"data": {
"12": {
"teacher": {
// teacher's personal data...
},
"days": [
{
"date": "2022-01-01",
"activitiesPresent": {
"scheduled": "2",
"extra": "1"
},
"activitiesMissed": "0"
},
// more daily reports...
]
},
// more teacher reports...
}
}

Validation Custom Errors

Error Code: 100

Error Message: The {field} is required.

Description: The error is triggered when a required field is not provided in the request.


Error Code: 101

Error Message: The {field} is not a valid date.

Description: This error is triggered when startDate or endDate does not contain a valid date.


Error Code: 102

Error Message: The start date should be less than the end date.

Description: This error is triggered when the startDate is not less than the endDate.


Error Code: 103

Error Message: The date range should not exceed 31 days.

Description: This error is triggered when the date range specified by startDate and endDate exceeds 31 days.


Error Code: 104

Error Message: You do not have permission to access this resource.

Description: This error is triggered when the user does not have the required permissions to access the resource.


Example:

{
"errorCode": "101",
"errorMessage": "The startDate is not a valid date."
}