<?php

namespace App\Listeners;

use App\Crm\SendToRapidRTC;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;

class AddRapidRtcDealershipFields
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct(private readonly SendToRapidRTC $rapidRTC)
    {
        //
    }

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