IA-1007: feat: integrate J'apprends assistant store, endpoints & UI into AI management
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 withfetchAssistants,createAssistant,updateAssistant,deleteAssistant, andevaluateInteraction -
endpointsJapprends.ts: API endpoint definitions for theassistant-japprendsgateway service (assistants + interactions)
Modified Files
PersonalizationAiView
- Imports and initializes
useAssistantJaprendsStorealongsideuseAssistantStore - Merges both assistant lists into
allAssistantsviauseMemo - Fetches both stores on mount
- Passes combined
isLoadingstate to the table
AIAssistantForm
- Routes
createAssistanttojaprendsStorewhentype === 'Apprentissage' - Replaces static
AI_ASSISTANT_EXERCISESmock with dynamicuseExerciseStore.fetchExercisestriggered on chapter selection - Adds
loadExercises+localExercisesstate management - Integrates
useAuthContextfor futureuserIdbinding
AIAssistantTableRow
- Subject/Chapter cells now prefer
subjectName/chapterNamefrom API response over local options lookup - Exercise cell displays
exerciseNameor truncated UUID with tooltip fallback
assistantStore (devoir)
- Fixes
createdAthandling: converts backend array format[year, month, day, ...]to ISO string