<?php

use Faker\Generator as Faker;

$factory->define(App\Models\Catalogs\Tax::class, function (Faker $faker) {

    $factor = $faker->randomElement([\App\Models\Catalogs\Tax::TASA, \App\Models\Catalogs\Tax::CUOTA, \App\Models\Catalogs\Tax::EXENTO]);

    return [
        'created_uid' => \App\Models\Auth\User::all()->random()->id,
        'updated_uid' => \App\Models\Auth\User::all()->random()->id,
        'name' => $faker->sentence,
        'code' => $faker->unique()->numberBetween($min = 100, $max = 999),
        'rate' => 16.0,
        'factor' => $factor,
        'sort_order' => 0,
        'status' => $faker->randomElement([1,0]),
        'local_taxes' => 0,
        'type' => 'T',
    ];
});
