<?php

declare(strict_types=1);

namespace App\Filament\Resources\DberpCustomerPriceRules\Pages;

use App\Business\Sales\CustomerPriceRuleService;
use App\Filament\Resources\DberpCustomerPriceRules\DberpCustomerPriceRuleResource;
use App\Filament\Resources\Pages\CreateRecord;
use Illuminate\Database\Eloquent\Model;

class CreateDberpCustomerPriceRule extends CreateRecord
{
    protected static string $resource = DberpCustomerPriceRuleResource::class;

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