docs: ajouter section tests dans CLAUDE.md

This commit is contained in:
Pierre Marx
2026-03-18 20:41:24 -04:00
parent cd76e71a5e
commit 25f0f2f078

View File

@@ -3,17 +3,18 @@
Application desktop de télésecrétariat pour les postes RDVPREM. Application desktop de télésecrétariat pour les postes RDVPREM.
## Stack ## Stack
- **Electron 28** + **SignalR** (@microsoft/signalr 9.0.6) + **Choices.js** 11.1.0 - **Electron 28** + **Socket.IO** (socket.io-client 4.8.1) + **Choices.js** 11.1.0
- HTML/CSS/JavaScript natif (pas de framework frontend) - HTML/CSS/JavaScript natif (pas de framework frontend)
## Structure ## Structure
``` ```
├── main.js # Process principal — SignalR, IPC, fenêtres ├── main.js # Process principal — Socket.IO, IPC, fenêtres
├── socketio-adapter.js # Adaptateur Socket.IO (connect/logoff/disconnect)
├── renderer.js # Process renderer — UI, webviews ├── renderer.js # Process renderer — UI, webviews
├── index.html # Structure HTML ├── index.html # Structure HTML
├── styles-modern.css # Styles CSS ├── styles-modern.css # Styles CSS
├── config.json # Config SignalR (host, port, serviceProvider) ├── config.json # Config Socket.IO (serverUrl, serviceProvider)
└── notes/ # Stockage notes agents (notes_{agentId}.json) └── notes/ # Stockage notes agents (notes_{agentId}.json)
``` ```
@@ -27,15 +28,24 @@ bun run build:linux # Build Linux (AppImage, .deb, .rpm)
bun run build:mac # Build macOS (.dmg, .app) bun run build:mac # Build macOS (.dmg, .app)
``` ```
## Tests
```bash
bun test # 8 tests unitaires socketio-adapter
```
- `socketio-adapter.js` accepte un socket factory en 2e param (injection pour tests)
- Fake socket avec EventEmitter minimal dans `socketio-adapter.test.js`
## Points d'attention ## Points d'attention
- **Pas d'emojis** dans l'UI — icônes SVG inline (compatibilité Linux) - **Pas d'emojis** dans l'UI — icônes SVG inline (compatibilité Linux)
- **Sessions webview isolées** : partition Electron unique par centre, auto-connexion via preload script - **Sessions webview isolées** : partition Electron unique par centre, auto-connexion via preload script
- **SignalR reconnexion** : [0, 2000, 5000, 10000]ms - **Socket.IO reconnexion** : illimitée (2s→10s backoff)
- **IPC principal** : `agent-login`, `get-terminals`, `signalr-status`, `switch-to-center`, `release-center` - **IPC principal** : `login-agent`, `get-terminal-list`, `server-status`, `switch-to-center`, `release-center`
- **Hub SignalR** : `/planningHub` — méthodes `AgentLogin`, `AgentLogoff`, `GetTerminalListByServiceProvider` - **Protocole serveur** : auth au handshake, events `login_ok`/`login_error`/`ipbx_event`/`logout``logout_ok`
- **Événement `IpbxEvent`** : codes 1=appel entrant, 2=fin d'appel - **Terminaux** : REST `GET /terminals?provider=RDVPREM` (pas Socket.IO)
- **Logs SignalR** : `~/.simpleconnect-ng/signalr.log` (JSON structuré) - **Logs** : `~/.simpleconnect-ng/socketio.log`
- **Notes** : sauvegarde auto après 2s d'inactivité, 50 versions, sync localStorage + fichier - **Notes** : sauvegarde auto après 2s d'inactivité, 50 versions, sync localStorage + fichier
## Workflow de développement ## Workflow de développement