<?php

namespace Database\Factories;

use Illuminate\Database\Eloquent\Factories\Factory;

/**
 * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\BillingData>
 */
class BillingDataFactory extends Factory
{
    /**
     * Define the model's default state.
     *
     * @return array<string, mixed>
     */
    public function definition()
    {
        $type = $this->faker->randomElement(['card','bank_account']);
        return [
            'object'=> $type,
            'stripe_id'=> $this->faker->uuid,
            'last4'=> substr($this->faker->creditCardNumber,-4),
            'country'=>$this->faker->countryCode,
            'currency'=>$this->faker->currencyCode,
            'account_holder_name'=>$this->faker->name,
            'account_holder_type'=>$this->faker->randomElement(['individual','company']),
            'owner_type'=>$this->faker->randomElement(['App\Models\Engineer','App\Models\Firm','App\Models\User']),
            'owner_id'=>$this->faker->numberBetween(1,50),
            'stripe_account'=> $this->faker->uuid,
            'exp_month'=>$type==="card"? $this->faker->numberBetween(1,12) :null,
            'exp_year'=>$type==="card"? $this->faker->numberBetween(2023,2027) :null,
            'brand'=>$type==="card"? "VISA" :null,
        ];
    }
}
