Documentation

ViolationsController extends BasePrivateApiController
in package

Tags
Path

("/violations") Class DialogController

subpackage

Api\Controllers

Table of Contents

$container  : Container
$database  : Explorer
$translator  : Translator
$errors  : array<string|int, mixed>
$violationsManager  : mixed
__construct()  : mixed
addNew()  : ApiResponse
delete()  : ApiResponse
getAll()  : ApiResponse
getOne()  : ApiResponse
update()  : ApiResponse

Properties

Methods

__construct()

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

addNew()

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

("/")

Method

("POST")

OpenApi

(" summary: add new violation operationId: add_new_violation

tags: - violation requestBody: description: Optional description in Markdown required: true content: application/json: schema: type: object properties:

                      external_id:
                          type: string
                          format: string
                          summary: External violation id
                      create_dt:
                          type: string
                          format: string
                          summary: date create violation in format d/m/Y
                      expiration_dt:
                          type: string
                          format: string
                          summary: date expiratied violation in format d/m/Y
                      employee:
                          type: integer
                          format: int32
                          summary: id employee
                      reason:
                          type: string
                          format: string
                          summary: reason violations
                      instruction:
                          type: string
                          format: string
                          summary: number broken instruction

            examples:
                 violation:
                     summary: example violation input json
                     value:
                         external_id: 02106c93-8b32-48c4-9284-88990fc23a85
                         create_dt: 2021-11-01T10:21:30
                         expiration_dt: 2022-11-01T10:21:31
                         employee: 1278
                         reason: Сувал пальцы в разетку
                         instruction: 20.21

responses: '200': description: return new violation as json object content: application/json: schema: type: object properties: uuid: type: string format: string summary: Violation UUID external_id: type: string format: string summary: External violation id create_dt: type: string format: string summary: date create violation in format d/m/Y expiration_dt: type: string format: string summary: date expiratied violation in format d/m/Y employee: type: integer format: int32 summary: id employee reason: type: string format: string summary: reason violations instruction: type: string format: string summary: number broken instruction

")

throws
JsonException
Return values
ApiResponse

delete()

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

("/{uuid}")

Method

("DELETE")

RequestParameters

({ @RequestParameter(name="uuid", type="string", description="UUID violations") }) @OpenApi (" summary: delete violation operationId: delete_violation

 tags:
     - violation")
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 violations operationId: get_list_violations tags: - violation responses: '200': description: return new violation as json object content: application/json: schema: type: array summary: array violations items: type: object properties: uuid: type: string format: string summary: Violation UUID external_id: type: string format: string summary: External violation id create_dt: type: string format: string summary: date create violation in format d/m/Y expiration_dt: type: string format: string summary: date expiratied violation in format d/m/Y employee: type: integer format: int32 summary: id employee reason: type: string format: string summary: reason violations instruction: type: string format: string summary: number broken instruction

")

throws
JsonException
Return values
ApiResponse

getOne()

public getOne(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: add new violation operationId: get_one_violation

tags: - violation responses: '200': description: return new violation as json object content: application/json: schema: type: object properties: uuid: type: string format: string summary: Violation UUID external_id: type: string format: string summary: External violation id create_dt: type: string format: string summary: date create violation in format d/m/Y expiration_dt: type: string format: string summary: date expiratied violation in format d/m/Y employee: type: integer format: int32 summary: id employee reason: type: string format: string summary: reason violations instruction: type: string format: string summary: number broken instruction

")

throws
JsonException
Return values
ApiResponse

update()

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

("/{uuid}")

Method

("PUT")

RequestParameters

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

OpenApi

(" summary: update violation operationId: update_violation

tags: - violation requestBody: description: Optional description in Markdown required: true content: application/json: schema: type: object properties:

                      external_id:
                          type: string
                          format: string
                          summary: External violation id
                      create_dt:
                          type: string
                          format: string
                          summary: date create violation in format d/m/Y
                      expiration_dt:
                          type: string
                          format: string
                          summary: date expiratied violation in format d/m/Y
                      employee:
                          type: integer
                          format: int32
                          summary: id employee
                      reason:
                          type: string
                          format: string
                          summary: reason violations
                      instruction:
                          type: string
                          format: string
                          summary: number broken instruction

            examples:
                 violation:
                     summary: example violation input json
                     value:
                         external_id: 02106c93-8b32-48c4-9284-88990fc23a85
                         create_dt: 2021-11-01T10:21:30
                         expiration_dt: 2022-11-01T10:21:31
                         employee: 1278
                         reason: Сувал пальцы в разетку
                         instruction: 20.21

responses: '200': description: return new violation as json object content: application/json: schema: type: object properties: uuid: type: string format: string summary: Violation UUID external_id: type: string format: string summary: External violation id create_dt: type: string format: string summary: date create violation in format d/m/Y expiration_dt: type: string format: string summary: date expiratied violation in format d/m/Y employee: type: integer format: int32 summary: id employee reason: type: string format: string summary: reason violations instruction: type: string format: string summary: number broken instruction

")

throws
JsonException
Return values
ApiResponse

Search results