Skip to content

IA-1007: feat: integrate J'apprends assistant store, endpoints & UI into AI management

khadija.elbachouri a demandé de fusionner feature/IA-1007 vers develop

Summary

Integrates the J'apprends assistant service into the existing AI assistant management module, enabling unified listing, creation, and display alongside Devoir assistants.

Changes

New Files

  • assistantJaprendsStore.ts: Zustand store with fetchAssistants, createAssistant, updateAssistant, deleteAssistant, and evaluateInteraction
  • endpointsJapprends.ts: API endpoint definitions for the assistant-japprends gateway service (assistants + interactions)

Modified Files

PersonalizationAiView

  • Imports and initializes useAssistantJaprendsStore alongside useAssistantStore
  • Merges both assistant lists into allAssistants via useMemo
  • Fetches both stores on mount
  • Passes combined isLoading state to the table

AIAssistantForm

  • Routes createAssistant to japrendsStore when type === 'Apprentissage'
  • Replaces static AI_ASSISTANT_EXERCISES mock with dynamic useExerciseStore.fetchExercises triggered on chapter selection
  • Adds loadExercises + localExercises state management
  • Integrates useAuthContext for future userId binding

AIAssistantTableRow

  • Subject/Chapter cells now prefer subjectName/chapterName from API response over local options lookup
  • Exercise cell displays exerciseName or truncated UUID with tooltip fallback

assistantStore (devoir)

  • Fixes createdAt handling: converts backend array format [year, month, day, ...] to ISO string

Rapports de requête de fusion