60 lines
1.5 KiB
TypeScript
60 lines
1.5 KiB
TypeScript
import { BaseResponseDto } from '../../base.dto';
|
|
import { RestoreStatus, RestoreSource } from '../models/purchase-restore-log.model';
|
|
|
|
export interface SecurityAlertDto {
|
|
id: string;
|
|
userId: string;
|
|
transactionId: string;
|
|
productId: string;
|
|
originalAppUserId: string;
|
|
status: RestoreStatus;
|
|
source: RestoreSource;
|
|
clientIp: string;
|
|
userAgent: string;
|
|
failureReason?: string;
|
|
createdAt: Date;
|
|
riskScore: number;
|
|
alertType: 'DUPLICATE_TRANSACTION' | 'SUSPICIOUS_IP' | 'RAPID_REQUESTS' | 'CROSS_ACCOUNT_FRAUD';
|
|
}
|
|
|
|
export interface SecurityStatsDto {
|
|
totalRestoreAttempts: number;
|
|
successfulRestores: number;
|
|
failedRestores: number;
|
|
duplicateAttempts: number;
|
|
fraudDetected: number;
|
|
uniqueUsers: number;
|
|
uniqueIPs: number;
|
|
topRiskTransactions: SecurityAlertDto[];
|
|
}
|
|
|
|
export interface GetSecurityAlertsDto {
|
|
page?: number;
|
|
limit?: number;
|
|
status?: RestoreStatus;
|
|
alertType?: string;
|
|
startDate?: string;
|
|
endDate?: string;
|
|
userId?: string;
|
|
riskScoreMin?: number;
|
|
}
|
|
|
|
export interface SecurityAlertsResponseDto extends BaseResponseDto<{
|
|
alerts: SecurityAlertDto[];
|
|
total: number;
|
|
page: number;
|
|
limit: number;
|
|
}> { }
|
|
|
|
export interface SecurityStatsResponseDto extends BaseResponseDto<SecurityStatsDto> { }
|
|
|
|
export interface BlockTransactionDto {
|
|
transactionId: string;
|
|
reason: string;
|
|
}
|
|
|
|
export interface BlockTransactionResponseDto extends BaseResponseDto<{
|
|
blocked: boolean;
|
|
transactionId: string;
|
|
reason: string;
|
|
}> { } |