<?php

namespace App\Notifications;

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

class DesignerStartedWorkNotification extends Notification
{
    use Queueable;

    public MarketingRequest $request;
    public User $designer;

    public function __construct(MarketingRequest $request, User $designer)
    {
        $this->request = $request;
        $this->designer = $designer;
    }

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

    public function toArray(object $notifiable): array
    {
        return [
            'request_id' => $this->request->id,
            'request_number' => $this->request->request_number,
            'title' => 'Designer Started Work',
            'message' => "Designer {$this->designer->name} started work on request {$this->request->request_number}.",
            'url' => route('requests.show', $this->request->id),
            'type' => 'designer_started',
        ];
    }
}
