HEX
Server: LiteSpeed
System: Linux premium260.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
User: aliazzsr (627)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/aliazzsr/api.crm.vqode.com/controllers/SectorController.php
<?php
namespace app\controllers;

use app\components\BaseActiveController;
use app\models\enums\PermissionEnum;

class SectorController extends BaseActiveController
{
    public $modelClass = 'app\models\core\Sector';

    protected static $permissionRequired = PermissionEnum::REFERENCES;
}
/**
 * @SWG\Get(
 *   path="/sectors",
 *   tags={"Sector"},
 *   security={{"bearer":{}}},
 *   summary="Finds Sector records existing.",
 *     consumes={"application/json"},
 *     produces={"application/json"},
 *   @SWG\Response(response=200, description="Successful operation.",
 *     @SWG\Schema(type="array", @SWG\Items(ref="#/definitions/Sector"))
 *   ),
 *   @SWG\Response(response=401, description="Unauthorized."),
 *   @SWG\Response(response=422, description="Data validation error."),
 *   @SWG\Response(response=500, description="Internal server error.")
 * )
 *
 * @SWG\Get(
 *   path="/sectors/{id}",
 *   tags={"Sector"},
 *   security={{"bearer":{}}},
 *   summary="Returns a single Sector record.",
 *     consumes={"application/json"},
 *     produces={"application/json"},
 *   @SWG\Parameter(description="ID", in="path", name="id", required=true, type="integer"),
 *   @SWG\Response(response=200, description="Successful operation.", @SWG\Schema(ref="#/definitions/Sector")),
 *   @SWG\Response(response=401, description="Unauthorized."),
 *   @SWG\Response(response=404, description="Not found."),
 *   @SWG\Response(response=500, description="Internal server error.")
 * )
 *
 * @SWG\Post(
 *   path="/sectors",
 *   tags={"Sector"},
 *   security={{"bearer":{}}},
 *   summary="Creates a new Sector record.",
 *     consumes={"application/json"},
 *     produces={"application/json"},
 *   @SWG\Parameter(name="body", required=true, in="body", @SWG\Schema(
 *     ref="#/definitions/Sector", required={"name"}
 *    )),
 *   @SWG\Response(response=201, description="Successful operation."),
 *   @SWG\Response(response=401, description="Unauthorized."),
 *   @SWG\Response(response=422, description="Data validation error."),
 *   @SWG\Response(response=500, description="Internal server error.")
 * )
 *
 * @SWG\Put(
 *   path="/sectors/{id}",
 *   tags={"Sector"},
 *   security={{"bearer":{}}},
 *   summary="Updates an existed Sector record.",
 *     consumes={"application/json"},
 *     produces={"application/json"},
 *   @SWG\Parameter(description="ID", in="path", name="id", required=true, type="integer"),
 *   @SWG\Parameter(name="body", required=true, in="body", @SWG\Schema(
 *     ref="#/definitions/Sector")),
 *   @SWG\Response(response=401, description="Unauthorized."),
 *   @SWG\Response(response=422, description="Data validation error."),
 *   @SWG\Response(response=500, description="Internal server error.")
 * )
 *
 * @SWG\Delete(
 *   path="/sectors/{id}",
 *   tags={"Sector"},
 *   security={{"bearer":{}}},
 *   summary="Deletes a Sector record.",
 *     consumes={"application/json"},
 *     produces={"application/json"},
 *   @SWG\Parameter(description="ID", in="path", name="id", required=true, type="integer"),
 *   @SWG\Response(response=204, description="Successful operation."),
 *   @SWG\Response(response=401, description="Unauthorized."),
 *   @SWG\Response(response=404, description="Not found."),
 *   @SWG\Response(response=500, description="Internal server error.")
 * )
 */