<?php

namespace Shopping\Schema;

use Shopping\Schema\v1\ShoppingProductSchema;
use Shopping\Schema\v1\FieldMap;

final class SchemaRegistry {
    public const V1 = '1.0';
    public static function get(string $version): array {
        return match ($version) {
            '1.0' => [
                'version' => '1.0',
                'fields' => ShoppingProductSchema::fields(),
                'facets' => FieldMap::facets(),
            ],

            default => throw new \InvalidArgumentException(
                "Unsupported shopping schema version: {$version}"
            ),
        };
    }
}