import { Injectable } from '@nestjs/common';

export interface EntityConfig {
  entityType: string;
  table: string;
  customFieldsEnabled: boolean;
  timelineEnabled: boolean;
}

@Injectable()
export class EntityRegistry {
  private registry = new Map<string, EntityConfig>();

  register(config: EntityConfig): void {
    this.registry.set(config.entityType, config);
  }

  get(entityType: string): EntityConfig | undefined {
    return this.registry.get(entityType);
  }

  getAll(): EntityConfig[] {
    return Array.from(this.registry.values());
  }

  has(entityType: string): boolean {
    return this.registry.has(entityType);
  }
}
