feat(release): Backend Relais Module (#94)

- Implemented Relais entity and CRUD API
- Added relation between Users (Gestionnaires) and Relais
- Updated database initialization script
- Documentation updates

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-02-21 14:40:32 +01:00
co-authored by Cursor
parent d32d956b0e
commit 42c569e491
13 changed files with 324 additions and 16 deletions
@@ -41,19 +41,24 @@ export class GestionnairesService {
: undefined,
changement_mdp_obligatoire: dto.changement_mdp_obligatoire ?? false,
role: RoleType.GESTIONNAIRE,
relaisId: dto.relaisId,
});
return this.gestionnaireRepository.save(entity);
}
// Liste des gestionnaires
async findAll(): Promise<Users[]> {
return this.gestionnaireRepository.find({ where: { role: RoleType.GESTIONNAIRE } });
return this.gestionnaireRepository.find({
where: { role: RoleType.GESTIONNAIRE },
relations: ['relais'],
});
}
// Récupérer un gestionnaire par ID
async findOne(id: string): Promise<Users> {
const gestionnaire = await this.gestionnaireRepository.findOne({
where: { id, role: RoleType.GESTIONNAIRE },
relations: ['relais'],
});
if (!gestionnaire) throw new NotFoundException('Gestionnaire introuvable');
return gestionnaire;