POST ./staff_att/sign_other
Handles the POST request for creating another type of sign entry.
Payload
Name | Value Type | Validation | Details |
---|---|---|---|
name | string | Required | Must be trimmed |
description | string | Optional | Will be stripped of tags and cleaned for XSS |
startDateTime | string | Required | Must be a valid date in 'Y-m-d H:i:s' format |
endDateTime | string | Required | Must be a valid date in 'Y-m-d H:i:s' format and greater than startDateTime |
Example
{"name": "Training Session","description": "Annual training for staff","startDateTime": "2023-10-01 09:00:00","endDateTime": "2023-10-01 12:00:00"}
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."}
Response
{"id": 1}