<?php

namespace Tests\Services\WarehouseService\SyncWmsWareHouseTest;

use App\OracleDOCOrderHeader;
use App\Services\WarehouseService;
use Carbon\Carbon;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;

class SyncWmsWareHouseTest extends TestCase
{
    /** @var WarehouseService $service */
    public $service;


    public function setUp(): void
    {
        $this->service = app(WarehouseService::class);
        parent::setUp();
    }

    public function testSyncWmsWareHouse()
    {
        $carbon = Carbon::now()->subMinutes(10);
        $orders = OracleDOCOrderHeader::query()->where('addtime',">=",$carbon)->get();
        $warehouse_ids = data_get($orders,'*.warehouseid');
        $collet = $this->service->syncWmsWareHouse($warehouse_ids);

    }
}
