-
Notifications
You must be signed in to change notification settings - Fork 172
/
create-alert-definition.dto.ts
61 lines (50 loc) · 1.68 KB
/
create-alert-definition.dto.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsString, IsOptional, IsBoolean } from 'class-validator';
export class CreateAlertDefinitionDto {
@ApiProperty({ example: '[Payments] - High Cumulative Amount - Inbound' })
@IsString()
@IsNotEmpty()
name!: string;
@ApiProperty({
example: 'Sum of incoming transactions over a set period of time is greater than a limit',
})
@IsString()
@IsNotEmpty()
description!: string;
@ApiProperty({ example: 1 }) // Example value; replace with actual ruleSetId if applicable
@IsNotEmpty()
rulesetId!: number;
@ApiProperty({ example: 1 }) // Example value; replace with actual ruleId if applicable
@IsNotEmpty()
ruleId!: number;
@ApiProperty({
example:
'{"type": "tm_sum_transactions", "params": {"period_interval": "30 days", "transaction_type": "Deposit"}}',
type: 'object',
})
@IsOptional()
inlineRule?: Record<string, any>;
@ApiProperty({ example: true })
@IsBoolean()
enabled!: boolean;
@ApiProperty({
example: '{"invokeOnce": true, "invokeThrottleInSeconds": 60}',
type: 'object',
required: false,
})
@IsOptional()
dedupeStrategies?: Record<string, any>;
@ApiProperty({ example: '{}', type: 'object', required: false })
@IsOptional()
config?: Record<string, any>;
@ApiProperty({ example: ['high-risk', 'finance'], type: [String], required: false })
@IsOptional()
tags?: string[];
@ApiProperty({ example: '{}', type: 'object', required: false })
@IsOptional()
additionalInfo?: Record<string, any>;
@ApiProperty({ required: true, example: 'YOUR_PROJECT_ID' }) // Replace with actual project ID
@IsString()
@IsNotEmpty()
projectId!: string;
}