<?php

declare(strict_types=1);

namespace App\Filament\Resources\DberpSettlementWriteOffs\Pages;

use App\Business\Settlement\SettlementWriteOffService;
use App\Filament\Resources\DberpSettlementWriteOffs\DberpSettlementWriteOffResource;
use App\Filament\Resources\Pages\CreateRecord;
use Illuminate\Database\Eloquent\Model;

class CreateDberpSettlementWriteOff extends CreateRecord
{
    protected static string $resource = DberpSettlementWriteOffResource::class;

    protected function handleRecordCreation(array $data): Model
    {
        return app(SettlementWriteOffService::class)->createConfirmed($data);
    }
}