<?php

namespace Tests\Feature\Tenant;

use App\Models\Event;
use App\Models\Photo;

class PhotoModerationControllerTest extends TenantTestCase
{
    public function test_tenant_admin_can_approve_photo(): void
    {
        $event = Event::factory()->for($this->tenant)->create([
            'slug' => 'moderation-event',
        ]);
        $photo = Photo::factory()->for($event)->create([
            'status' => 'pending',
        ]);

        $response = $this->authenticatedRequest('PATCH', "/api/v1/tenant/events/{$event->slug}/photos/{$photo->id}", [
            'status' => 'approved',
        ]);

        $response->assertOk();
        $this->assertSame('approved', $photo->refresh()->status);
    }
}
