WIP чекпойнт: lead-region/supplier бэкенд + фронт-редизайн + Pint + тесты
92 файла одной пачкой. Исключены чужие зоны: CLAUDE.md, .claude/settings.json, docs/observer/.pii-counters.json. gitleaks staged: no leaks found. Не верифицировано тестами - сохранение труда в историю. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use App\Models\Project;
|
||||
use App\Models\Tenant;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
@@ -31,11 +34,11 @@ it('rejects negative daily_limit / expected_volume / delivered_count', function
|
||||
'delivered_count' => 0,
|
||||
'created_at' => now(),
|
||||
]);
|
||||
})->throws(\Illuminate\Database\QueryException::class);
|
||||
})->throws(QueryException::class);
|
||||
|
||||
it('enforces composite PK (snapshot_date, project_id)', function () {
|
||||
$tenant = \App\Models\Tenant::factory()->create();
|
||||
$project = \App\Models\Project::factory()->for($tenant)->create();
|
||||
$tenant = Tenant::factory()->create();
|
||||
$project = Project::factory()->for($tenant)->create();
|
||||
DB::table('project_routing_snapshots')->insert([
|
||||
'snapshot_date' => '2026-05-28', 'project_id' => $project->id, 'tenant_id' => $tenant->id,
|
||||
'daily_limit' => 10, 'delivery_days_mask' => 127, 'regions' => '{}',
|
||||
@@ -48,5 +51,5 @@ it('enforces composite PK (snapshot_date, project_id)', function () {
|
||||
'daily_limit' => 20, 'delivery_days_mask' => 127, 'regions' => '{}',
|
||||
'signal_type' => 'call', 'expected_volume' => 20, 'delivered_count' => 0,
|
||||
'created_at' => now(),
|
||||
]))->toThrow(\Illuminate\Database\QueryException::class);
|
||||
]))->toThrow(QueryException::class);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user