<?php

namespace App\Filament\Resources\DealResource\Pages;

use App\Filament\Resources\DealResource;
use App\Models\Promotions\Deal;
use App\Services\AuditLog;
use Filament\Resources\Pages\EditRecord;

class EditDeal extends EditRecord
{
    protected static string $resource = DealResource::class;

    protected function afterSave(): void
    {
        /** @var Deal $deal */
        $deal = $this->record;

        AuditLog::record('deal.updated', $deal, ['name' => $deal->name]);
    }
}
