<?php

namespace Tests\Services\OrderIssueService\OrderIssueTagTest;

use App\OracleDOCOrderHeader;
use App\Services\OrderIssueService;
use Carbon\Carbon;
use Tests\TestCase;

class OrderIssueTagTest extends TestCase
{
    /** @var OrderIssueService $service */
    public $service;
    public function setUp(): void
    {
        $this->service = app(OrderIssueService::class);
        parent::setUp();
    }

    public function testOrderIssueTag()
    {

        $orderHeader = OracleDOCOrderHeader::query()->orderByDesc('AddTime')->first();
        $addtime = $orderHeader->addtime;
        $addtime = Carbon::parse((string)$addtime)->subMinutes(30);
        $orderNos = OracleDOCOrderHeader::query()
            ->where('AddTime','>=',$addtime)
            ->get()
            ->map(function($orderHeader){
                return $orderHeader->orderno;
            });
        $this->assertNotNull($orderNos);
    }
}
