style+done(p2): pint formatting + P2 plan DONE marker

This commit is contained in:
Дмитрий
2026-05-22 18:48:03 +03:00
parent 37f5a321e6
commit 5df34a61eb
16 changed files with 164 additions and 141 deletions
@@ -5,27 +5,28 @@ declare(strict_types=1);
use App\Models\Project;
use App\Models\Tenant;
use App\Models\User;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Queue;
uses(\Illuminate\Foundation\Testing\DatabaseTransactions::class);
uses(DatabaseTransactions::class);
beforeEach(function () {
Queue::fake();
$this->tenant = Tenant::factory()->create();
$this->user = User::factory()->create(['tenant_id' => $this->tenant->id]);
$this->user = User::factory()->create(['tenant_id' => $this->tenant->id]);
DB::statement('SET app.current_tenant_id = ' . $this->tenant->id);
DB::statement('SET app.current_tenant_id = '.$this->tenant->id);
});
it('logs project.created when a project is stored', function () {
$this->actingAs($this->user)->postJson('/api/projects', [
'name' => 'Окна СПб',
'signal_type' => 'site',
'signal_identifier' => 'okna-spb.ru',
'name' => 'Окна СПб',
'signal_type' => 'site',
'signal_identifier' => 'okna-spb.ru',
'daily_limit_target' => 50,
'regions' => [],
'regions' => [],
'delivery_days_mask' => 127,
])->assertStatus(201);
@@ -40,7 +41,7 @@ it('logs project.created when a project is stored', function () {
it('logs project.updated with before/after diff when a project is patched', function () {
$project = Project::factory()->create([
'tenant_id' => $this->tenant->id,
'tenant_id' => $this->tenant->id,
'daily_limit_target' => 10,
]);
@@ -57,7 +58,7 @@ it('logs project.updated with before/after diff when a project is patched', func
expect($row)->not->toBeNull();
$before = json_decode($row->payload_before, true);
$after = json_decode($row->payload_after, true);
$after = json_decode($row->payload_after, true);
expect($before)->toHaveKey('daily_limit_target');
expect($after)->toHaveKey('daily_limit_target');
@@ -86,7 +87,7 @@ it('logs project.bulk_<action> when a bulk action is executed', function () {
$this->actingAs($this->user)->postJson('/api/projects/bulk', [
'action' => 'pause',
'ids' => [$p1->id, $p2->id],
'ids' => [$p1->id, $p2->id],
])->assertOk()->assertJsonPath('updated', 2);
$row = DB::table('tenant_operations_log')