Fix Actions that can have related chapters and manga

This commit is contained in:
2025-10-16 20:28:43 +02:00
parent d029512354
commit ef907ee09d
15 changed files with 75 additions and 49 deletions

View File

@@ -3,7 +3,9 @@ using API.Schema.MangaContext;
namespace API.Schema.ActionsContext.Actions;
public sealed class ChapterDownloadedActionRecord(ActionsEnum action, DateTime performedAt, string chapterId) : ActionWithChapterRecord(action, performedAt, chapterId)
public sealed class ChapterDownloadedActionRecord(ActionsEnum action, DateTime performedAt, string mangaId, string chapterId) : ActionRecord(action, performedAt), IActionWithChapterRecord, IActionWithMangaRecord
{
public ChapterDownloadedActionRecord(Chapter chapter) : this(ActionsEnum.ChapterDownloaded, DateTime.UtcNow, chapter.Key) { }
public ChapterDownloadedActionRecord(Manga manga, Chapter chapter) : this(ActionsEnum.ChapterDownloaded, DateTime.UtcNow, manga.Key, chapter.Key) { }
public string ChapterId { get; init; } = chapterId;
public string MangaId { get; init; } = mangaId;
}