<?php

use App\Classes\ValueObjects\Constants\AccountStatus;
use App\Classes\ValueObjects\Constants\CompanyTypes;
use App\Classes\ValueObjects\Constants\ModuleTypes;
use App\Models\Company;
use Illuminate\Database\Seeder;

class CompaniesTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {

        $company = new Company();
        $company->reference_no = 1000000000;
        $company->name = 'CIEF Worldwide SDN BHD';
        $company->type = CompanyTypes::COMPANY_BUSINESS;
        $company->status = AccountStatus::ACTIVE;
        $company->save();

        $company->modules()->create(['module_type' => ModuleTypes::FORWARDER]);

        $company = new Company();
        $company->reference_no = 1000000001;
        $company->name = 'YW-V01  浙江义乌仓库';
        $company->type = CompanyTypes::COMPANY_BUSINESS;
        $company->status = AccountStatus::ACTIVE;
        $company->save();

        $company->addresses()->create([
            'street_one' => '浙江省义乌市诚信大道义乌港A区2楼194号',
            'post_code' => 322000,
            'city' => '',
            'state' => '',
            'country' => 'China',
            'default' => 1,
            'billing' => 1
        ]);

        $company->contacts()->create([
            'name' => '小叶（叶兴）',
            'phone' => '13757951501',
        ]);

        $company->modules()->create(['module_type' => ModuleTypes::WAREHOUSE]);


        $company = new Company();
        $company->reference_no = 1000000002;
        $company->name = 'GZ-BY-V02 广州白云江高仓库';
        $company->type = CompanyTypes::COMPANY_BUSINESS;
        $company->status = AccountStatus::ACTIVE;
        $company->save();

        $company->addresses()->create([
            'street_one' => '广东省，广州市，白云区，大朗南路 白云湖大道自编13号 7号仓库',
            'street_two' => ' 高德地图导航：广州市世通行',
            'post_code' => 510450,
            'city' => '',
            'state' => '',
            'country' => 'China',
            'default' => 1,
            'billing' => 1
        ]);

        $company->contacts()->create([
            'name' => '杨维民',
            'phone' => '13600055019',
        ]);

        $company->modules()->create(['module_type' => ModuleTypes::WAREHOUSE]);
    }
}
