<?php

namespace App\Services\Notifications;

use InvalidArgumentException;

class ReminderProviderRegistry
{
    public function __construct(
        private InSystemReminderProvider $inSystem,
        private EmailReminderProvider $email,
        private SmsReminderProvider $sms,
        private WhatsAppReminderProvider $whatsapp,
    ) {}

    public function for(string $channel): ReminderChannelProvider
    {
        return match($channel){
            'in_system'=>$this->inSystem,
            'email'=>$this->email,
            'sms'=>$this->sms,
            'whatsapp'=>$this->whatsapp,
            default=>throw new InvalidArgumentException("Unsupported reminder channel: {$channel}"),
        };
    }
}
