Skip to content

IAV-841/feat(wizard): Implement Sub-Agent Wizard and refactor wizard architecture

salaheddine zidani a demandé de fusionner feature/IAV-841 vers develop

Summary

This MR introduces the Sub-Agent Wizard feature and refactors the existing wizard architecture to support both Main Agent and Sub-Agent configuration flows with improved code organization and API documentation.

Motivation

The current wizard implementation only supports Main Agent configuration. Customers need the ability to configure Sub-Agents with a similar wizard experience. Additionally, the existing code structure needed refactoring to:

  • Share common functionality between Main and Sub-Agent wizards
  • Improve API documentation for frontend integration
  • Follow better coding practices (utility class patterns)

Changes

New Features

Sub-Agent Wizard Controller

New REST controller (SubAgentWizardController) providing complete wizard flow:

Step Endpoint Methods
Company Context /{subAgentUid}/company-context GET, PUT
Objectives /{subAgentUid}/objectives GET, POST
Standard Instructions /{subAgentUid}/standard-instructions-config GET, PUT
Identity /{subAgentUid}/identity GET, PUT
FAQ /{subAgentUid}/faq GET
Notifications /{subAgentUid}/notification-config GET, POST
Integrations /{subAgentUid}/integrations POST
Workflow /{subAgentUid}/workflow POST

New DTOs

  • SubAgentIdentityDataRequest - Supports sub-agent renaming via optional name field
  • SubAgentIdentityDataResponse - Includes subAgentUid and name for identification
  • UpdateCompanyContextRequest - Partial update support with all optional fields

Refactoring

Package Restructuring

BEFORE:
├── constants/paths/
│   └── MainAgentWizardPaths.java
├── dtos/agent/mainAgentWizard/
│   └── *.java

AFTER:
├── constants/paths/agentWizardPaths/
│   ├── AgentWizardPaths.java (shared)
│   ├── MainAgentWizardPaths.java
│   └── SubAgentWizardPaths.java
├── dtos/agent/wizard/
│   ├── mainAgentWizard/*.java
│   └── subAgentWizard/*.java

Code Quality Improvements

  • Full OpenAPI/Swagger documentation on all endpoints
  • Utility classes made final with private constructors
  • Consistent logging patterns across controllers
  • Simplified method names in controllers

Breaking Changes

Import paths have changed:

Type Old Package New Package
Path Constants c.i.i.constants.paths.MainAgentWizardPaths c.i.i.constants.paths.agentWizardPaths.MainAgentWizardPaths
Wizard DTOs c.i.i.dtos.agent.mainAgentWizard.* c.i.i.dtos.agent.wizard.mainAgentWizard.*

API Endpoints

New Sub-Agent Wizard Base Path

/api/customer-care/sub-agent-wizard

Endpoint Examples

GET  /api/customer-care/sub-agent-wizard/{subAgentUid}/company-context
PUT  /api/customer-care/sub-agent-wizard/{subAgentUid}/identity
POST /api/customer-care/sub-agent-wizard/{subAgentUid}/workflow

Testing

  • Unit tests for SubAgentWizardService
  • Integration tests for all new endpoints
  • Verify OpenAPI documentation renders correctly in Swagger UI
  • Test authorization (user must own the sub-agent)

Checklist

  • Code follows project conventions
  • OpenAPI documentation added
  • Logging implemented
  • No breaking changes to existing Main Agent Wizard functionality
  • Unit tests added
  • Integration tests added
  • Documentation updated

Related Issues

IAV-841, IAV-842, IAV-843, IAV-844, IAV-845, IAV-846, IAV-847, IAV-838, IAV-848, IAV-849

Modification effectuée par salaheddine zidani

Rapports de requête de fusion