Add DTOs for revision and revision metadata

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2020-07-26 20:57:11 +02:00
parent 9a545bb394
commit 783d2cf5e4
No known key found for this signature in database
GPG key ID: 6017AF117F9756CB
2 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,13 @@
import { IsDate, IsNumber, IsString } from 'class-validator';
import { Revision } from './revision.entity';
export class RevisionMetadataDto {
@IsString()
id: Revision['id'];
@IsDate()
updatedAt: Date;
@IsNumber()
length: number;
}

View file

@ -0,0 +1,11 @@
import { IsString } from 'class-validator';
import { Revision } from './revision.entity';
export class RevisionDto {
@IsString()
id: Revision['id'];
@IsString()
content: string;
@IsString()
patch: string;
}