<?php

namespace App\Filament\Resources\BackupScheduleResource\Pages;

use App\Filament\Resources\BackupScheduleResource;
use Filament\Resources\Pages\EditRecord;

class EditBackupSchedule extends EditRecord
{
    protected static string $resource = BackupScheduleResource::class;

    protected function mutateFormDataBeforeSave(array $data): array
    {
        $data = BackupScheduleResource::ensurePolicyTypes($data);

        return BackupScheduleResource::hydrateNextRun($data);
    }
}
