CoolCMS API

ComplaintManager
in package

FinalYes

Single entry of the front end into the complaint core.

Always goes through the Api (api/eshop/complaint/submit, /my-prefill, /my-complaints, /my-complaint); the front end never touches Doctrine complaint entities and never computes the quantity cap itself (done only by ComplaintManager).

NOTE: does not extend App\Core\Base\Front\Models\Managers\Manager (entity CRUD); it is an orchestration passthrough like CheckoutManager.

Table of Contents

Properties

$service  : ComplaintService

Methods

__construct()  : mixed
detail()  : array<string, mixed>
Returns the "My complaint" detail.
fileData()  : array<string, mixed>
Returns the relative path to an attachment of the user's own complaint for {@see \App\UI\Front\Eshop\Presenters\MyComplaintListPresenter::actionFile()}.
list()  : array<string, mixed>
Returns the "My complaints" list.
prefill()  : array<string, mixed>
Returns the form prefill: items with the remaining quantity and the code list of preferred resolutions. Used by `MyOrderListPresenter` (whether to show the "Claim goods" button) and `MyComplaintListPresenter::actionNew()` (form data).
submit()  : array<string, mixed>
Submits a complaint; the only customer write path.

Properties

Methods

detail()

Returns the "My complaint" detail.

public detail(int $id) : array<string, mixed>
Parameters
$id : int
Return values
array<string, mixed>

fileData()

Returns the relative path to an attachment of the user's own complaint for {@see \App\UI\Front\Eshop\Presenters\MyComplaintListPresenter::actionFile()}.

public fileData(int $complaintId, int $position) : array<string, mixed>

$position is the 1-based order, never cms_system_files.file_id.

Parameters
$complaintId : int
$position : int
Return values
array<string, mixed>

list()

Returns the "My complaints" list.

public list([int $limit = 20 ][, int $offset = 0 ]) : array<string, mixed>
Parameters
$limit : int = 20
$offset : int = 0
Return values
array<string, mixed>

prefill()

Returns the form prefill: items with the remaining quantity and the code list of preferred resolutions. Used by `MyOrderListPresenter` (whether to show the "Claim goods" button) and `MyComplaintListPresenter::actionNew()` (form data).

public prefill(int $orderId) : array<string, mixed>
Parameters
$orderId : int
Return values
array<string, mixed>

submit()

Submits a complaint; the only customer write path.

public submit(int $orderId, array<int, array{orderItemId: int, quantity: int}> $items, int|null $preferredSolutionId, string $description, array<int, array{name: string, path: string}> $files) : array<string, mixed>

orderId must belong to the logged-in user; the Api verifies it server-side from the JWT, the front end checks it only for UX (see the presenter).

Parameters
$orderId : int
$items : array<int, array{orderItemId: int, quantity: int}>
$preferredSolutionId : int|null
$description : string
$files : array<int, array{name: string, path: string}>
Return values
array<string, mixed>
On this page

Search results