<?php

namespace App\Events\Auth;

use App\Models\Admin;
use App\Models\Bank;
use App\Models\Organization;
use App\Models\User;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

class RegisteredByAdmin
{
    use Dispatchable;
    use InteractsWithSockets;
    use SerializesModels;

    /**
     * The newly registered profile instance.
     * @var \App\Models\User|\App\Models\Organization|\App\Models\Bank|\App\Models\Admin
     */
    public $profile;

    /**
     * The plain-text password, if one was generated.
     * @var string|null
     */
    public ?string $plainPassword; // Add this property

    /**
     * Create a new event instance.
     *
     * @param \App\Models\User|\App\Models\Organization|\App\Models\Bank|\App\Models\Admin $profile
     * @param string|null $plainPassword The generated plain-text password, if applicable.
     * @return void
     */
    // Add $plainPassword to the constructor
    public function __construct(User|Organization|Bank|Admin $profile, ?string $plainPassword = null)
    {
        $this->profile = $profile;
        $this->plainPassword = $plainPassword; // Assign it
    }
}
