File

src/proposals/schemas/measurement-period.schema.ts

Extends

QueryableClass

Index

Properties

Properties

comment
Type : string
Decorators :
@ApiProperty({type: String, description: 'Additional information relevant for this measurement period, e.g. if different accounts were used for data taking.'})
@Prop({type: String})
end
Type : Date
Decorators :
@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})
instrument
Type : string
Decorators :
@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})
start
Type : Date
Decorators :
@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})
createdAt
Type : Date
Decorators :
@ApiProperty({type: Date, description: 'Date and time when this record was created. This property is added and maintained by mongoose.'})
@Prop({type: Date})
Inherited from QueryableClass
Defined in QueryableClass:40

NOTE: createdAt and updatedAt properties are handled automatically by mongoose when timestamps flag is set to true on a schema(https://mongoosejs.com/docs/guide.html#timestamps). We still need to keep the fields available here because of the response model and swagger documentation. They are not required so we don't need to provide them manually on create/update.

createdBy
Type : string
Decorators :
@ApiProperty({type: String, description: 'Indicate the user who created this record. This property is added and maintained by the system.'})
@Prop({type: String, index: true, required: true})
Inherited from QueryableClass
Defined in QueryableClass:15
updatedAt
Type : Date
Decorators :
@ApiProperty({type: Date, description: 'Date and time when this record was updated last. This property is added and maintained by mongoose.'})
@Prop({type: Date})
Inherited from QueryableClass
Defined in QueryableClass:50
updatedBy
Type : string
Decorators :
@ApiProperty({type: String, description: 'Indicate the user who updated this record last. This property is added and maintained by the system.'})
@Prop({type: String, required: true})
Inherited from QueryableClass
Defined in QueryableClass:26
import { Prop, Schema, SchemaFactory } from "@nestjs/mongoose";
import { ApiProperty } from "@nestjs/swagger";
import { Document } from "mongoose";
import { QueryableClass } from "src/common/schemas/queryable.schema";

export type MeasurementPeriodDocument = MeasurementPeriodClass & Document;

@Schema()
export class MeasurementPeriodClass extends QueryableClass {
  @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,
);

results matching ""

    No results matching ""