<?php

namespace Tests\Unit\Services\Reimbursements;

use App\Services\Reimbursements\ReimbursementBatchService;
use App\Services\Reimbursements\ReimbursementLookupService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;

class ReimbursementBatchServiceTest extends TestCase
{
    use RefreshDatabase;

    public function test_create_batch_assigns_sequence_and_title(): void
    {
        $service = new ReimbursementBatchService(new ReimbursementLookupService());

        $batch = $service->createBatch(null, 1, '2025-2026', 'Fall');

        $this->assertSame(1, $batch['sequence']);
        $this->assertStringContainsString('Batch', $batch['label']);

        $this->assertDatabaseHas('reimbursement_batches', [
            'id' => $batch['batch_id'],
            'status' => 'open',
            'school_year' => '2025-2026',
            'semester' => 'Fall',
        ]);
    }
}
