import { Global, Module } from "@nestjs/common";
import { ConfigModule } from "@nestjs/config";
import { PrismaService } from "./prisma.service";
import { VaultModule } from "../vault/vault.module";

/**
 * Global Prisma module providing database access throughout the application
 * Marked as @Global() so PrismaService is available in all modules without importing
 *
 * Includes VaultModule for transparent Account token encryption via OpenBao Transit
 * with AES-256-GCM fallback (Issue #353)
 */
@Global()
@Module({
  imports: [ConfigModule, VaultModule],
  providers: [PrismaService],
  exports: [PrismaService],
})
export class PrismaModule {}
