<?php

namespace App\Listeners;

use App\Crm\SendToEnquiryMax;

class AddEnquiryMaxDealershipFields
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct(private readonly SendToEnquiryMax $enquiryMax)
    {
        //
    }

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