src/proposals/schemas/proposal.schema.ts
Properties |
|
| _id |
Type : string
|
Decorators :
@Prop({type: String})
|
|
Defined in src/proposals/schemas/proposal.schema.ts:39
|
| Optional abstract |
Type : string
|
Decorators :
@ApiProperty({type: String, required: false, description: 'The proposal abstract.'})
|
|
Defined in src/proposals/schemas/proposal.schema.ts:128
|
Type : string
|
Decorators :
@ApiProperty({type: String, required: true, description: 'Email of main proposer.'})
|
|
Defined in src/proposals/schemas/proposal.schema.ts:84
|
| Optional endTime |
Type : Date
|
Decorators :
@ApiProperty({type: Date, required: false, description: 'The date when data collection finishes.'})
|
|
Defined in src/proposals/schemas/proposal.schema.ts:150
|
| Optional firstname |
Type : string
|
Decorators :
@ApiProperty({type: String, required: false, description: 'First name of main proposer.'})
|
|
Defined in src/proposals/schemas/proposal.schema.ts:95
|
| Optional lastname |
Type : string
|
Decorators :
@ApiProperty({type: String, required: false, description: 'Last name of main proposer.'})
|
|
Defined in src/proposals/schemas/proposal.schema.ts:106
|
| Optional MeasurementPeriodList |
Type : MeasurementPeriodClass[]
|
Decorators :
@ApiProperty({type: MeasurementPeriodClass, isArray: true, required: false, description: 'Embedded information used inside proposals to define which type of experiment has to be pursued, where (at which instrument) and when.'})
|
|
Defined in src/proposals/schemas/proposal.schema.ts:163
|
| Optional pi_email |
Type : string
|
Decorators :
@ApiProperty({type: String, required: false, description: 'Email of principal investigator.'})
|
|
Defined in src/proposals/schemas/proposal.schema.ts:51
|
| Optional pi_firstname |
Type : string
|
Decorators :
@ApiProperty({type: String, required: false, description: 'First name of principal investigator.'})
|
|
Defined in src/proposals/schemas/proposal.schema.ts:62
|
| Optional pi_lastname |
Type : string
|
Decorators :
@ApiProperty({type: String, required: false, description: 'Last name of principal investigator.'})
|
|
Defined in src/proposals/schemas/proposal.schema.ts:73
|
| proposalId |
Type : string
|
Decorators :
@ApiProperty({type: String, required: true, description: 'Globally unique identifier of a proposal, eg. PID-prefix/internal-proposal-number. PID prefix is auto prepended.'})
|
|
Defined in src/proposals/schemas/proposal.schema.ts:34
|
| Optional startTime |
Type : Date
|
Decorators :
@ApiProperty({type: Date, required: false, description: 'The date when the data collection starts.'})
|
|
Defined in src/proposals/schemas/proposal.schema.ts:139
|
| title |
Type : string
|
Decorators :
@ApiProperty({type: String, required: true, description: 'The title of the proposal.'})
|
|
Defined in src/proposals/schemas/proposal.schema.ts:117
|
| accessGroups |
Type : string[]
|
Default value : []
|
Decorators :
@ApiProperty({type: undefined, description: 'Optional additional groups which have read access to the data. Users which are members in one of the groups listed here are allowed to access this data. The special group 'public' makes data available to all users.'})
|
|
Inherited from
OwnableClass
|
|
Defined in
OwnableClass:26
|
| Optional instrumentGroup |
Type : string
|
Decorators :
@ApiProperty({type: String, required: false, description: 'Optional additional groups which have read and write access to the data. Users which are members in one of the groups listed here are allowed to access this data.'})
|
|
Inherited from
OwnableClass
|
|
Defined in
OwnableClass:38
|
| ownerGroup |
Type : string
|
Decorators :
@ApiProperty({type: String, description: 'Defines the group which owns the data, and therefore has unrestricted access to this data. Usually a pgroup like p12151'})
|
|
Inherited from
OwnableClass
|
|
Defined in
OwnableClass:15
|
| createdAt |
Type : Date
|
Decorators :
@ApiProperty({type: Date, description: 'Date and time when this record was created. This property is added and maintained by mongoose.'})
|
|
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.'})
|
|
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.'})
|
|
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.'})
|
|
Inherited from
QueryableClass
|
|
Defined in
QueryableClass:26
|
import { Prop, Schema, SchemaFactory } from "@nestjs/mongoose";
import { ApiProperty, getSchemaPath } from "@nestjs/swagger";
import { Document } from "mongoose";
import {
Attachment,
AttachmentSchema,
} from "src/attachments/schemas/attachment.schema";
import { OwnableClass } from "src/common/schemas/ownable.schema";
import {
MeasurementPeriodClass,
MeasurementPeriodSchema,
} from "./measurement-period.schema";
export type ProposalDocument = ProposalClass & Document;
@Schema({
collection: "Proposal",
toJSON: {
getters: true,
},
timestamps: true,
})
export class ProposalClass extends OwnableClass {
@ApiProperty({
type: String,
required: true,
description:
"Globally unique identifier of a proposal, eg. PID-prefix/internal-proposal-number. PID prefix is auto prepended.",
})
@Prop({
type: String,
unique: true,
required: true,
})
proposalId: string;
@Prop({
type: String,
})
_id: string;
@ApiProperty({
type: String,
required: false,
description: "Email of principal investigator.",
})
@Prop({
type: String,
required: false,
index: true,
})
pi_email?: string;
@ApiProperty({
type: String,
required: false,
description: "First name of principal investigator.",
})
@Prop({
type: String,
required: false,
})
pi_firstname?: string;
@ApiProperty({
type: String,
required: false,
description: "Last name of principal investigator.",
})
@Prop({
type: String,
required: false,
})
pi_lastname?: string;
@ApiProperty({
type: String,
required: true,
description: "Email of main proposer.",
})
@Prop({
type: String,
required: true,
})
email: string;
@ApiProperty({
type: String,
required: false,
description: "First name of main proposer.",
})
@Prop({
type: String,
required: false,
})
firstname?: string;
@ApiProperty({
type: String,
required: false,
description: "Last name of main proposer.",
})
@Prop({
type: String,
required: false,
})
lastname?: string;
@ApiProperty({
type: String,
required: true,
description: "The title of the proposal.",
})
@Prop({
type: String,
required: true,
})
title: string;
@ApiProperty({
type: String,
required: false,
description: "The proposal abstract.",
})
@Prop({
type: String,
required: false,
})
abstract?: string;
@ApiProperty({
type: Date,
required: false,
description: "The date when the data collection starts.",
})
@Prop({
type: Date,
required: false,
})
startTime?: Date;
@ApiProperty({
type: Date,
required: false,
description: "The date when data collection finishes.",
})
@Prop({
type: Date,
required: false,
})
endTime?: Date;
@ApiProperty({
type: MeasurementPeriodClass,
isArray: true,
required: false,
description:
"Embedded information used inside proposals to define which type of experiment has to be pursued, where (at which instrument) and when.",
})
@Prop({
type: [MeasurementPeriodSchema],
required: false,
})
MeasurementPeriodList?: MeasurementPeriodClass[];
}
export const ProposalSchema = SchemaFactory.createForClass(ProposalClass);
ProposalSchema.index({ "$**": "text" });