Skip to content

Commit

Permalink
Gfay fix improve validation (#14)
Browse files Browse the repository at this point in the history
* fix: add parcelles to existing numero

* feat: add nomComplement to existing numero
  • Loading branch information
MaGOs92 authored Nov 29, 2024
1 parent 5b45ed9 commit a5f60a3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/modules/signalement/schemas/existing-location.schema.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ApiProperty } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import { Position } from './position.schema';
import { IsArray, IsOptional } from 'class-validator';

export enum ExistingLocationTypeEnum {
NUMERO = 'NUMERO',
Expand Down Expand Up @@ -56,10 +57,19 @@ export class ExistingNumero extends ExistingLocation {
@Type(() => Position)
position: Position;

@ApiProperty({ required: false, nullable: true })
@IsArray()
@IsOptional()
parcelles?: string[];

@ApiProperty({
required: true,
nullable: false,
oneOf: [{ type: 'ExistingVoie' }, { type: 'ExistingToponyme' }],
})
toponyme: ExistingVoie | ExistingToponyme;

@ApiProperty({ required: false, nullable: false, type: String })
@IsOptional()
nomComplement?: string;
}

0 comments on commit a5f60a3

Please sign in to comment.