forked from MergeFi/backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate-bounty.dto.ts
More file actions
39 lines (33 loc) · 904 Bytes
/
Copy pathcreate-bounty.dto.ts
File metadata and controls
39 lines (33 loc) · 904 Bytes
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
import { ApiProperty } from '@nestjs/swagger';
import { IsEnum, IsOptional, IsUUID, IsISO8601 } from 'class-validator';
import { AssetType, BountyDifficulty } from '../../common/enums';
import {
IsMoneyAmount,
IsSupportedEscrowAsset,
} from '../../common/validators/money.validator';
export class CreateBountyDto {
@ApiProperty({
description: 'ID of the tracked Issue this bounty pays out for',
})
@IsUUID()
issueId: string;
@ApiProperty()
@IsUUID()
sponsorId: string;
@ApiProperty()
@IsMoneyAmount()
amount: string;
@ApiProperty({ enum: AssetType, default: AssetType.USDC })
@IsSupportedEscrowAsset()
asset: AssetType;
@ApiProperty({
enum: BountyDifficulty,
default: BountyDifficulty.INTERMEDIATE,
})
@IsEnum(BountyDifficulty)
difficulty: BountyDifficulty;
@ApiProperty({ required: false })
@IsOptional()
@IsISO8601()
deadline?: string;
}