<?php

namespace Kylin\LawCase\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Kylin\LawCase\Models\CaseModel;

/**
 * 案件状态变更通知
 */
class CaseStatusChangedNotification extends Notification
{
    use Queueable;

    public function __construct(
        public CaseModel $case,
        public string $message
    ) {}

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

    public function toArray(object $notifiable): array
    {
        return [
            'case_id' => $this->case->id,
            'case_no' => $this->case->case_no,
            'case_name' => $this->case->case_name,
            'message' => $this->message,
            'type' => 'case_status_changed',
        ];
    }
}
