Guillermo - data staff [skip ci]

This commit is contained in:
AntonyAntonio 2017-04-18 01:39:55 -03:00
parent 8bc74384c2
commit 2b50c7a106
12 changed files with 235 additions and 0 deletions

View File

@ -2,6 +2,35 @@
use Respect\Validation\Validator as DataValidator;
DataValidator::with('CustomValidations', true);
/**
* @api {post} /staff/add Add a new staff member.
*
* @apiName Add
*
* @apiGroup staff
*
* @apiDescription This path add a new staff member.
*
* @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 {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
*
* @apiSuccess {Object} data
*
*/
class AddStaffController extends Controller {
const PATH = '/add';
const METHOD = 'POST';

View File

@ -2,6 +2,25 @@
use Respect\Validation\Validator as DataValidator;
DataValidator::with('CustomValidations', true);
/**
* @api {post} /staff/assign-ticket Assign a ticket to a staff member.
*
* @apiName Assign ticket
*
* @apiGroup staff
*
* @apiDescription This path assigns a ticket to a staff member.
*
* @apiPermission Staff level 1
*
* @apiParam {number} ticketNumber The number of the ticket to assign.
*
* @apiError {string} message
*
* @apiSuccess {Object} data
*
*/
class AssignStaffController extends Controller {
const PATH = '/assign-ticket';
const METHOD = 'POST';

View File

@ -2,6 +2,25 @@
use Respect\Validation\Validator as DataValidator;
use RedBeanPHP\Facade as RedBean;
/**
* @api {post} /staff/delete Delete a staff member.
*
* @apiName Delete
*
* @apiGroup staff
*
* @apiDescription This path deletes a staff member.
*
* @apiPermission Staff level 3
*
* @apiParam {number} staffId The id of the staff member.
*
* @apiError {String} message
*
* @apiSuccess {Object} data
*
*/
DataValidator::with('CustomValidations', true);
class DeleteStaffController extends Controller {

View File

@ -1,6 +1,33 @@
<?php
use Respect\Validation\Validator as DataValidator;
/**
* @api {post} /staff/edit Edit a staff member.
*
* @apiName Edit
*
* @apiGroup staff
*
* @apiDescription This path edits a staff member .
*
* @apiPermission Staff level 1
*
* @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.
*
* @apiError {String} message
*
* @apiSuccess {Object} data
*
*/
class EditStaffController extends Controller {
const PATH = '/edit';
const METHOD = 'POST';

View File

@ -1,6 +1,25 @@
<?php
use Respect\Validation\Validator as DataValidator;
/**
* @api {post} /staff/get-all-tickets Give back all tickets.
*
* @apiName Get all tickets
*
* @apiGroup staff
*
* @apiDescription This path give back all tickets created.
*
* @apiPermission Staff level 1
*
* @apiParam {number} page The page's number that it's looking for.
*
* @apiError {String} message
*
* @apiSuccess {Object} data
*
*/
class GetAllTicketsStaffController extends Controller {
const PATH = '/get-all-tickets';
const METHOD = 'POST';

View File

@ -1,6 +1,20 @@
<?php
use Respect\Validation\Validator as DataValidator;
/**
* @api {post} /staff/get-all Get information about all the staff members.
*
* @apiName Get all
*
* @apiGroup staff
*
* @apiDescription This path give back information about all the staff member.
*
* @apiPermission Staff level 3
*
* @apiSuccess {Object} data
*
*/
class GetAllStaffController extends Controller {
const PATH ='/get-all';

View File

@ -2,6 +2,21 @@
use RedBeanPHP\Facade as RedBean;
use Respect\Validation\Validator as DataValidator;
/**
* @api {post} /staff/get-new-tickets Get new tickets.
*
* @apiName Get new tickets
*
* @apiGroup staff
*
* @apiDescription This path give back new tickets.
*
* @apiPermission Staff level 1
*
* @apiSuccess {Object} data
*
*/
class GetNewTicketsStaffController extends Controller {
const PATH = '/get-new-tickets';
const METHOD = 'POST';

View File

@ -1,6 +1,21 @@
<?php
use Respect\Validation\Validator as DataValidator;
/**
* @api {post} /staff/get-tickets Get own tickets.
*
* @apiName Get tickets
*
* @apiGroup staff
*
* @apiDescription This path give back the tickets of current staff member.
*
* @apiPermission Staff level 1
*
* @apiSuccess {Object} data
*
*/
class GetTicketStaffController extends Controller {
const PATH = '/get-tickets';
const METHOD = 'POST';

View File

@ -2,6 +2,25 @@
use Respect\Validation\Validator as DataValidator;
DataValidator::with('CustomValidations', true);
/**
* @api {post} /staff/get Get information about a staff member.
*
* @apiName Get
*
* @apiGroup staff
*
* @apiDescription This path give back information about a staff member .
*
* @apiPermission Staff level 1
*
* @apiParam {number} staffId The id of the staff member searched.
*
* @apiError {String} message
*
* @apiSuccess {Object} data
*
*/
class GetStaffController extends Controller {
const PATH = '/get';
const METHOD = 'POST';

View File

@ -1,6 +1,25 @@
<?php
use Respect\Validation\Validator as DataValidator;
/**
* @api {post} /staff/last-events Give back the last events.
*
* @apiName Last events
*
* @apiGroup staff
*
* @apiDescription This path give back the last events.
*
* @apiPermission Staff level 1
*
* @apiParam {number} page The page's number of the list.
*
* @apiError {String} message
*
* @apiSuccess {Object} data
*
*/
class LastEventsStaffController extends Controller {
const PATH = '/last-events';
const METHOD = 'POST';

View File

@ -1,6 +1,27 @@
<?php
use Respect\Validation\Validator as DataValidator;
/**
* @api {post} /staff/search-tickets Search some tickets.
*
* @apiName Search tickets
*
* @apiGroup staff
*
* @apiDescription This path search some tickets.
*
* @apiPermission Staff level 1
*
* @apiParam {String} query key to search.
*
* @apiParam {number} page The number of page.
*
* @apiError {String} message
*
* @apiSuccess {Object} data
*
*/
class SearchTicketStaffController extends Controller {
const PATH = '/search-tickets';
const METHOD = 'POST';

View File

@ -2,6 +2,25 @@
use Respect\Validation\Validator as DataValidator;
DataValidator::with('CustomValidations', true);
/**
* @api {post} /staff/un-assign-ticket Un-assign a ticket.
*
* @apiName Un-assign ticket
*
* @apiGroup staff
*
* @apiDescription This path un assign a ticket of a staff member.
*
* @apiPermission Staff level 1
*
* @apiParam {number} ticketNumber Ticket number to un-assign.
*
* @apiError {String} message
*
* @apiSuccess {Object} data
*
*/
class UnAssignStaffController extends Controller {
const PATH = '/un-assign-ticket';
const METHOD = 'POST';