<?php

namespace App\Listeners;

use App\Modules\Sales\Services\SilverBullet;

class AddSilverBulletDealershipFields
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct(private readonly SilverBullet $service)
    {
        //
    }

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