<?php

namespace Tests\Unit\Services\Finance;

use App\Services\Finance\FinancialChartService;
use App\Services\Finance\FinancialPdfReportService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;

class FinancialPdfReportServiceTest extends TestCase
{
    use RefreshDatabase;

    public function test_build_pdf_returns_bytes(): void
    {
        $service = new FinancialPdfReportService(new FinancialChartService());

        $summary = [
            'schoolYear' => '2025-2026',
            'totalCharges' => 100,
            'totalExtraCharges' => 20,
            'totalDiscounts' => 10,
            'totalRefunds' => 5,
            'totalExpenses' => 15,
            'totalReimbursements' => 8,
            'donationToSchool' => 3,
            'netAmount' => 85,
            'amountCollected' => 60,
            'totalUnpaid' => 40,
        ];

        $pdf = $service->buildPdf($summary);

        $this->assertIsString($pdf);
        $this->assertNotSame('', $pdf);
    }
}
