[Backend] API Inscription Parent - REFONTE Workflow 6 etapes (#72)

Co-authored-by: Julien Martin <julien.martin@ptits-pas.fr>
Co-committed-by: Julien Martin <julien.martin@ptits-pas.fr>
This commit was merged in pull request #72.
This commit is contained in:
2025-12-01 21:43:36 +00:00
committed by jmartin
parent 9aea26805d
commit 579b6cae90
10 changed files with 861 additions and 14 deletions
+16 -2
View File
@@ -4,6 +4,7 @@ import { AuthService } from './auth.service';
import { Public } from 'src/common/decorators/public.decorator';
import { RegisterDto } from './dto/register.dto';
import { RegisterParentDto } from './dto/register-parent.dto';
import { RegisterParentCompletDto } from './dto/register-parent-complet.dto';
import { ApiBearerAuth, ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
import { AuthGuard } from 'src/common/guards/auth.guard';
import type { Request } from 'express';
@@ -39,10 +40,23 @@ export class AuthController {
@Public()
@Post('register/parent')
@ApiOperation({ summary: 'Inscription Parent (étape 1/6)' })
@ApiOperation({
summary: 'Inscription Parent COMPLÈTE - Workflow 6 étapes',
description: 'Crée Parent 1 + Parent 2 (opt) + Enfants + Présentation + CGU en une transaction'
})
@ApiResponse({ status: 201, description: 'Inscription réussie - Dossier en attente de validation' })
@ApiResponse({ status: 400, description: 'Données invalides ou CGU non acceptées' })
@ApiResponse({ status: 409, description: 'Email déjà utilisé' })
async inscrireParentComplet(@Body() dto: RegisterParentCompletDto) {
return this.authService.inscrireParentComplet(dto);
}
@Public()
@Post('register/parent/legacy')
@ApiOperation({ summary: '[OBSOLÈTE] Inscription Parent (étape 1/6 uniquement)' })
@ApiResponse({ status: 201, description: 'Inscription réussie' })
@ApiResponse({ status: 409, description: 'Email déjà utilisé' })
async registerParent(@Body() dto: RegisterParentDto) {
async registerParentLegacy(@Body() dto: RegisterParentDto) {
return this.authService.registerParent(dto);
}