a7038367e4
Task 9 Sprint 4: ImportController с 5 методами (store/index/show/ unknownStatuses/resolveUnknownStatuses), 2 FormRequest (StoreImportRequest / ResolveUnknownStatusesRequest), 5 маршрутов в routes/web.php под auth:sanctum+tenant. Defense-in-depth: явный where(tenant_id) поверх RLS (postgres superuser обходит BYPASSRLS на dev — паттерн DealController). Тест 8/8, Larastan baseline regen (только TestCall false positives). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
32 lines
777 B
PHP
32 lines
777 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
/**
|
|
* Валидация ручного маппинга неизвестных статусов воронки (§6.4 wizard).
|
|
*/
|
|
class ResolveUnknownStatusesRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return $this->user() !== null;
|
|
}
|
|
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'mappings' => ['required', 'array', 'min:1'],
|
|
'mappings.*.status_ru' => ['required', 'string', 'max:100'],
|
|
'mappings.*.slug' => ['required', 'string', Rule::exists('lead_statuses', 'slug')],
|
|
];
|
|
}
|
|
}
|