<?php

namespace App\Listeners;

use App\Enums\WalletTypeEnum;
use App\Models\Wallet;
use Illuminate\Auth\Events\Registered;

class CreateWalletsForUser
{
    /**
     * Create the event listener.
     */
    public function __construct()
    {
        //
    }

    /**
     * Handle the event.
     */
    public function handle(Registered $event): void
    {
        Wallet::create(['user_id' => $event->user->id, 'balance' => 0, 'blocked' => 0, 'type' => WalletTypeEnum::Toman]);
    }
}
