- Implemented IncoCompositionShowController to handle requests for inco composition details. - Created IncoCompositionDto for response data structure. - Added IncoCompositionShowRequest for request validation. - Developed IncoCompositionShowResponse for formatting API responses. - Introduced IncoCompositionShowPresenter and IncoCompositionShowView for presentation logic. - Added tests for IncoCompositionShow feature and OpenAPI conformance.
36 lines
763 B
PHP
36 lines
763 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Presentation\Api\V1\Http\Requests\IncoCompositions;
|
|
|
|
use Domain\Models\ValueObjects\Inco\IncoId;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
final class IncoCompositionShowRequest extends FormRequest
|
|
{
|
|
/** @return array<string, array<int, mixed>> */
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'incoId' => ['required', 'string'],
|
|
];
|
|
}
|
|
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
protected function prepareForValidation(): void
|
|
{
|
|
$this->merge([
|
|
'incoId' => $this->route('incoId'),
|
|
]);
|
|
}
|
|
|
|
public function incoId(): IncoId
|
|
{
|
|
return new IncoId((string) $this->string('incoId')->value());
|
|
}
|
|
}
|