Skip to content

IA-1008 : refactor: migrate userId to String and enrich assistant model with subject resolution

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

Summary

This MR migrates userId from Long to String across all layers of the assistant-japprends microservice, enriches the ChildExerciseAssistant model with subject/chapter/exercise metadata resolved at mapping time, and adds minor infrastructure improvements.

Changes

Dependency

  • Bump brainboost-common 0.0.103-RELEASE0.0.104-SNAPSHOT

Infrastructure

  • Add @EnableJpaAuditing to Application to enable JPA audit timestamps
  • Expose RestTemplate as a Spring bean (required by the new mapper)
  • Add subject-management.url property to application.yml

Breaking refactor — userId: Long → String

All layers updated consistently:

  • DTOs: ChildExerciseAssistantDTO, InteractionExerciceDTO, ResponseHistoryDTO, ProcessingTaskDTO, RagQueryRequest
  • Service interfaces & impls: RAGService, OCRService, SpeechService, ChildExerciseAssistantService, InteractionExerciceService, MultimediaProcessingService and all their implementations
  • Controllers: ChildExerciseAssistantController, InteractionExerciceController

Assistant model enrichment

  • ChildExerciseAssistantDTO gains: uuid, name, description, subjectId, chapterId, exerciseId, subjectName, chapterName, exerciseName
  • ChildExerciseAssistantMapper rewritten to resolve human-readable names from subject-management service via RestTemplate at mapping time
  • Added SubjectServiceClient interface + SubjectNameDTO, ChapterNameDTO, ExerciseNameDTO client DTOs

Repository

  • ChildExerciseAssistantRepository: findByUserId migrated to String, in-memory search replaced with a proper JPQL @Query on userId / educationLevel / status
  • ResponseHistoryRepository: simplified to a single findByUserIdOrderByDateResponseDesc(String) method

Interaction service

  • save() and evaluateWithMedia() annotated with @Transactional
  • evaluate() simplified (status management only, no direct RAG call)

Rapports de requête de fusion