Skip to content

feat(IAV-364): Add HR agent integrations management API

yahya benchlikha a demandé de fusionner feature/IAV-364-agent-rh-integrations-backend vers develop

Objectif Implémentation du backend pour la gestion des intégrations de l'agent RH après le wizard.

Fonctionnalités ajoutées

1. Ajout d'intégration dynamique

  • Endpoint : POST /agent/{agentUid}/integrations
  • Injection dynamique de nœuds N8N dans le workflow existant
  • Support de 8 types d'intégrations :
    • LinkedIn
    • Google Drive
    • SharePoint
    • Google Calendar
    • Outlook Calendar
    • Microsoft Teams
    • Zoom
    • Google Meet

2. Suppression d'intégration

  • Endpoint : POST /agent/{agentUid}/integrations/remove
  • Suppression des nœuds N8N du workflow
  • Nettoyage des connexions
  • Déconnexion de l'AgentIntegration

3. Améliorations du wizard

  • Correction de l'URL du template file-manager
  • Injection automatique des credentials
  • Filtrage intelligent des nœuds par type d'intégration

🔧 Détails techniques

Nouveau service : HrIntegrationService

  • addIntegration() : Ajoute une intégration à un agent existant
  • removeIntegration() : Supprime une intégration d'un agent

Logique d'ajout d'intégration

  1. Vérification de l'existence du workflow
  2. Création du workflow si inexistant (via wizardService)
  3. Extraction des nœuds depuis le template file-manager
  4. Remplacement des placeholders de credentials
  5. Injection dans le workflow N8N existant
  6. Mise à jour des connexions
  7. Mise à jour de l'AgentIntegration

Logique de suppression

  1. Identification des nœuds de l'intégration
  2. Suppression des nœuds du workflow
  3. Nettoyage des connexions entrantes/sortantes
  4. Mise à jour du workflow N8N
  5. Déconnexion de l'AgentIntegration

DTOs créés

DTOs dans request/integrations : AddHrIntegrationRequest CreateHrWorkflowRequest GoogleCalendarOAuthConfirmRequest GoogleCalendarOAuthInitiateRequest GoogleDriveOAuthConfirmRequest GoogleDriveOAuthInitiateRequest GoogleMeetOAuthConfirmRequest GoogleMeetOAuthInitiateRequest LinkedInOAuthConfirmRequest LinkedInOAuthInitiateRequest MicrosoftTeamsOAuthConfirmRequest MicrosoftTeamsOAuthInitiateRequest OutlookCalendarOAuthConfirmRequest OutlookCalendarOAuthInitiateRequest RemoveHrIntegrationRequest SharePointOAuthConfirmRequest SharePointOAuthInitiateRequest SlackIntegrationSetupRequest ZoomOAuthConfirmRequest ZoomOAuthInitiateRequest AddHrIntegrationRequest CreateHrWorkflowRequest GoogleCalendarOAuthConfirmRequest GoogleCalendarOAuthInitiateRequest GoogleDriveOAuthConfirmRequest GoogleDriveOAuthInitiateRequest GoogleMeetOAuthConfirmRequest GoogleMeetOAuthInitiateRequest LinkedInOAuthConfirmRequest LinkedInOAuthInitiateRequest MicrosoftTeamsOAuthConfirmRequest MicrosoftTeamsOAuthInitiateRequest OutlookCalendarOAuthConfirmRequest OutlookCalendarOAuthInitiateRequest RemoveHrIntegrationRequest SharePointOAuthConfirmRequest SharePointOAuthInitiateRequest SlackIntegrationSetupRequest ZoomOAuthConfirmRequest ZoomOAuthInitiateRequest DTOs dans responses/integrations : AddHrIntegrationResponse CreateHrWorkflowResponse GoogleCalendarOAuthConfirmResponse GoogleCalendarOAuthInitiateResponse GoogleCalendarOAuthStatusResponse GoogleDriveOAuthConfirmResponse GoogleDriveOAuthInitiateResponse GoogleDriveOAuthStatusResponse GoogleMeetOAuthConfirmResponse GoogleMeetOAuthInitiateResponse GoogleMeetOAuthStatusResponse LinkedInOAuthConfirmResponse LinkedInOAuthInitiateResponse LinkedInOAuthStatusResponse MicrosoftTeamsOAuthConfirmResponse MicrosoftTeamsOAuthInitiateResponse MicrosoftTeamsOAuthStatusResponse OutlookCalendarOAuthConfirmResponse OutlookCalendarOAuthInitiateResponse OutlookCalendarOAuthStatusResponse RemoveHrIntegrationResponse SharePointOAuthConfirmResponse SharePointOAuthInitiateResponse SharePointOAuthStatusResponse SlackIntegrationSetupResponse ZoomOAuthConfirmResponse ZoomOAuthInitiateResponse ZoomOAuthStatusResponse Total : 20 DTOs de requête et 28 DTOs de réponse dans les répertoires d'intégration. AddHrIntegrationResponse CreateHrWorkflowResponse GoogleCalendarOAuthConfirmResponse GoogleCalendarOAuthInitiateResponse GoogleCalendarOAuthStatusResponse GoogleDriveOAuthConfirmResponse GoogleDriveOAuthInitiateResponse GoogleDriveOAuthStatusResponse GoogleMeetOAuthConfirmResponse GoogleMeetOAuthInitiateResponse GoogleMeetOAuthStatusResponse LinkedInOAuthConfirmResponse LinkedInOAuthInitiateResponse LinkedInOAuthStatusResponse MicrosoftTeamsOAuthConfirmResponse MicrosoftTeamsOAuthInitiateResponse MicrosoftTeamsOAuthStatusResponse OutlookCalendarOAuthConfirmResponse OutlookCalendarOAuthInitiateResponse OutlookCalendarOAuthStatusResponse RemoveHrIntegrationResponse SharePointOAuthConfirmResponse SharePointOAuthInitiateResponse SharePointOAuthStatusResponse SlackIntegrationSetupResponse ZoomOAuthConfirmResponse ZoomOAuthInitiateResponse ZoomOAuthStatusResponse Total : 20 DTOs de requête et 28 DTOs de réponse dans les répertoires d'intégration.

Tests manuels effectués

  • Ajout de LinkedIn à un agent sans workflow
  • Ajout de Teams à un agent avec workflow existant
  • Suppression d'une intégration
  • Vérification des nœuds dans N8N

Dépendances

  • Nécessite MR de iavia-common (workflow template updates)
  • Nécessite MR de core-n8n-service (workflow update endpoints)

Rapports de requête de fusion