POST ./staff_att/sign_timetable

Handles the POST request for creating a timetable sign entry.

Payload

NameValue TypeValidationDetails
descriptionstringOptionalWill be stripped of tags and cleaned for XSS
activityIDintegerRequiredMust be a natural number greater than zero
datestringRequiredMust be a valid date in 'Y-m-d' format
isVisibleStudentsintegerOptionalMust be either 0 or 1

Example

{
"description": "Math class",
"activityID": 456,
"date": "2023-10-01",
"isVisibleStudents": 1
}

Validation Custom Errors

Error Code: 101

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

Description: This error occurs when the provided date does not match the expected format Y-m-d H:i:s.

Location: Sign::_check_date method.

Example:

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

Error Code: 102

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

Description: This error occurs when the start date is not less than the end date.

Location: Sign::_compare_dates method.

Example:

{
"errorCode": "102",
"errorMessage": "The start date should be less than the end date."
}

Error Code: 103

Error Message: The activity does not exist.

Description: This error occurs when the specified activity ID does not correspond to any existing activity.

Location: Sign::sign_timetable_post method.

Example:

{
"errorCode": "103",
"errorMessage": "The activity does not exist."
}

Response

{
"id": 1
}