Commit graph

6 commits

Author SHA1 Message Date
Lasse Rune Hansen
e002868b74 feat(backend/application): implement Phase 5 AI Service Integration
- Create higher-level AI services:
  - StoryGenerationService (uses MistralService)
  - WritingFeedbackService (uses MistralService)
  - SpeechExerciseService (uses VoskService)
  - AudioGenerationService (uses TtsService)
  - AiFallbackService (fallback mechanisms for service failures)
- Register AiFallbackService in Program.cs DI container
- Add comprehensive unit tests for all Phase 5 services:
  - AiFallbackServiceTests (14 tests)
  - AudioGenerationServiceTests (16 tests)
  - MistralServiceTests (16 tests)
  - SpeechExerciseServiceTests (12 tests)
  - StoryGenerationServiceTests (13 tests)
  - WritingFeedbackServiceTests (11 tests)
  - VoskServiceTests (15 tests)
  - TtsServiceTests (21 tests)
- Update feature document (ai-services.md) to mark Phase 5 as complete

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-13 12:44:10 +02:00
Lasse Rune Hansen
9215ed7a05 feat(backend/application): Complete Lesson Management feature implementation
- Integrated Quiz completion with ProgressService: when a quiz is passed (>=80%), the associated lesson is automatically marked as completed
- Created LessonUnlockService for centralized lesson unlocking business logic
- Created LevelCompletionCalculator for calculating level completion metrics
- Registered new services in Program.cs DI container
- Updated QuizQuestionService to include ProgressService dependency
- Updated documentation (ROADMAP.md, lesson-management.md) to reflect completion
- Fixed QuizQuestionServiceTests to work with updated dependencies

All tests pass (296 total: 148 unit + 148 integration).

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-13 09:34:42 +02:00
Lasse Rune Hansen
04ad7ef008 feat(backend/domain): add quiz question feature with Docker migration support
- Add QuizQuestion and QuizOption domain entities with QuestionType enum
- Add IQuizQuestionRepository and IQuizOptionRepository interfaces
- Add QuizQuestionRepository and QuizOptionRepository EF Core implementations
- Add QuizQuestionService with CRUD, quiz submission, and statistics
- Add QuizQuestionsController with comprehensive REST API endpoints
- Add QuizQuestionDto and related DTOs for API communication
- Add EF Core migration (20260612050652_AddQuizQuestionTables) for QuizQuestion and QuizOption
- Add seed data with sample quiz questions for Greetings, Numbers, Grammar lessons
- Update AppDbContext with DbSets and entity configurations
- Update Program.cs with migration retry logic for Docker
- Update docker-compose.yml with SeedDatabase configuration
- Add unit tests for QuizQuestionService

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-12 16:49:27 +02:00
Lasse Rune Hansen
57e51d0d0b test(backend/infrastructure): add unit tests for MistralConnector
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
- Add Tests/Unit/Infrastructure/Services/MistralConnectorTests.cs with 20 tests
  - Constructor validation tests
  - Configuration validation tests
  - Model factory method tests
  - Rate limiter tests
  - Circuit breaker tests
- Fix HttpClient Content-Type header issue (use Accept header instead)
- All 137 unit tests passing (117 previous + 20 new)

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-09 20:00:14 +02:00
Lasse Rune Hansen
0ff6218ff1 test(backend): add unit tests for LevelService, LessonService, and ProgressService
- Created LevelServiceTests.cs with 10 test methods
- Created LessonServiceTests.cs with 10 test methods
- Created ProgressServiceTests.cs with 10 test methods
- All tests use Moq for repository mocking
- Total: 30 new unit tests for application services
- All tests follow MSTest framework conventions

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-09 06:50:13 +02:00
Lasse Rune Hansen
6bcf592918 feat(backend): complete unit tests for User Authentication feature
- Fix MSTest compatibility with .NET 9.0 by upgrading to MSTest.TestFramework 4.2.3
- Move Tests directory to solution level (Tests/) to prevent test files from being compiled with GermanApp
- Update test project references to point to GermanApp/GermanApp.csproj
- Add InternalsVisibleTo attributes for test assemblies
- Make RefreshToken properties internal for testability
- Fix User.ChangeEmail null handling
- Add 46 comprehensive unit tests for User and RefreshToken domain entities
- All tests passing successfully

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-05 17:07:15 +02:00