<?php

namespace Tests\Feature;

use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Schema;
use Tests\TestCase;

class MigrationsTest extends TestCase
{
    use RefreshDatabase;

    public function test_expected_infrastructure_and_pos_tables_exist(): void
    {
        $tables = [
            'password_reset_tokens',
            'sessions',
            'personal_access_tokens',
            'cache',
            'cache_locks',
            'jobs',
            'job_batches',
            'failed_jobs',
            'companies',
            'branches',
            'currencies',
            'roles',
            'permissions',
            'role_permissions',
            'users',
            'categories',
            'tax_rates',
            'units_of_measure',
            'products',
            'product_variants',
            'stock_levels',
            'stock_movements',
            'batches',
            'suppliers',
            'purchase_orders',
            'purchase_order_items',
            'customers',
            'loyalty_transactions',
            'promotions',
            'promotion_products',
            'cash_registers',
            'shifts',
            'shift_activities',
            'cash_drawer_transactions',
            'orders',
            'order_items',
            'payment_methods',
            'payments',
            'mpesa_transactions',
            'returns',
            'return_items',
            'expense_categories',
            'expenses',
            'dining_tables',
            'kitchen_tickets',
            'kitchen_ticket_items',
            'audit_logs',
            'sync_queue',
            'daily_sales_summary',
            'daily_product_summary',
        ];

        foreach ($tables as $table) {
            $this->assertTrue(Schema::hasTable($table), "Failed asserting that table [{$table}] exists.");
        }
    }
}
