// Unified DBIS Financial Ontology (UDFO) - Type Definitions

export enum AssetType {
  FIAT = 'FIAT',
  CBDC = 'CBDC',
  SSU = 'SSU',
  COMMODITY = 'COMMODITY',
  SECURITY = 'SECURITY',
}

export enum EntityType {
  SCB = 'SCB', // Sovereign Central Bank
  BANK = 'BANK',
  INDIVIDUAL = 'INDIVIDUAL',
  INSTITUTION = 'INSTITUTION',
  CONTRACT = 'CONTRACT',
}

export enum ProcessType {
  SETTLEMENT = 'SETTLEMENT',
  ISSUANCE = 'ISSUANCE',
  CONVERSION = 'CONVERSION',
  REDEMPTION = 'REDEMPTION',
  COLLATERALIZATION = 'COLLATERALIZATION',
}

export interface UDFOAsset {
  id: string;
  assetType: AssetType;
  code: string; // ISO code or custom identifier
  name: string;
  definition: string;
  properties: Record<string, unknown>;
  metadata?: Record<string, unknown>;
}

export interface UDFOEntity {
  id: string;
  entityType: EntityType;
  identifier: string;
  name: string;
  definition: string;
  properties: Record<string, unknown>;
  metadata?: Record<string, unknown>;
}

export interface UDFOProcess {
  id: string;
  processType: ProcessType;
  code: string;
  name: string;
  definition: string;
  inputs: string[]; // Asset/Entity IDs
  outputs: string[]; // Asset/Entity IDs
  triggers: string[]; // Event triggers
  properties: Record<string, unknown>;
  metadata?: Record<string, unknown>;
}

export interface OntologyMapping {
  id: string;
  sourceDomain: 'ASSET' | 'ENTITY' | 'PROCESS';
  sourceId: string;
  targetDomain: 'ASSET' | 'ENTITY' | 'PROCESS';
  targetId: string;
  mappingType: string;
  confidence: number; // 0-1
  metadata?: Record<string, unknown>;
}

export interface OntologyValidationRequest {
  assetId?: string;
  entityId?: string;
  processId?: string;
  contractCode?: string;
  context?: Record<string, unknown>;
}

export interface OntologyValidationResult {
  valid: boolean;
  errors: string[];
  warnings: string[];
  suggestions: string[];
}

