<?php

use App\Models\OrderModel;
use App\Models\ProductionQueueModel;
use CodeIgniter\Test\CIUnitTestCase;

final class ProductionStatusNormalizationTest extends CIUnitTestCase
{
    public function testQueueStatusesAreNormalizedConsistently(): void
    {
        $model = new ProductionQueueModel();

        $this->assertSame('antrian', $model->normalizeQueueStatus('waiting'));
        $this->assertSame('antrian', $model->normalizeQueueStatus('antrian'));
        $this->assertSame('produksi', $model->normalizeQueueStatus('process'));
        $this->assertSame('produksi', $model->normalizeQueueStatus('produksi'));
        $this->assertSame('selesai', $model->normalizeQueueStatus('completed'));
        $this->assertSame('selesai', $model->normalizeQueueStatus('selesai'));
    }

    public function testOrderProductionStatusesAreNormalizedConsistently(): void
    {
        $model = new OrderModel();

        $this->assertSame('waiting', $model->normalizeProductionStatus('waiting'));
        $this->assertSame('waiting', $model->normalizeProductionStatus('antrian'));
        $this->assertSame('process', $model->normalizeProductionStatus('process'));
        $this->assertSame('process', $model->normalizeProductionStatus('produksi'));
        $this->assertSame('completed', $model->normalizeProductionStatus('completed'));
        $this->assertSame('completed', $model->normalizeProductionStatus('selesai'));
    }
}
