<?php

namespace App\Listeners;

use App\Modules\Finance\Services\CodeWeavers;

class AddCodeWeaversDealershipFields
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct(private readonly CodeWeavers $provider)
    {
        //
    }

    /**
     * Handle the event.
     *
     * @param  object  $event
     * @return array
     */
    public function handle($event)
    {
        if ($this->provider->enabled() == false) {
            return [];
        }
        return $this->provider->dealershipAdditionalDataFields();
    }
}
