53 lines
890 B
TypeScript
53 lines
890 B
TypeScript
import { Type } from 'class-transformer';
|
|
import {
|
|
IsEnum,
|
|
IsISO8601,
|
|
IsNumber,
|
|
IsOptional,
|
|
IsString,
|
|
Max,
|
|
MaxLength,
|
|
Min,
|
|
} from 'class-validator';
|
|
import { AssetMediaKind } from '../../database/entities';
|
|
|
|
export class CreateAssetMediaDto {
|
|
@IsEnum(AssetMediaKind)
|
|
kind!: AssetMediaKind;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(200)
|
|
title?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(4000)
|
|
description?: string;
|
|
|
|
@IsOptional()
|
|
@IsISO8601({ strict: true })
|
|
capturedAt?: string;
|
|
|
|
@IsOptional()
|
|
@Type(() => Number)
|
|
@IsNumber({ maxDecimalPlaces: 6 })
|
|
@Min(-90)
|
|
@Max(90)
|
|
latitude?: number;
|
|
|
|
@IsOptional()
|
|
@Type(() => Number)
|
|
@IsNumber({ maxDecimalPlaces: 6 })
|
|
@Min(-180)
|
|
@Max(180)
|
|
longitude?: number;
|
|
|
|
@IsOptional()
|
|
@Type(() => Number)
|
|
@IsNumber({ maxDecimalPlaces: 3 })
|
|
@Min(0)
|
|
@Max(100000)
|
|
accuracyM?: number;
|
|
}
|