// Unified DBIS Financial Ontology (UDFO) - Main Service

import { assetOntologyService } from './asset-ontology.service';
import { entityOntologyService } from './entity-ontology.service';
import { processOntologyService } from './process-ontology.service';
import { ontologyValidatorService } from './ontology-validator.service';
import { logger } from '@/infrastructure/monitoring/logger';

export class UDFOService {
  /**
   * Initialize UDFO with default definitions
   */
  async initialize(): Promise<void> {
    logger.info('Initializing UDFO with default definitions');

    await assetOntologyService.initializeDefaultAssets();
    await entityOntologyService.initializeDefaultEntities();
    await processOntologyService.initializeDefaultProcesses();

    logger.info('UDFO initialization completed');
  }

  /**
   * Get all ontology definitions
   */
  async getAllDefinitions() {
    const [assets, entities, processes] = await Promise.all([
      assetOntologyService.getAllAssets(),
      entityOntologyService.getAllEntities(),
      processOntologyService.getAllProcesses(),
    ]);

    return {
      assets,
      entities,
      processes,
    };
  }

  /**
   * Get asset ontology service
   */
  getAssetService() {
    return assetOntologyService;
  }

  /**
   * Get entity ontology service
   */
  getEntityService() {
    return entityOntologyService;
  }

  /**
   * Get process ontology service
   */
  getProcessService() {
    return processOntologyService;
  }

  /**
   * Get validator service
   */
  getValidatorService() {
    return ontologyValidatorService;
  }
}

export const udfoService = new UDFOService();

