<?php

namespace Tests\Services\OracleDocOrderHeaderServie\GetWmsOrderOnStartDateEditTest;

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

class GetWmsOrderOnStartDateEditTest extends TestCase
{
    /** @var OracleDOCOrderHeaderService $service */
    public $service;

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

    public function testGetWmsOrderOnStartDateEdit()
    {
        $carbon =Carbon::now()->subMinutes(5);
        $orderHeaders = $this->service->getWmsOrderOnStartDateEdit($carbon);
        $this->assertNotNull($orderHeaders);
        $orderHeader = $orderHeaders->first();
        if($orderHeaders->count() == 0){
            return ;
        }
        $this->assertNotNull($orderHeader->oracleDOCOrderDetails);
        $this->assertNotNull($orderHeader->actAllocationDetails);
        $this->assertNotNull($orderHeader->oracleBASCustomer);
        $this->assertNotNull($orderHeader->oracleBASCode);
    }
}
