File: /home/aliazzsr/api.crm.vqode.com/controllers/CompanyProjectController.php
<?php
namespace app\controllers;
use app\components\BaseActiveController;
use app\models\enums\PermissionEnum;
class CompanyProjectController extends BaseActiveController
{
public $modelClass = 'app\models\core\CompanyProject';
protected static $permissionRequired = PermissionEnum::PROJECTS_ALL;
}
/**
* @SWG\Get(
* path="/company-projects?expand={models}",
* tags={"Company Projects"},
* security={{"bearer":{}}},
* summary="Finds CompanyProject records existing.",
* consumes={"application/json"},
* produces={"application/json"},
* @SWG\Parameter(in="path", name="models", type="string",
* description="List of relative to models comma-separated. Available: company,project"
* ),
* @SWG\Response(response=200, description="Successful operation.",
* @SWG\Schema(type="array", @SWG\Items(ref="#/definitions/CompanyProject"))
* ),
* @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="/company-projects/{id}?expand={models}",
* tags={"Company Projects"},
* security={{"bearer":{}}},
* summary="Returns a single CompanyProject record.",
* consumes={"application/json"},
* produces={"application/json"},
* @SWG\Parameter(description="Unique identifier", in="path", name="id", required=true, type="integer"),
* @SWG\Parameter(in="path", name="models", type="string",
* description="List of relative to models comma-separated. Available: company,project"
* ),
* @SWG\Response(response=200, description="Successful operation.", @SWG\Schema(ref="#/definitions/CompanyProject")),
* @SWG\Response(response=401, description="Unauthorized."),
* @SWG\Response(response=404, description="Not found."),
* @SWG\Response(response=500, description="Internal server error.")
* )
*
* @SWG\Post(
* path="/company-projects",
* tags={"Company Projects"},
* security={{"bearer":{}}},
* summary="Creates a new CompanyProject record.",
* consumes={"application/json"},
* produces={"application/json"},
* @SWG\Parameter(name="body", required=true, in="body", @SWG\Schema(
* ref="#/definitions/CompanyProject", 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="/company-projects/{id}",
* tags={"Company Projects"},
* security={{"bearer":{}}},
* summary="Updates an existed CompanyProject record.",
* consumes={"application/json"},
* produces={"application/json"},
* @SWG\Parameter(description="Unique identifier", in="path", name="id", required=true, type="integer"),
* @SWG\Parameter(name="body", required=true, in="body", @SWG\Schema(
* ref="#/definitions/CompanyProject")),
* @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="/company-projects/{id}",
* tags={"Company Projects"},
* security={{"bearer":{}}},
* summary="Deletes a CompanyProject record.",
* consumes={"application/json"},
* produces={"application/json"},
* @SWG\Parameter(description="Unique identifier", 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.")
* )
*/