import { logger } from '@/infrastructure/monitoring/logger';

/**
 * dbis.data.schema-registry
 * Versioned canonical schemas and adapter contracts (scaffold).
 */
export class SchemaRegistryService {
	private readonly registry = new Map<string, { version: string; schema: unknown }>();

	register(domain: string, version: string, schema: unknown): void {
		this.registry.set(domain, { version, schema });
		logger.info('SchemaRegistryService.register', { domain, version });
	}

	resolve(domain: string): { version: string; schema: unknown } | undefined {
		return this.registry.get(domain);
	}
}

export const schemaRegistryService = new SchemaRegistryService();

