<?php

declare(strict_types=1);

namespace App\Filament\Resources\DberpSettlementStatements\Pages;

use App\Business\Settlement\SettlementStatementService;
use App\Filament\Resources\DberpSettlementStatements\DberpSettlementStatementResource;
use App\Filament\Resources\Pages\CreateRecord;
use Illuminate\Database\Eloquent\Model;

class CreateDberpSettlementStatement extends CreateRecord
{
    protected static string $resource = DberpSettlementStatementResource::class;

    /**
     * @param  array<string, mixed>  $data
     */
    protected function handleRecordCreation(array $data): Model
    {
        return app(SettlementStatementService::class)->createDraft($data);
    }
}