<?php

namespace App\Services\Providers;

use App\Models\Vendor;
use App\Services\Providers\Contracts\ProviderInterface;
use InvalidArgumentException;

class ProviderFactory
{
    public function forVendor(Vendor $vendor): ProviderInterface
    {
        return match ($vendor->type) {
            'msorg' => new MsorgProvider($vendor),
            'smeplug' => new SmeplugProvider($vendor),
            'vtpass' => new VtpassProvider($vendor),
            'vtbox' => new VtboxProvider($vendor),
            default => throw new InvalidArgumentException("Unsupported vendor type [{$vendor->type}]"),
        };
    }
}
