From 85bfef7a6b38d3cc48f0c1bd0987c4681c8f6141 Mon Sep 17 00:00:00 2001 From: Julien Martin Date: Thu, 26 Feb 2026 11:21:45 +0100 Subject: [PATCH] =?UTF-8?q?feat(#102):=20DTO=20NIR=20-=20accepter=202A/2B?= =?UTF-8?q?=20Corse=20(15=20caract=C3=A8res)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Made-with: Cursor --- backend/src/routes/auth/dto/register-am-complet.dto.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/src/routes/auth/dto/register-am-complet.dto.ts b/backend/src/routes/auth/dto/register-am-complet.dto.ts index 72728ca..5800bdd 100644 --- a/backend/src/routes/auth/dto/register-am-complet.dto.ts +++ b/backend/src/routes/auth/dto/register-am-complet.dto.ts @@ -103,10 +103,12 @@ export class RegisterAMCompletDto { @MaxLength(100) lieu_naissance_pays?: string; - @ApiProperty({ example: '123456789012345', description: 'NIR 15 chiffres' }) + @ApiProperty({ example: '123456789012345', description: 'NIR 15 caractères (chiffres, ou 2A/2B pour la Corse)' }) @IsString() @IsNotEmpty({ message: 'Le NIR est requis' }) - @Matches(/^\d{15}$/, { message: 'Le NIR doit contenir exactement 15 chiffres' }) + @Matches(/^[1-3]\d{4}(?:2A|2B|\d{2})\d{6}\d{2}$/, { + message: 'Le NIR doit contenir 15 caractères (chiffres, ou 2A/2B pour la Corse)', + }) nir: string; @ApiProperty({ example: 'AGR-2024-12345', description: "Numéro d'agrément" })