Documentation

AccidentController extends BasePrivateApiController

Tags
Path

("/bad_case") Class AccidentController

category
subpackage

Api\Controllers

Table of Contents

$container  : Container
$database  : Explorer
$translator  : Translator
$accidentsManager  : AccidentsManager
$structuresManager  : StructuresManager
__construct()  : mixed
add()  : ApiResponse
get()  : ApiResponse
getAll()  : ApiResponse

Properties

Methods

__construct()

public __construct(Container $container, Explorer $database) : mixed
Parameters
$container : Container
$database : Explorer
Return values
mixed

add()

public add(ApiRequest $request, ApiResponse $response) : ApiResponse
Parameters
$request : ApiRequest
$response : ApiResponse
Tags
Path

("/")

Method

("POST")

OpenApi

(" summary: add new accident operationId: add_new_accident

tags: - bad_case requestBody: description: Method for adding new accident records required: true content: multipart/form-data: schema: type: object properties: event_dt: type: string format: string summary: Date create accidents in format d/m/Y structure: type: string format: string summary: A string representing the chain of structure levels. level1|level2|level3|... circumstance: type: string format: string summary: Circumstances of the incident degree_of_injury: type: string format: string summary: Injury severity file: type: string format: binary summary: Additional information file responses: '200': description: return new accident as json object content: application/json: schema: type: object properties: ctreate_dt: type: string format: string summary: date create accident in format Y-d-m h:i:s id: type: string format: string summary: accident id uuid: type: string format: string summary: uuid accident structure: type: integer format: int32 summary: identity structure conditions: type: string format: string summary: conditions accident injury_severity: type: string format: string summary: the severity of the employee's injury in the incident file: type: string format: string summary: path to file ")

Return values
ApiResponse

get()

public get(ApiRequest $request, ApiResponse $response) : ApiResponse
Parameters
$request : ApiRequest
$response : ApiResponse
Tags
Path

("/{uuid}")

Method

("GET")

RequestParameters

({ @RequestParameter(name="uuid", type="string", description="UUID violations") })

OpenApi

(" summary: get one accident operationId: get_one_accident tags: - bad_case responses: '200': description: return new accident as json object content: application/json: schema: type: object properties: ctreate_dt: type: string format: string summary: date create accident in format Y-d-m h:i:s id: type: string format: string summary: accident id uuid: type: string format: string summary: uuid accident structure: type: integer format: int32 summary: identity structure conditions: type: string format: string summary: conditions accident injury_severity: type: string format: string summary: the severity of the employee's injury in the incident file: type: string format: string summary: path to file ")

throws
JsonException
Return values
ApiResponse

getAll()

public getAll(ApiRequest $request, ApiResponse $response) : ApiResponse
Parameters
$request : ApiRequest
$response : ApiResponse
Tags
Path

("/")

Method

("GET")

OpenApi

(" summary: get list accidents operationId: get_list_accidents tags: - bad_case responses: '200': description: return new violation as json object content: application/json: schema: type: array summary: array violations items: type: object properties: ctreate_dt: type: string format: string summary: date create accident in format Y-d-m h:i:s id: type: string format: string summary: accident id uuid: type: string format: string summary: uuid accident structure: type: integer format: int32 summary: identity structure conditions: type: string format: string summary: conditions accident injury_severity: type: string format: string summary: the severity of the employee's injury in the incident file: type: string format: string summary: path to file ")

throws
JsonException
Return values
ApiResponse

Search results