Vizzuality/landgriffon

View on GitHub
api/src/modules/geo-regions/dto/create.geo-region.dto.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { ApiPropertyOptional } from '@nestjs/swagger';
import {
  IsArray,
  IsJSON,
  IsNotEmpty,
  IsOptional,
  IsString,
  MaxLength,
  MinLength,
} from 'class-validator';

export class CreateGeoRegionDto {
  @IsString()
  @IsNotEmpty()
  @MinLength(2)
  @MaxLength(40)
  @ApiPropertyOptional()
  name!: string;

  @IsArray()
  @IsOptional()
  @ApiPropertyOptional()
  h3Compact?: string[];

  @IsJSON()
  @IsOptional()
  @IsJSON()
  @ApiPropertyOptional()
  theGeom?: string;
}