File "CreateNewOrganizationRequest.php"

Full Path: /var/www/html/back/app/Domain/Organizations/Requests/CreateNewOrganizationRequest.php
File size: 1.3 KB
MIME-type: text/x-php
Charset: utf-8

<?php

declare(strict_types=1);

namespace App\Domain\Organizations\Requests;

use App\BaseClasses\BaseApiRequest;

class CreateNewOrganizationRequest extends BaseApiRequest
{
    public static function bodyParameters(): array
    {
        return [
            'full_name' => ['description' => 'full_name'],
            'short_name' => ['description' => 'short_name'],
            'inn' => ['description' => 'inn'],
            'kpp' => ['description' => 'kpp'],
            'external_id' => ['description' => 'external_id'],
            'api_key' => ['description' => 'api_key'],
        ];
    }

    public static function example(): array
    {
        return [
            'full_name' => 'Тестовое предприятие',
            'short_name' => 'Тестовое предприятие',
            'inn' => '123456789012',
            'kpp' => '123456789',
            'external_id' => 'test_external_id',
            'api_key' => 'test_api_key',
        ];
    }

    public function rules(): array
    {
        return [
            'full_name' => 'string|required',
            'short_name' => 'string|nullable',
            'inn' => 'string|required',
            'kpp' => 'string|nullable',
            'external_id' => 'string|nullable',
            'api_key' => 'string|nullable',
        ];
    }


}