feat(backend): endpoint inscription parent + nettoyage code #9

🧹 NETTOYAGE CODE ÉTUDIANT:
- Suppression console.log/error (4 occurrences)
- Suppression code commenté inutile
- Suppression champs obsolètes (mobile, telephone_fixe)
- Correction password nullable dans Users entity

 NOUVELLES FONCTIONNALITÉS:
- Ajout champs token_creation_mdp dans Users entity
- Création RegisterParentDto (validation complète)
- Endpoint POST /auth/register/parent
- Méthode registerParent() avec transaction
- Gestion Parent 1 + Parent 2 (co-parent optionnel)
- Génération tokens UUID pour création MDP
- Lecture durée token depuis AppConfigService
- Création automatique entités Parents
- Statut EN_ATTENTE par défaut
- Intégration AppConfigModule dans AuthModule
- Amélioration méthode login() (vérif statut + password null)

📋 WORKFLOW CDC CONFORME:
- Inscription SANS mot de passe
- Token envoyé par email (TODO)
- Validation gestionnaire requise
- Support co-parent avec même adresse

Réf: docs/20_WORKFLOW-CREATION-COMPTE.md
Ticket: #9 (ou #16)
This commit is contained in:
2025-11-30 16:09:54 +01:00
parent 61b45cd830
commit 40c7f40d12
5 changed files with 313 additions and 30 deletions
+8 -8
View File
@@ -50,8 +50,8 @@ export class Users {
@Column({ unique: true, name: 'email' })
email: string;
@Column({ name: 'password' })
password: string;
@Column({ name: 'password', nullable: true })
password?: string;
@Column({ name: 'prenom', nullable: true })
prenom?: string;
@@ -96,12 +96,6 @@ export class Users {
@Column({ nullable: true, name: 'telephone' })
telephone?: string;
@Column({ name: 'mobile', nullable: true })
mobile?: string;
@Column({ name: 'telephone_fixe', nullable: true })
telephone_fixe?: string;
@Column({ nullable: true, name: 'adresse' })
adresse?: string;
@@ -117,6 +111,12 @@ export class Users {
@Column({ default: false, name: 'changement_mdp_obligatoire' })
changement_mdp_obligatoire: boolean;
@Column({ nullable: true, name: 'token_creation_mdp', length: 255 })
token_creation_mdp?: string;
@Column({ type: 'timestamptz', nullable: true, name: 'token_creation_mdp_expire_le' })
token_creation_mdp_expire_le?: Date;
@Column({ nullable: true, name: 'ville' })
ville?: string;