import type { CredentialType, CredentialScope, Prisma } from "@prisma/client";

/**
 * DTO for credential responses
 * NEVER includes encryptedValue - only maskedValue is exposed
 */
export interface CredentialResponseDto {
  id: string;
  userId: string;
  workspaceId: string | null;
  name: string;
  provider: string;
  type: CredentialType;
  scope: CredentialScope;
  maskedValue: string | null;
  description: string | null;
  expiresAt: Date | null;
  lastUsedAt: Date | null;
  metadata: Prisma.JsonValue;
  isActive: boolean;
  rotatedAt: Date | null;
  createdAt: Date;
  updatedAt: Date;
}

/**
 * DTO for paginated credential list responses
 */
export interface PaginatedCredentialsDto {
  data: CredentialResponseDto[];
  meta: {
    total: number;
    page: number;
    limit: number;
    totalPages: number;
  };
}

/**
 * DTO for decrypted credential value response
 */
export interface CredentialValueResponseDto {
  value: string;
}
