<?php

declare(strict_types=1);

namespace App\Support\WorkspaceIsolation;

class TenantOwnedTables
{
    /**
     * @return array<int, string>
     */
    public static function all(): array
    {
        return [...self::firstSlice(), ...self::residual()];
    }

    public static function contains(string $table): bool
    {
        return in_array($table, self::all(), true);
    }

    /**
     * @return array<int, string>
     */
    public static function firstSlice(): array
    {
        return [
            'policies',
            'policy_versions',
            'backup_schedules',
            'backup_sets',
            'restore_runs',
            'findings',
            'finding_exceptions',
            'evidence_snapshots',
            'inventory_items',
            'entra_groups',
            'stored_reports',
            'environment_reviews',
        ];
    }

    /**
     * @return array<int, string>
     */
    public static function residual(): array
    {
        return [
            'backup_items',
            'inventory_links',
            'entra_role_definitions',
            'managed_environment_permissions',
            'finding_exception_decisions',
            'finding_exception_evidence_references',
        ];
    }
}
