<?php

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

use App\Order;
use App\OrderPackage;
use Faker\Generator as Faker;

$factory->define(OrderPackage::class, function (Faker $faker) {
    $statuses = ['无', '已称重', '已揽收', '在途', '在途异常', '派送中', '派送异常', '返回中', '返回异常', '返回派件', '其他异常', '已收件',];
    $exceptions = ['是', '否'];
    $exception_types = ['疑似库内丢件','揽件异常','中转异常','疑似丢件','派件异常','其他','无'];
    return [
        'logistic_number' => $faker->uuid,
        'order_id' => random_int(1, 10000),
        'batch_number' => random_int(1, 100),
        'batch_rule' => null,
        'bulk' => null,
        'weight' => null,
        'height' => null,
        'paper_box_id' => random_int(1, 100),
        'measuring_machine_id' => random_int(1, 100),
        'weighed_at' => now()->subHours(3),
        'status' => $faker->randomElement($statuses),
        'sent_at' => now()->subHours(1),
        'received_at' => null,
        'exception' => $faker->randomElement($exceptions),
        'transfer_status' => null,
        'remark' => null,
        'owner_id' => random_int(1, 100),
        'uploaded_to_wms' => '是',
        'exception_message' => $faker->name,
        'exception_type' => $faker->randomElement($exception_types),
    ];
});
