<?php

declare(strict_types=1);

namespace App\Filament\Resources\DberpSalesOrders\Pages;

use App\Business\Sales\SalesOrderService;
use App\Filament\Resources\DberpSalesOrders\DberpSalesOrderResource;
use App\Filament\Resources\Pages\CreateRecord;
use Illuminate\Database\Eloquent\Model;

class CreateDberpSalesOrder extends CreateRecord
{
    protected static string $resource = DberpSalesOrderResource::class;

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