-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathmeasurement-period.schema.ts
61 lines (54 loc) · 1.89 KB
/
measurement-period.schema.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 { Prop, Schema, SchemaFactory } from "@nestjs/mongoose";
import { ApiProperty } from "@nestjs/swagger";
import { Document } from "mongoose";
import { QueryableClass } from "src/common/schemas/queryable.schema";
import { v4 as uuidv4 } from "uuid";
export type MeasurementPeriodDocument = MeasurementPeriodClass & Document;
@Schema()
export class MeasurementPeriodClass extends QueryableClass {
@ApiProperty({
type: String,
default: () => uuidv4(),
required: true,
description:
"Unique identifier (relative to the proposal) of a MeasurementPeriod",
})
@Prop({
type: String,
required: true,
default: () => uuidv4(),
})
id: string;
@ApiProperty({
type: String,
required: true,
description:
"Instrument or beamline identifier where measurement was pursued, e.g. /PSI/SLS/TOMCAT",
})
@Prop({ type: String, required: true, index: true })
instrument: string;
@ApiProperty({
type: Date,
description:
"Time when measurement period started, format according to chapter 5.6 internet date/time format in RFC 3339. Local times without timezone/offset info are automatically transformed to UTC using the timezone of the API server.",
})
@Prop({ type: Date, index: true })
start: Date;
@ApiProperty({
type: Date,
description:
"Time when measurement period ended, format according to chapter 5.6 internet date/time format in RFC 3339. Local times without timezone/offset info are automatically transformed to UTC using the timezone of the API server.",
})
@Prop({ type: Date, index: true })
end: Date;
@ApiProperty({
type: String,
description:
"Additional information relevant for this measurement period, e.g. if different accounts were used for data taking.",
})
@Prop({ type: String })
comment: string;
}
export const MeasurementPeriodSchema = SchemaFactory.createForClass(
MeasurementPeriodClass,
);