<?php
namespace App\Libs\Listeners;

use App\Libs\Services\FileService;
use App\Models\StaticDataTable;

class ProcessStaticDataTablesSave
{
    protected FileService $fileService;

    public function __construct(FileService $fileService)
    {
        $this->fileService = $fileService;
    }

    /**
     * Handle the given event.
     *
     * @return void
     */
    public function handle($event)
    {
        if (is_a($event->contentTypeModel, StaticDataTable::class)) {
            $this->fileService->readExcelFile($event);
        }
    }
}
