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>
31 lines
703 B
PHP
31 lines
703 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
/**
|
|
* Валидация загрузки CSV-файла импорта (ТЗ §6.2).
|
|
*/
|
|
class StoreImportRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return $this->user() !== null;
|
|
}
|
|
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
// mimes csv,txt — экспорт crm.bp-gr.ru отдаётся как text/csv или text/plain.
|
|
'file' => ['required', 'file', 'mimes:csv,txt', 'max:10240'],
|
|
'dry_run' => ['sometimes', 'boolean'],
|
|
];
|
|
}
|
|
}
|