<?php

namespace App\Listeners;

use App\Modules\Stock\AutoTraderStock;

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

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