<?php

namespace App\Notifications;

use App\Models\Room;
use App\Models\User;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;

class MeetingInvitationNotification extends Notification
{
    use Queueable;

    public function __construct(
        public Room $room,
        public User $host,
    ) {}

    public function via(object $notifiable): array
    {
        return ['database'];
    }

    public function toArray(object $notifiable): array
    {
        return [
            'type' => 'meeting_invitation',
            'title' => 'Meeting invitation',
            'body' => $this->host->name.' invited you to '.$this->room->title,
            'url' => $this->room->joinUrl(),
            'room_uuid' => $this->room->uuid,
        ];
    }
}
