feat(#111): Reprise après refus – backend
- GET /auth/reprise-dossier?token= : dossier pour préremplir (token seul) - PATCH /auth/reprise-resoumettre : token + champs modifiables → en_attente, token invalidé - POST /auth/reprise-identify : numero_dossier + email → type + token - UserService: findByTokenReprise, resoumettreReprise, findByNumeroDossierAndEmailForReprise Made-with: Cursor
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { RoleType } from 'src/entities/users.entity';
|
||||
|
||||
/** Réponse GET /auth/reprise-dossier – données dossier pour préremplir le formulaire reprise. Ticket #111 */
|
||||
export class RepriseDossierDto {
|
||||
@ApiProperty()
|
||||
id: string;
|
||||
|
||||
@ApiProperty()
|
||||
email: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
prenom?: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
nom?: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
telephone?: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
adresse?: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
ville?: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
code_postal?: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
numero_dossier?: string;
|
||||
|
||||
@ApiProperty({ enum: RoleType })
|
||||
role: RoleType;
|
||||
|
||||
@ApiProperty({ required: false, description: 'Pour AM' })
|
||||
photo_url?: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
genre?: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
situation_familiale?: string;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsEmail, IsString, MaxLength } from 'class-validator';
|
||||
|
||||
/** Body POST /auth/reprise-identify – numéro + email pour obtenir token reprise. Ticket #111 */
|
||||
export class RepriseIdentifyBodyDto {
|
||||
@ApiProperty({ example: '2026-000001' })
|
||||
@IsString()
|
||||
@MaxLength(20)
|
||||
numero_dossier: string;
|
||||
|
||||
@ApiProperty({ example: 'parent@example.com' })
|
||||
@IsEmail()
|
||||
email: string;
|
||||
}
|
||||
|
||||
/** Réponse POST /auth/reprise-identify */
|
||||
export class RepriseIdentifyResponseDto {
|
||||
@ApiProperty({ enum: ['parent', 'assistante_maternelle'] })
|
||||
type: 'parent' | 'assistante_maternelle';
|
||||
|
||||
@ApiProperty({ description: 'Token à utiliser pour GET reprise-dossier et PUT reprise-resoumettre' })
|
||||
token: string;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsOptional, IsString, MaxLength, IsUUID } from 'class-validator';
|
||||
|
||||
/** Body PUT /auth/reprise-resoumettre – token + champs modifiables. Ticket #111 */
|
||||
export class ResoumettreRepriseDto {
|
||||
@ApiProperty({ description: 'Token reprise (reçu par email)' })
|
||||
@IsUUID()
|
||||
token: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(100)
|
||||
prenom?: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(100)
|
||||
nom?: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(20)
|
||||
telephone?: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
adresse?: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(150)
|
||||
ville?: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(10)
|
||||
code_postal?: string;
|
||||
|
||||
@ApiProperty({ required: false, description: 'Pour AM' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
photo_url?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user