export interface ApiKey {
  apiKeyId: number;
  keyName: string;
  apiKeyPrefix: string;
  maskedKey: string;
  status: 'PENDING' | 'ACTIVE' | 'INACTIVE' | 'EXPIRED' | 'REVOKED';
  userName: string | null;
  expiresAt: string | null;
  lastUsedAt: string | null;
  createdAt: string;
}

export interface ApiKeyDetail extends ApiKey {
  decryptedKey: string;
  userId: number;
  userName: string;
}

export interface ApiKeyCreateResponse {
  apiKeyId: number;
  keyName: string;
  rawKey: string;
  apiKeyPrefix: string;
  status: string;
}

export interface CreateApiKeyRequest {
  keyName: string;
}

export interface ApiKeyRequest {
  requestId: number;
  userId: number;
  userName: string;
  keyName: string;
  purpose: string | null;
  requestedApiIds: number[];
  status: 'PENDING' | 'APPROVED' | 'REJECTED';
  reviewedByUserId: number | null;
  reviewerName: string | null;
  reviewComment: string | null;
  reviewedAt: string | null;
  createdAt: string;
  serviceIp: string | null;
  servicePurpose: string | null;
  dailyRequestEstimate: number | null;
  usageFromDate: string | null;
  usageToDate: string | null;
}

export interface ApiKeyRequestCreateDto {
  keyName: string;
  purpose?: string;
  requestedApiIds: number[];
  serviceIp?: string;
  servicePurpose?: string;
  dailyRequestEstimate?: number;
  usageFromDate?: string;
  usageToDate?: string;
}

export interface ApiKeyRequestReviewDto {
  status: 'APPROVED' | 'REJECTED';
  reviewComment?: string;
  adjustedApiIds?: number[];
  adjustedFromDate?: string;
  adjustedToDate?: string;
  adjustedDailyRequestLimit?: number;
}

export interface Permission {
  permissionId: number;
  apiId: number;
  apiPath: string;
  apiMethod: string;
  apiName: string;
  serviceName: string;
  isActive: boolean;
  grantedAt: string;
}

export interface UpdatePermissionsRequest {
  apiIds: number[];
}
