-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathupdate-proposal.dto.ts
116 lines (101 loc) · 2.25 KB
/
update-proposal.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import { ApiTags, PartialType } from "@nestjs/swagger";
import { Type } from "class-transformer";
import {
IsArray,
IsDateString,
IsEmail,
IsObject,
IsOptional,
IsString,
ValidateNested,
} from "class-validator";
import { OwnableDto } from "../../common/dto/ownable.dto";
import { CreateMeasurementPeriodDto } from "./create-measurement-period.dto";
@ApiTags("proposals")
export class UpdateProposalDto extends OwnableDto {
/**
* Email of principal investigator.
*/
@IsOptional()
@IsEmail()
readonly pi_email?: string;
/**
* First name of principal investigator.
*/
@IsOptional()
@IsString()
readonly pi_firstname?: string;
/**
* Last name of principal investigator.
*/
@IsOptional()
@IsString()
readonly pi_lastname?: string;
/**
* Email of main proposer.
*/
@IsEmail()
readonly email: string;
/**
* First name of main proposer.
*/
@IsOptional()
@IsString()
readonly firstname?: string;
/**
* Last name of main proposer.
*/
@IsOptional()
@IsString()
readonly lastname?: string;
/**
* The title of the proposal.
*/
@IsString()
readonly title: string;
/**
* The proposal abstract.
*/
@IsOptional()
@IsString()
readonly abstract?: string;
/**
* The date when the data collection starts.
*/
@IsOptional()
@IsDateString()
readonly startTime?: Date;
/**
* The date when data collection finishes.
*/
@IsOptional()
@IsDateString()
readonly endTime?: Date;
/**
* Embedded information used inside proposals to define which type of experiment has to be pursued, where (at which instrument) and when.
*/
@IsArray()
@IsOptional()
@ValidateNested({ each: true })
@Type(() => CreateMeasurementPeriodDto)
readonly MeasurementPeriodList?: CreateMeasurementPeriodDto[];
/**
* JSON object containing the proposal metadata.
*/
@IsOptional()
@IsObject()
readonly metadata?: Record<string, unknown>;
/**
* Parent proposal id.
*/
@IsOptional()
@IsString()
readonly parentProposalId?: string;
/**
* Characterize type of proposal, use some of the configured values
*/
@IsOptional()
@IsString()
readonly type?: string;
}
export class PartialUpdateProposalDto extends PartialType(UpdateProposalDto) {}