namespace GermanApp.Application.DTOs; /// /// Data Transfer Object for StorySegment. /// Used for API requests and responses. /// public record StorySegmentDto( int Id, int LevelId, int? LessonId, string Content, string? AudioUrl, int Order, string Title, string Theme, int EstimatedReadingMinutes, bool IsActive, DateTime CreatedAt, DateTime? UpdatedAt) { /// /// Creates a StorySegmentDto from a domain entity. /// public static StorySegmentDto FromEntity(Domain.Entities.StorySegment segment) { return new StorySegmentDto( segment.Id, segment.LevelId, segment.LessonId, segment.Content, segment.AudioUrl, segment.Order, segment.Title, segment.Theme, segment.EstimatedReadingMinutes, segment.IsActive, segment.CreatedAt, segment.UpdatedAt); } } /// /// DTO for creating a new story segment. /// public record CreateStorySegmentDto( int LevelId, int? LessonId, string Content, int Order, string Title, string Theme, int EstimatedReadingMinutes = 2); /// /// DTO for updating an existing story segment. /// public record UpdateStorySegmentDto( string? Content = null, int? Order = null, string? Title = null, string? Theme = null, int? EstimatedReadingMinutes = null, int? LessonId = null, bool? IsActive = null); /// /// DTO for generating a story for a level. /// public record StoryGenerationRequestDto( int LevelId, string Theme, int SegmentCount, string? CustomPrompt = null); /// /// Response DTO for story generation. /// public record StoryGenerationResponseDto( int LevelId, string Theme, int SegmentCount, string FullStoryText, IReadOnlyList Segments); /// /// DTO for user's story progress. /// public record StoryProgressDto( int LevelId, string LevelName, int TotalSegments, int UnlockedSegments, int CurrentSegmentOrder, IReadOnlyList Segments); /// /// DTO for individual segment progress. /// public record StorySegmentProgressDto( int SegmentId, int Order, string Title, bool IsUnlocked, bool IsCompleted);