<?php

/** @var \Illuminate\Database\Eloquent\Factory $factory */

use App\OrderIssue;
use Faker\Generator as Faker;

$factory->define(OrderIssue::class, function (Faker $faker) {
    $rejecting_status = ['无','未退回','全部退回','部分退回','差异退回','超量退回','全部退回'];
    $is_new_rejecting = ['无','有','已处理'];
    $finance_confirm = ['是','否'];
    $final_status = ['已解决','待退回','退回中'];
    $logistic_express_remission = ['原单减免','部分减免','全部减免'];
    $baoshi_express_remission = ['原单减免','部分减免','全部减免'];
    $imported_status = ['正常','导入未处理','导入已梳理'];
    return [
        'order_id' =>function(){
            return factory(\App\Order::class)->create()->id;
        },
        'created_at' => now(),
        'rejected_bill_id' => 0,
        'rejecting_status' => $rejecting_status[rand(0,count($rejecting_status)-1)],
        'result_explain' => $faker->text(20),
        'logistic_number_return'=>$faker->name,
        'order_issue_type_id' => 0,
        'second_order_id' => 0,
        'is_new_rejecting' => $is_new_rejecting[rand(0,count($is_new_rejecting) -1)],
        'second_client_no' => $faker->name,
        'second_logistic_number' => $faker->name,
        'final_status' => $final_status[rand(0,count($final_status)-1)],
        'logistic_indemnity_money' => rand(0,10),
        'logistic_express_remission' =>$logistic_express_remission[rand(0,1)] ,
        'baoshi_indemnity_money' =>rand(0,1),
        'baoshi_express_remission' => $baoshi_express_remission[rand(0,1)],
        'user_workgroup_id' => 0,
        'custom_code' => $faker->name,
        'imported_status' => $imported_status[rand(0,count($imported_status)-1)],
        'finance_confirm' =>$finance_confirm[rand(0,1)],
        'hidden_tag' => $faker->name
    ];
});
