hedgedoc/src/history/history-entry.dto.ts
Philip Molares 47ca8be78b
Docs: Add ApiProperty to all Dtos
This makes it possible for the autogenerated openapi file to contain all the dtos instead of nothing.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-19 12:08:34 +01:00

47 lines
892 B
TypeScript

/*
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { IsArray, IsBoolean, IsDate, IsString } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
export class HistoryEntryDto {
/**
* ID or Alias of the note
*/
@IsString()
@ApiProperty()
identifier: string;
/**
* Title of the note
* Does not contain any markup but might be empty
* @example "Shopping List"
*/
@IsString()
@ApiProperty()
title: string;
/**
* Datestring of the last time this note was updated
* @example "2020-12-01 12:23:34"
*/
@IsDate()
@ApiProperty()
lastVisited: Date;
@IsArray()
@IsString({ each: true })
@ApiProperty()
tags: string[];
/**
* True if this note is pinned
* @example false
*/
@IsBoolean()
@ApiProperty()
pinStatus: boolean;
}