diff --git a/server/controllers/article/add-topic.php b/server/controllers/article/add-topic.php index 796a81b0..64065e53 100644 --- a/server/controllers/article/add-topic.php +++ b/server/controllers/article/add-topic.php @@ -14,12 +14,11 @@ DataValidator::with('CustomValidations', true); * @apiPermission Staff level 2 * * @apiParam {String} name Name of the new topic. + * @apiParam {String} icon Icon of the new topic. + * @apiParam {String} iconColor Icon's color of the new topic. * - * @apiParam {string} icon Icon of the new topic. - * - * @apiParam {string} iconColor Icon's color of the new topic. - * - * @apiError {String} message + * @apiUse NO_PERMISSION + * @apiUse INVALID_NAME * * @apiSuccess {Object} data * diff --git a/server/controllers/article/add.php b/server/controllers/article/add.php index 296e81c9..19439e11 100644 --- a/server/controllers/article/add.php +++ b/server/controllers/article/add.php @@ -14,14 +14,14 @@ DataValidator::with('CustomValidations', true); * @apiPermission Staff level 2 * * @apiParam {String} title Title of the new article. + * @apiParam {String} content Content of the new article. + * @apiParam {Number} position Position of the new article. + * @apiParam {Number} topicId Id of the articles's topic. * - * @apiParam {string} content Content of the new article. - * - * @apiParam {number} position Position of the new article. - * - * @apiParam {number} topicId Id of the articles's topic. - * - * @apiError {String} message + * @apiUse NO_PERMISSION + * @apiUse INVALID_NAME + * @apiUse INVALID_CONTENT + * @apiUse INVALID_TOPIC * * @apiSuccess {Object} data * diff --git a/server/controllers/article/delete-topic.php b/server/controllers/article/delete-topic.php index a754980f..18bbe396 100644 --- a/server/controllers/article/delete-topic.php +++ b/server/controllers/article/delete-topic.php @@ -13,11 +13,12 @@ DataValidator::with('CustomValidations', true); * * @apiPermission Staff level 2 * - * @apiParam {number} topicId Id of the topic. + * @apiParam {Number} topicId Id of the topic. * - * @apiError {String} message + * @apiUse NO_PERMISSION + * @apiUse INVALID_TOPIC * - * @apiSuccess {Object} data + * @apiSuccess {Object} data Empty object * */ diff --git a/server/controllers/article/delete.php b/server/controllers/article/delete.php index bc418c31..49afe4e1 100644 --- a/server/controllers/article/delete.php +++ b/server/controllers/article/delete.php @@ -13,11 +13,12 @@ DataValidator::with('CustomValidations', true); * * @apiPermission Staff level 2 * - * @apiParam {number} articleId Id of the article. + * @apiParam {Number} articleId Id of the article. * - * @apiError {String} message + * @apiUse NO_PERMISSION + * @apiUse INVALID_TOPIC * - * @apiSuccess {Object} data + * @apiSuccess {Object} data Empty object * */ diff --git a/server/controllers/article/edit-topic.php b/server/controllers/article/edit-topic.php index 3e4f4b8b..32369ab6 100644 --- a/server/controllers/article/edit-topic.php +++ b/server/controllers/article/edit-topic.php @@ -13,17 +13,15 @@ DataValidator::with('CustomValidations', true); * * @apiPermission Staff level 2 * - * @apiParam {number} topicId Id of the topic. - * + * @apiParam {Number} topicId Id of the topic. * @apiParam {String} name The new name of the topic. + * @apiParam {String} icon The new icon of the topic. + * @apiParam {String} iconColor The new Icon's color of the topic. * - * @apiParam {string} icon The new icon of the topic. + * @apiUse NO_PERMISSION + * @apiUse INVALID_TOPIC * - * @apiParam {string} iconColor The new Icon's color of the topic. - * - * @apiError {String} message - * - * @apiSuccess {Object} data + * @apiSuccess {Object} data Empty object * */ diff --git a/server/controllers/article/edit.php b/server/controllers/article/edit.php index 7386916c..c33ca008 100644 --- a/server/controllers/article/edit.php +++ b/server/controllers/article/edit.php @@ -13,19 +13,16 @@ DataValidator::with('CustomValidations', true); * * @apiPermission Staff level 2 * - * @apiParam {number} articleId Id of the article. + * @apiParam {Number} articleId Id of the article. + * @apiParam {Number} topicId Id of the topic of the article. + * @apiParam {String} content The new content of the article. + * @apiParam {String} title The new title of the article. + * @apiParam {Number} position The new position of the article. + * + * @apiUse NO_PERMISSION + * @apiUse INVALID_TOPIC * - * @apiParam {number} topicId Id of the topic of the article. - * - * @apiParam {string} content The new content of the article. - * - * @apiParam {string} title The new title of the article. - * - * @apiParam {number} position The new position of the article. - * - * @apiError {String} message - * - * @apiSuccess {Object} data + * @apiSuccess {Object} data Empty object * */ diff --git a/server/controllers/article/get-all.php b/server/controllers/article/get-all.php index 2b3781a2..35e49357 100644 --- a/server/controllers/article/get-all.php +++ b/server/controllers/article/get-all.php @@ -3,16 +3,18 @@ use Respect\Validation\Validator as DataValidator; DataValidator::with('CustomValidations', true); /** - * @api {post} /article/get-all Get all articles. + * @api {post} /article/get-all Retrieve all articles. * * @apiName Get all * * @apiGroup article * - * @apiDescription This path give back all the articles. + * @apiDescription This path retrieves all the articles. * - * @apiPermission any + * @apiPermission any or user * + * @apiUse NO_PERMISSION + * * @apiSuccess {Object} data * */ diff --git a/server/controllers/staff/add.php b/server/controllers/staff/add.php index 035a0167..cd809879 100644 --- a/server/controllers/staff/add.php +++ b/server/controllers/staff/add.php @@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator; DataValidator::with('CustomValidations', true); /** - * @api {post} /staff/add Add a new staff member. + * @api {post} /staff/add Add a new staff member. * * @apiName Add * @@ -14,18 +14,18 @@ DataValidator::with('CustomValidations', true); * @apiPermission Staff level 3 * * @apiParam {String} name The name of the new staff member. - * * @apiParam {String} email The email of the new staff member. - * * @apiParam {String} password The password of the new staff member. - * - * @apiParam {number} level The level of the new staff member. + * @apiParam {Number} level The level of the new staff member. + * @apiParam {String} profilePic The profile pic of the new staff member. + * @apiParam {String} departments The departments that will have assigned the new staff member. * - * @apiParam {string} profilePic The profile pic of the new staff member. - * - * @apiParam {string} departments The departments that will have assigned the new staff member. - * - * @apiError {String} message + * @apiUse NO_PERMISSION + * @apiUse INVALID_NAME + * @apiUse INVALID_EMAIL + * @apiUse INVALID_PASSWORD + * @apiUse INVALID_LEVEL + * @apiUse ALREADY_A_STAFF * * @apiSuccess {Object} data * diff --git a/server/controllers/staff/assign-ticket.php b/server/controllers/staff/assign-ticket.php index d106ae4f..9a84e73e 100644 --- a/server/controllers/staff/assign-ticket.php +++ b/server/controllers/staff/assign-ticket.php @@ -13,11 +13,14 @@ DataValidator::with('CustomValidations', true); * * @apiPermission Staff level 1 * - * @apiParam {number} ticketNumber The number of the ticket to assign. + * @apiParam {Number} ticketNumber The number of the ticket to assign. * - * @apiError {string} message - * - * @apiSuccess {Object} data + * @apiUse NO_PERMISSION + * @apiUse INVALID_TICKET + * @apiUse TICKET_ALREADY_ASSIGNED + * @apiUse INVALID_DEPARTMENT + * + * @apiSuccess {Object} data Empty object * */ diff --git a/server/controllers/staff/delete.php b/server/controllers/staff/delete.php index b51cd3b7..cf9445fd 100644 --- a/server/controllers/staff/delete.php +++ b/server/controllers/staff/delete.php @@ -13,11 +13,12 @@ use RedBeanPHP\Facade as RedBean; * * @apiPermission Staff level 3 * - * @apiParam {number} staffId The id of the staff member. + * @apiParam {Number} staffId The id of the staff member. * - * @apiError {String} message + * @apiUse NO_PERMISSION + * @apiUse INVALID_STAFF * - * @apiSuccess {Object} data + * @apiSuccess {Object} data Empty object * */ diff --git a/server/controllers/staff/edit.php b/server/controllers/staff/edit.php index 44897e1a..fa476102 100644 --- a/server/controllers/staff/edit.php +++ b/server/controllers/staff/edit.php @@ -2,7 +2,7 @@ use Respect\Validation\Validator as DataValidator; /** - * @api {post} /staff/edit Edit a staff member. + * @api {post} /staff/edit Edit a staff member. * * @apiName Edit * @@ -12,19 +12,16 @@ use Respect\Validation\Validator as DataValidator; * * @apiPermission Staff level 1 * - * @apiParam {number} staffId Id of the staff. - * + * @apiParam {Number} staffId Id of the staff. * @apiParam {String} departments The name of the departments to change. - * * @apiParam {String} email The new email of the staff member. - * * @apiParam {String} password The new password of the staff member. - * - * @apiParam {number} level The new level of the staff member. + * @apiParam {Number} level The new level of the staff member. * - * @apiError {String} message + * @apiUse NO_PERMISSION + * @apiUse INVALID_STAFF * - * @apiSuccess {Object} data + * @apiSuccess {Object} data Empty object * */ diff --git a/server/controllers/staff/get-all-tickets.php b/server/controllers/staff/get-all-tickets.php index f649d26c..90956f21 100644 --- a/server/controllers/staff/get-all-tickets.php +++ b/server/controllers/staff/get-all-tickets.php @@ -2,19 +2,20 @@ use Respect\Validation\Validator as DataValidator; /** - * @api {post} /staff/get-all-tickets Give back all tickets. + * @api {post} /staff/get-all-tickets Retrieve all tickets. * * @apiName Get all tickets * * @apiGroup staff * - * @apiDescription This path give back all tickets created. + * @apiDescription This path retrieves all tickets created. * * @apiPermission Staff level 1 * - * @apiParam {number} page The page's number that it's looking for. + * @apiParam {Number} page The page's number that it's looking for. * - * @apiError {String} message + * @apiUse NO_PERMISSION + * @apiUse INVALID_PAGE * * @apiSuccess {Object} data * diff --git a/server/controllers/staff/get-all.php b/server/controllers/staff/get-all.php index 62b0fdb1..ce656906 100644 --- a/server/controllers/staff/get-all.php +++ b/server/controllers/staff/get-all.php @@ -2,15 +2,17 @@ use Respect\Validation\Validator as DataValidator; /** - * @api {post} /staff/get-all Get information about all the staff members. + * @api {post} /staff/get-all Retrieve information about all the staff members. * * @apiName Get all * * @apiGroup staff * - * @apiDescription This path give back information about all the staff member. + * @apiDescription This path retrieves information about all the staff member. * * @apiPermission Staff level 3 + * + * @apiUse NO_PERMISSION * * @apiSuccess {Object} data * diff --git a/server/controllers/staff/get-new-tickets.php b/server/controllers/staff/get-new-tickets.php index b18242b6..e36ba3eb 100644 --- a/server/controllers/staff/get-new-tickets.php +++ b/server/controllers/staff/get-new-tickets.php @@ -3,16 +3,18 @@ use RedBeanPHP\Facade as RedBean; use Respect\Validation\Validator as DataValidator; /** - * @api {post} /staff/get-new-tickets Get new tickets. + * @api {post} /staff/get-new-tickets Retrieve new tickets. * * @apiName Get new tickets * * @apiGroup staff * - * @apiDescription This path give back new tickets. + * @apiDescription This path retrieves new tickets. * * @apiPermission Staff level 1 * + * @apiUse NO_PERMISSION + * * @apiSuccess {Object} data * */ diff --git a/server/controllers/staff/get-tickets.php b/server/controllers/staff/get-tickets.php index 940127f8..352bca6a 100644 --- a/server/controllers/staff/get-tickets.php +++ b/server/controllers/staff/get-tickets.php @@ -2,16 +2,18 @@ use Respect\Validation\Validator as DataValidator; /** - * @api {post} /staff/get-tickets Get own tickets. + * @api {post} /staff/get-tickets Retrieve own tickets. * * @apiName Get tickets * * @apiGroup staff * - * @apiDescription This path give back the tickets of current staff member. + * @apiDescription This path retrieves the tickets of current staff member. * * @apiPermission Staff level 1 * + * @apiUse NO_PERMISSION + * * @apiSuccess {Object} data * */ diff --git a/server/controllers/staff/get.php b/server/controllers/staff/get.php index 2416488b..e42eee21 100644 --- a/server/controllers/staff/get.php +++ b/server/controllers/staff/get.php @@ -3,19 +3,19 @@ use Respect\Validation\Validator as DataValidator; DataValidator::with('CustomValidations', true); /** - * @api {post} /staff/get Get information about a staff member. + * @api {post} /staff/get Retrieve information about a staff member. * * @apiName Get * * @apiGroup staff * - * @apiDescription This path give back information about a staff member . + * @apiDescription This path retrieves information about a staff member . * * @apiPermission Staff level 1 * - * @apiParam {number} staffId The id of the staff member searched. + * @apiParam {Number} staffId The id of the staff member searched. * - * @apiError {String} message + * @apiUse NO_PERMISSION * * @apiSuccess {Object} data * diff --git a/server/controllers/staff/last-events.php b/server/controllers/staff/last-events.php index 59e089e1..6652b8b2 100644 --- a/server/controllers/staff/last-events.php +++ b/server/controllers/staff/last-events.php @@ -2,19 +2,20 @@ use Respect\Validation\Validator as DataValidator; /** - * @api {post} /staff/last-events Give back the last events. + * @api {post} /staff/last-events Retrieve the last events. * * @apiName Last events * * @apiGroup staff * - * @apiDescription This path give back the last events. + * @apiDescription This path retrieves the last events. * * @apiPermission Staff level 1 * - * @apiParam {number} page The page's number of the list. + * @apiParam {Number} page The page's number of the list. * - * @apiError {String} message + * @apiUse NO_PERMISSION + * @apiUse INVALID_PAGE * * @apiSuccess {Object} data * diff --git a/server/controllers/staff/search-tickets.php b/server/controllers/staff/search-tickets.php index 628e3f7f..c6c166df 100644 --- a/server/controllers/staff/search-tickets.php +++ b/server/controllers/staff/search-tickets.php @@ -2,7 +2,7 @@ use Respect\Validation\Validator as DataValidator; /** - * @api {post} /staff/search-tickets Search some tickets. + * @api {post} /staff/search-tickets Search some tickets. * * @apiName Search tickets * @@ -12,11 +12,12 @@ use Respect\Validation\Validator as DataValidator; * * @apiPermission Staff level 1 * - * @apiParam {String} query key to search. + * @apiParam {String} query Key to search. + * @apiParam {Number} page The number of page. * - * @apiParam {number} page The number of page. - * - * @apiError {String} message + * @apiUse NO_PERMISSION + * @apiUse INVALID_QUERY + * @apiUse INVALID_PAGE * * @apiSuccess {Object} data * diff --git a/server/controllers/staff/un-assign-ticket.php b/server/controllers/staff/un-assign-ticket.php index 8471cf27..cadc3cbd 100644 --- a/server/controllers/staff/un-assign-ticket.php +++ b/server/controllers/staff/un-assign-ticket.php @@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator; DataValidator::with('CustomValidations', true); /** - * @api {post} /staff/un-assign-ticket Un-assign a ticket. + * @api {post} /staff/un-assign-ticket Un-assign a ticket. * * @apiName Un-assign ticket * @@ -13,11 +13,12 @@ DataValidator::with('CustomValidations', true); * * @apiPermission Staff level 1 * - * @apiParam {number} ticketNumber Ticket number to un-assign. + * @apiParam {Number} ticketNumber Ticket number to un-assign. * - * @apiError {String} message + * @apiUse NO_PERMISSION + * @apiUse INVALID_TICKET * - * @apiSuccess {Object} data + * @apiSuccess {Object} data Empty object * */ diff --git a/server/controllers/system/add-api-key.php b/server/controllers/system/add-api-key.php index c943aba4..26e2d966 100644 --- a/server/controllers/system/add-api-key.php +++ b/server/controllers/system/add-api-key.php @@ -12,9 +12,11 @@ use Respect\Validation\Validator as DataValidator; * * @apiPermission Staff level 3 * - * @apiParam {string} name Number of the new api-key. + * @apiParam {String} name Name of the new api-key. * - * @apiError {String} message + * @apiUse NO_PERMISSION + * @apiUse INVALID_NAME + * @apiUse NAME_ALREADY_USED * * @apiSuccess {Object} data * diff --git a/server/controllers/system/add-department.php b/server/controllers/system/add-department.php index aab91e6e..9bdfbaea 100644 --- a/server/controllers/system/add-department.php +++ b/server/controllers/system/add-department.php @@ -12,9 +12,10 @@ use Respect\Validation\Validator as DataValidator; * * @apiPermission Staff level 3 * - * @apiParam {string} name Number of the new department. + * @apiParam {String} name Name of the new department. * - * @apiError {String} message + * @apiUse NO_PERMISSION + * @apiUse INVALID_NAME * * @apiSuccess {Object} data * diff --git a/server/controllers/system/backup-database.php b/server/controllers/system/backup-database.php index 709e23f3..0e10a7e9 100644 --- a/server/controllers/system/backup-database.php +++ b/server/controllers/system/backup-database.php @@ -12,7 +12,7 @@ use Ifsnop\Mysqldump as IMysqldump; * * @apiPermission Staff level 3 * - * @apiSuccess {Object} data + * @apiUse NO_PERMISSION * */ diff --git a/server/controllers/system/check-requirements.php b/server/controllers/system/check-requirements.php index 2de68b7c..6dcd587d 100644 --- a/server/controllers/system/check-requirements.php +++ b/server/controllers/system/check-requirements.php @@ -1,13 +1,13 @@