<?php

namespace App\Listeners;

use App\Modules\SalesChannels\Inventory;

class AddInventoryDealershipFields
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct(private Inventory $inventory)
    {
        //
    }

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