// Sovereign Digital Identity Passport (SDIP) - Main Service

import { sdipIssuerService } from './sdip-issuer.service';
import { sdipVerificationService } from './sdip-verification.service';
import { sdipRevocationService } from './sdip-revocation.service';
import { SDIPIssuanceRequest, SDIPPassport, SDIPVerificationResult, SDIPRevocationRequest } from './types';

export class SDIPService {
  /**
   * Issue a new passport
   */
  async issuePassport(request: SDIPIssuanceRequest): Promise<SDIPPassport> {
    return sdipIssuerService.issuePassport(request);
  }

  /**
   * Verify passport
   */
  async verifyPassport(passportId: string): Promise<SDIPVerificationResult> {
    return sdipVerificationService.verifyPassport(passportId);
  }

  /**
   * Revoke passport
   */
  async revokePassport(request: SDIPRevocationRequest): Promise<void> {
    return sdipRevocationService.revokePassport(request);
  }

  /**
   * Renew passport
   */
  async renewPassport(passportId: string, validityYears?: number): Promise<SDIPPassport> {
    return sdipIssuerService.renewPassport(passportId, validityYears);
  }

  /**
   * Get passport
   */
  async getPassport(passportId: string): Promise<SDIPPassport | null> {
    return sdipVerificationService.getPassport(passportId);
  }

  /**
   * Get passports by entity
   */
  async getPassportsByEntity(entityId: string): Promise<SDIPPassport[]> {
    return sdipVerificationService.getPassportsByEntity(entityId);
  }

  /**
   * Calculate trust score
   */
  async calculateTrustScore(passportId: string): Promise<number> {
    return sdipVerificationService.calculateTrustScore(passportId);
  }

  /**
   * Get expiring passports
   */
  async getExpiringPassports(daysAhead?: number) {
    return sdipRevocationService.getExpiringPassports(daysAhead);
  }
}

export const sdipService = new SDIPService();

