Skip to content

Commit

Permalink
Merge pull request #1190 from SciCatProject/feature-issue-1178
Browse files Browse the repository at this point in the history
added metadata to proposal
  • Loading branch information
nitrosx authored May 1, 2024
2 parents 05965bc + 0ef58bb commit df54d79
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/proposals/dto/update-proposal.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
IsArray,
IsDateString,
IsEmail,
IsObject,
IsOptional,
IsString,
ValidateNested,
Expand Down Expand Up @@ -113,6 +114,16 @@ export class UpdateProposalDto extends OwnableDto {
@ValidateNested({ each: true })
@Type(() => CreateMeasurementPeriodDto)
readonly MeasurementPeriodList?: CreateMeasurementPeriodDto[];

@ApiProperty({
type: Object,
required: false,
default: {},
description: "JSON object containing the proposal metadata.",
})
@IsOptional()
@IsObject()
readonly metadata?: Record<string, unknown>;
}

export class PartialUpdateProposalDto extends PartialType(UpdateProposalDto) {}
9 changes: 9 additions & 0 deletions src/proposals/schemas/proposal.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,15 @@ export class ProposalClass extends OwnableClass {
required: false,
})
MeasurementPeriodList?: MeasurementPeriodClass[];

@ApiProperty({
type: Object,
required: false,
default: {},
description: "JSON object containing the proposal metadata.",
})
@Prop({ type: Object, required: false, default: {} })
metadata?: Record<string, unknown>;
}

export const ProposalSchema = SchemaFactory.createForClass(ProposalClass);
Expand Down

0 comments on commit df54d79

Please sign in to comment.