<?php

use App\Enums\DataChangeStatus;
use App\Models\Company;
use App\Models\DataChangeRequest;
use Illuminate\Foundation\Testing\RefreshDatabase;

uses(RefreshDatabase::class);

test('data change request can be created', function () {
    $company = Company::factory()->create();
    $request = DataChangeRequest::factory()->create([
        'entity_type' => Company::class,
        'entity_id' => $company->id,
        'status' => DataChangeStatus::PENDING,
    ]);

    expect($request->status)->toBe(DataChangeStatus::PENDING);
    expect($request->entity)->toBeInstanceOf(Company::class);
    expect($request->entity->id)->toBe($company->id);
});
