diff --git a/src/proposals/dto/create-measurement-period.dto.ts b/src/proposals/dto/create-measurement-period.dto.ts index b36af371b..3ed4b417b 100644 --- a/src/proposals/dto/create-measurement-period.dto.ts +++ b/src/proposals/dto/create-measurement-period.dto.ts @@ -1,4 +1,3 @@ -import { ApiProperty } from "@nestjs/swagger"; import { IsDateString, IsOptional, IsString } from "class-validator"; export class CreateMeasurementPeriodDto { diff --git a/src/proposals/dto/create-proposal.dto.ts b/src/proposals/dto/create-proposal.dto.ts index 652c45ca0..7d2c1a99f 100644 --- a/src/proposals/dto/create-proposal.dto.ts +++ b/src/proposals/dto/create-proposal.dto.ts @@ -1,4 +1,3 @@ -import { ApiProperty } from "@nestjs/swagger"; import { IsString } from "class-validator"; import { UpdateProposalDto } from "./update-proposal.dto"; diff --git a/src/proposals/dto/update-proposal.dto.ts b/src/proposals/dto/update-proposal.dto.ts index cf652bcc5..f936737a7 100644 --- a/src/proposals/dto/update-proposal.dto.ts +++ b/src/proposals/dto/update-proposal.dto.ts @@ -1,4 +1,4 @@ -import { ApiProperty, ApiTags, PartialType } from "@nestjs/swagger"; +import { ApiTags, PartialType } from "@nestjs/swagger"; import { Type } from "class-transformer"; import { IsArray, diff --git a/src/proposals/schemas/measurement-period.schema.ts b/src/proposals/schemas/measurement-period.schema.ts index 9de9e61fd..a39fcf859 100644 --- a/src/proposals/schemas/measurement-period.schema.ts +++ b/src/proposals/schemas/measurement-period.schema.ts @@ -1,5 +1,4 @@ import { Prop, Schema, SchemaFactory } from "@nestjs/mongoose"; -import { ApiProperty } from "@nestjs/swagger"; import { Document } from "mongoose"; import { QueryableClass } from "src/common/schemas/queryable.schema"; diff --git a/src/proposals/schemas/proposal.schema.ts b/src/proposals/schemas/proposal.schema.ts index 2bf4e5a15..323012d5c 100644 --- a/src/proposals/schemas/proposal.schema.ts +++ b/src/proposals/schemas/proposal.schema.ts @@ -1,5 +1,5 @@ import { Prop, Schema, SchemaFactory } from "@nestjs/mongoose"; -import { ApiHideProperty, ApiProperty } from "@nestjs/swagger"; +import { ApiHideProperty } from "@nestjs/swagger"; import { Document, Schema as MongooseSchema } from "mongoose"; import { OwnableClass } from "src/common/schemas/ownable.schema"; @@ -137,43 +137,30 @@ export class ProposalClass extends OwnableClass { }) MeasurementPeriodList?: MeasurementPeriodClass[]; - @ApiProperty({ - type: MongooseSchema.Types.Mixed, - required: false, - default: {}, - description: "JSON object containing the proposal metadata.", - }) + /** + * JSON object containing the proposal metadata. + */ @Prop({ type: MongooseSchema.Types.Mixed, required: false, default: {} }) - metadata?: Record; + metadata?: Record = {}; - @ApiProperty({ - type: String, - required: false, - description: "Parent proposal id", - default: null, - nullable: true, - }) + /** + * Parent proposal id + */ @Prop({ type: String, - required: false, default: null, ref: "Proposal", }) - parentProposalId: string; + parentProposalId: string | null = null; - @ApiProperty({ - type: String, - required: true, - default: DEFAULT_PROPOSAL_TYPE, - description: - "Characterize type of proposal, use some of the configured values", - }) + /** + * Characterize type of proposal, use some of the configured values + */ @Prop({ type: String, - required: true, default: DEFAULT_PROPOSAL_TYPE, }) - type: string; + type: string = DEFAULT_PROPOSAL_TYPE; } export const ProposalSchema = SchemaFactory.createForClass(ProposalClass);