<?php

namespace App\Listeners;

use App\Modules\Finance\Services\IVendi;

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

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