<?php

namespace App\Modules\Admin\Tenancy\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Notification;

class PlanLimitBlockedAttemptNotification extends Notification implements ShouldQueue
{
    use Queueable;

    public function __construct(
        public readonly string $limitKey,
        public readonly int $used,
        public readonly int $cap,
    ) {}

    /**
     * @return list<string>
     */
    public function via(object $notifiable): array
    {
        return ['database'];
    }

    /**
     * @return array<string, mixed>
     */
    public function toArray(object $notifiable): array
    {
        return [
            'type' => 'plan_limit_blocked',
            'limit_key' => $this->limitKey,
            'used' => $this->used,
            'cap' => $this->cap,
            'title' => __('plan_limits.notifications.blocked_title'),
            'body' => __('plan_limits.notifications.blocked_body', [
                'used' => $this->used,
                'cap' => $this->cap,
            ]),
            'upgrade_url' => route('dashboard.index'),
        ];
    }
}
