Guillermo - data ticket [skip ci]

This commit is contained in:
AntonyAntonio 2017-04-16 23:59:11 -03:00
parent 81e9c632b3
commit be3d74ab92
25 changed files with 306 additions and 28 deletions

View File

@ -2,6 +2,29 @@
use Respect\Validation\Validator as DataValidator;
DataValidator::with('CustomValidations', true);
/**
* @api {post} /ticket/add-custom-response Add new responses.
*
* @apiName Add custom response
*
* @apiGroup Ticket
*
* @apiDescription This path allows create new responses to tickets.
*
* @apiPermission Staff Level 2
*
* @apiParam {String} name Name of the response.
*
* @apiParam {String} content Content of the response.
*
* @apiParam {String} language Language of the response.
*
* @apiError {String} message
*
* @apiSuccess {Object} data
*
*/
class AddCustomResponseController extends Controller {
const PATH = '/add-custom-response';
const METHOD = 'POST';

View File

@ -2,6 +2,27 @@
use Respect\Validation\Validator as DataValidator;
DataValidator::with('CustomValidations', true);
/**
* @api {post} /ticket/change-department Change the department of a ticket.
*
* @apiName Change department
*
* @apiGroup Ticket
*
* @apiDescription This path change the department of a ticket.
*
* @apiPermission Staff Level 1
*
* @apiParam {number} ticketNumber The number of a ticket.
*
* @apiParam {number} departmentId The id of the new department of the ticket.
*
* @apiError {String} message
*
* @apiSuccess {Object} data
*
*/
class ChangeDepartmentController extends Controller {
const PATH = '/change-department';
const METHOD = 'POST';

View File

@ -1,6 +1,27 @@
<?php
use Respect\Validation\Validator as DataValidator;
/**
* @api {post} /ticket/change-priority Change the priority of a ticket.
*
* @apiName Change priority
*
* @apiGroup Ticket
*
* @apiDescription This path change the priority of a ticket.
*
* @apiPermission Staff Level 1
*
* @apiParam {number} ticketNumber The number of a ticket.
*
* @apiParam {string} priority The new priority of the ticket.
*
* @apiError {String} message
*
* @apiSuccess {Object} data
*
*/
class ChangePriorityController extends Controller {
const PATH = '/change-priority';
const METHOD = 'POST';

View File

@ -2,6 +2,29 @@
use Respect\Validation\Validator as DataValidator;
DataValidator::with('CustomValidations', true);
/**
* @api {post} /ticket/check Check if a ticket was or not readed.
*
* @apiName Check
*
* @apiGroup Ticket
*
* @apiDescription This path check if a ticket was or not readed.
*
* @apiPermission any
*
* @apiParam {number} ticketNumber The number of a ticket.
*
* @apiParam {string} email Email of the person who created the ticket.
*
* @apiParam {string} captcha Encrypted value generated by google captcha client.
*
* @apiError {String} message
*
* @apiSuccess {Object} data
*
*/
class CheckTicketController extends Controller {
const PATH = '/check';
const METHOD = 'POST';

View File

@ -2,6 +2,25 @@
use Respect\Validation\Validator as DataValidator;
DataValidator::with('CustomValidations', true);
/**
* @api {post} /ticket/close Close a ticket.
*
* @apiName Close
*
* @apiGroup Ticket
*
* @apiDescription This path close a ticket.
*
* @apiPermission user
*
* @apiParam {number} ticketNumber The number of a ticket.
*
* @apiError {String} message
*
* @apiSuccess {Object} data
*
*/
class CloseController extends Controller {
const PATH = '/close';
const METHOD = 'POST';

View File

@ -2,6 +2,29 @@
use Respect\Validation\Validator as DataValidator;
DataValidator::with('CustomValidations', true);
/**
* @api {post} /ticket/comment Comment a ticket.
*
* @apiName Comment
*
* @apiGroup Ticket
*
* @apiDescription This path comment a ticket.
*
* @apiPermission user
*
* @apiParam {string} content Content of the comment.
*
* @apiParam {number} ticketNumber The number of the ticket to comment.
*
* @apiParam {string} csrf_token Token of the session.
*
* @apiError {String} message
*
* @apiSuccess {Object} data
*
*/
class CommentController extends Controller {
const PATH = '/comment';
const METHOD = 'POST';

View File

@ -2,6 +2,35 @@
use Respect\Validation\Validator as DataValidator;
DataValidator::with('CustomValidations', true);
/**
* @api {post} /ticket/create Create a new ticket.
*
* @apiName Create
*
* @apiGroup Ticket
*
* @apiDescription This path create a new ticket.
*
* @apiPermission user
*
* @apiParam {string} title Title of the ticket.
*
* @apiParam {string} content Content of the ticket.
*
* @apiParam {number} departmentId The id of the department of the current ticket.
*
* @apiParam {string} language The language of the ticket.
*
* @apiParam {string} email The email of the user who created the ticket.
*
* @apiParam {string} name The Name of the author of the ticket.
*
* @apiError {String} message
*
* @apiSuccess {Object} data
*
*/
class CreateController extends Controller {
const PATH = '/create';
const METHOD = 'POST';

View File

@ -2,6 +2,25 @@
use Respect\Validation\Validator as DataValidator;
DataValidator::with('CustomValidations', true);
/**
* @api {post} /ticket/delete-custom-response Delete a custom response.
*
* @apiName Delete custom response
*
* @apiGroup Ticket
*
* @apiDescription This path delete a custom response.
*
* @apiPermission user
*
* @apiParam {number} id Id of the custom response to delete.
*
* @apiError {String} message
*
* @apiSuccess {Object} data
*
*/
class DeleteCustomResponseController extends Controller {
const PATH = '/delete-custom-response';
const METHOD = 'POST';

View File

@ -2,6 +2,31 @@
use Respect\Validation\Validator as DataValidator;
DataValidator::with('CustomValidations', true);
/**
* @api {post} /ticket/edit-custom-response Edit a custom response.
*
* @apiName Edit custom response
*
* @apiGroup Ticket
*
* @apiDescription This path edit a custom response.
*
* @apiPermission Staff level 2
*
* @apiParam {number} id Id of the custom response to edit.
*
* @apiParam {string} content The new content of the custom response.
*
* @apiParam {string} language The new language of the custom response.
*
* @apiParam {string} name The new name of the custom response.
*
* @apiError {String} message
*
* @apiSuccess {Object} data
*
*/
class EditCustomResponseController extends Controller {
const PATH = '/edit-custom-response';
const METHOD = 'POST';

View File

@ -2,6 +2,21 @@
use Respect\Validation\Validator as DataValidator;
DataValidator::with('CustomValidations', true);
/**
* @api {post} /ticket/get-custom-responses give back customs responses.
*
* @apiName Get custom responses
*
* @apiGroup Ticket
*
* @apiDescription This path give back custom responses.
*
* @apiPermission Staff level 1
*
* @apiSuccess {Object} data
*
*/
class GetCustomResponsesController extends Controller {
const PATH = '/get-custom-responses';
const METHOD = 'POST';

View File

@ -2,6 +2,27 @@
use Respect\Validation\Validator as DataValidator;
DataValidator::with('CustomValidations', true);
/**
* @api {post} /ticket/get give back information about a ticket.
*
* @apiName Get
*
* @apiGroup Ticket
*
* @apiDescription This path give back information about a ticket.
*
* @apiPermission any
*
* @apiParam {number} ticketNumber The number of the ticket.
*
* @apiParam {string} csrf_token Token of the session.
*
* @apiError {String} message
*
* @apiSuccess {Object} data
*
*/
class TicketGetController extends Controller {
const PATH = '/get';
const METHOD = 'POST';

View File

@ -1,6 +1,25 @@
<?php
use Respect\Validation\Validator as DataValidator;
/**
* @api {post} /ticket/re-open Re open a closed ticket.
*
* @apiName Re open
*
* @apiGroup Ticket
*
* @apiDescription This path re open a closed ticket.
*
* @apiPermission user
*
* @apiParam {string} ticketNumber Number of the ticket to be reopened.
*
* @apiError {String} message
*
* @apiSuccess {Object} data
*
*/
class ReOpenController extends Controller {
const PATH = '/re-open';
const METHOD = 'POST';

View File

@ -1,6 +1,26 @@
<?php
use Respect\Validation\Validator as DataValidator;
/**
* @api {post} /ticket/seen See if a ticket was or not seen.
*
* @apiName Seen
*
* @apiGroup Ticket
*
* @apiDescription This path see if a ticket was or not seen.
*
* @apiPermission user
*
* @apiParam {string} ticketNumber Number of the ticket.
*
* @apiError {String} message
*
* @apiSuccess {Object} data
*
*/
class SeenController extends Controller {
const PATH = '/seen';
const METHOD = 'POST';

View File

@ -2,7 +2,7 @@
use Respect\Validation\Validator as DataValidator;
/**
* @api {post} /user/ban Bans email users
* @api {post} /user/ban Bans email users.
*
* @apiName BanUser
*
@ -12,7 +12,7 @@ use Respect\Validation\Validator as DataValidator;
*
* @apiPermission Staff Level 1
*
* @apiParam {String} email email of user to ban.
* @apiParam {String} email Email of user to ban.
*
* @apiError {String} message
*

View File

@ -1,9 +1,9 @@
<?php
/**
* @api {post} /user/check-session check if session exist or not
* @api {post} /user/check-session Check if session exist or not.
*
* @apiName check-session
* @apiName check session
*
* @apiGroup User
*

View File

@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
use RedBeanPHP\Facade as RedBean;
/**
* @api {post} /user/delete Delete a user
* @api {post} /user/delete Delete a user.
*
* @apiName delete
*
@ -13,7 +13,7 @@ use RedBeanPHP\Facade as RedBean;
*
* @apiPermission Staff level 1
*
* @apiParam {number} userId the id of the user to delete
* @apiParam {number} userId The id of the user to delete.
*
* @apiError {String} message
*

View File

@ -12,7 +12,7 @@ use Respect\Validation\Validator as DataValidator;
*
* @apiPermission User
*
* @apiParam {string} newEmail the new email that the user wants to change
* @apiParam {string} newEmail The new email that the user wants to change.
*
* @apiError {String} message
*

View File

@ -12,9 +12,9 @@ use Respect\Validation\Validator as DataValidator;
*
* @apiPermission User
*
* @apiParam {string} newPassword the new password that the user wants to change.
* @apiParam {string} newPassword The new password that the user wants to change.
*
* @apiParam {string} oldPassword the actual password of the user.
* @apiParam {string} oldPassword The actual password of the user.
*
* @apiError {String} message
*

View File

@ -12,7 +12,7 @@ use Respect\Validation\Validator as DataValidator;
*
* @apiPermission Staff level 1
*
* @apiParam {number} page number of pages of users.
* @apiParam {number} page Number of pages of users.
*
* @apiParam {string} orderBy Parameter to order the users by tickets or id.
*

View File

@ -1,6 +1,6 @@
<?php
/**
* @api {post} /user/logout log out the current user.
* @api {post} /user/logout Log out the current user.
*
* @apiName log out
*

View File

@ -3,7 +3,7 @@ use Respect\Validation\Validator as DataValidator;
DataValidator::with('CustomValidations', true);
/**
* @api {post} /user/recover-password change the password of the user using a token sended from the email
* @api {post} /user/recover-password Change the password of the user using a token sended from the email.
*
* @apiName recover password
*
@ -13,11 +13,11 @@ DataValidator::with('CustomValidations', true);
*
* @apiPermission Any
*
* @apiParam {string} email the email of the user who forgot the password.
* @apiParam {string} email The email of the user who forgot the password.
*
* @apiParam {string} password the new password of the user.
* @apiParam {string} password The new password of the user.
*
* @apiParam {string} token the token that was sended to the email of the user.
* @apiParam {string} token The token that was sended to the email of the user.
*
* @apiError {String} message
*

View File

@ -9,11 +9,11 @@ DataValidator::with('CustomValidations', true);
*
* @apiGroup User
*
* @apiDescription This path send a token to the email of the user to change his password
* @apiDescription This path send a token to the email of the user to change his password.
*
* @apiPermission Any
*
* @apiParam {string} email the email of the user who forgot the password.
* @apiParam {string} email The email of the user who forgot the password.
*
* @apiError {String} message
*

View File

@ -4,23 +4,23 @@ use Respect\Validation\Validator as DataValidator;
DataValidator::with('CustomValidations', true);
/**
* @api {post} /user/signup sign up a new user
* @api {post} /user/signup Sign up a new user
*
* @apiName sign up
*
* @apiGroup User
*
* @apiDescription This path sign up a user on the system
* @apiDescription This path sign up a user on the system.
*
* @apiPermission Any
*
* @apiParam {string} name the name of the new user.
* @apiParam {string} name The name of the new user.
*
* @apiParam {string} email the email of the new user.
* @apiParam {string} email The email of the new user.
*
* @apiParam {string} password the password of the new user.
* @apiParam {string} password The password of the new user.
*
* @apiParam {string} apyKey key to sign up a user if the user system is disabled.
* @apiParam {string} apyKey Key to sign up a user if the user system is disabled.
*
* @apiError {String} message
*

View File

@ -2,7 +2,7 @@
use Respect\Validation\Validator as DataValidator;
/**
* @api {post} /user/un-ban take a user out of banned list.
* @api {post} /user/un-ban Take a user out of banned list.
*
* @apiName un ban
*
@ -12,7 +12,7 @@ use Respect\Validation\Validator as DataValidator;
*
* @apiPermission Staff level 1
*
* @apiParam {string} email the email of the user who was banned.
* @apiParam {string} email The email of the user who was banned.
*
* @apiError {String} message
*

View File

@ -2,7 +2,7 @@
use Respect\Validation\Validator as DataValidator;
/**
* @api {post} /user/verify verify the email of a new user.
* @api {post} /user/verify Verify the email of a new user.
*
* @apiName verify
*
@ -12,9 +12,9 @@ use Respect\Validation\Validator as DataValidator;
*
* @apiPermission any
*
* @apiParam {string} email the email of the user.
* @apiParam {string} email The email of the user.
*
* @apiParam {string} token the key of validation the user.
* @apiParam {string} token The key of validation the user.
*
* @apiError {String} message
*