<?php

namespace App\Listeners;

use App\Modules\SalesChannels\CarsIreland;

class AddCarsIrelandDealershipFields
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct(private CarsIreland $carsIreland)
    {
        //
    }

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