[FA-misc] Mass transit overhaul, needs testing and review

This commit is contained in:
gamer147
2026-01-21 23:16:31 -05:00
parent 055ef33666
commit f88f340d0a
97 changed files with 1150 additions and 858 deletions

View File

@@ -0,0 +1,17 @@
using NodaTime;
namespace FictionArchive.Service.ReportingService.Models.DTOs;
public class JobDto
{
public Guid Id { get; set; }
public required string JobType { get; set; }
public required string Status { get; set; }
public string? CurrentStep { get; set; }
public string? ErrorMessage { get; set; }
public Dictionary<string, object>? Metadata { get; set; }
public List<JobHistoryEntryDto> History { get; set; } = new();
public Instant CreatedTime { get; set; }
public Instant UpdatedTime { get; set; }
public Instant? CompletedTime { get; set; }
}

View File

@@ -0,0 +1,12 @@
using NodaTime;
namespace FictionArchive.Service.ReportingService.Models.DTOs;
public class JobHistoryEntryDto
{
public required string FromState { get; set; }
public required string ToState { get; set; }
public string? Message { get; set; }
public string? Error { get; set; }
public Instant Timestamp { get; set; }
}

View File

@@ -0,0 +1,19 @@
using System.Text.Json;
using NodaTime;
namespace FictionArchive.Service.ReportingService.Models.Database;
public class Job
{
public Guid Id { get; set; }
public required string JobType { get; set; }
public required string Status { get; set; }
public string? CurrentStep { get; set; }
public string? ErrorMessage { get; set; }
public JsonDocument? Metadata { get; set; }
public Instant CreatedTime { get; set; }
public Instant UpdatedTime { get; set; }
public Instant? CompletedTime { get; set; }
public ICollection<JobHistoryEntry> History { get; set; } = new List<JobHistoryEntry>();
}

View File

@@ -0,0 +1,16 @@
using NodaTime;
namespace FictionArchive.Service.ReportingService.Models.Database;
public class JobHistoryEntry
{
public int Id { get; set; }
public Guid JobId { get; set; }
public required string FromState { get; set; }
public required string ToState { get; set; }
public string? Message { get; set; }
public string? Error { get; set; }
public Instant Timestamp { get; set; }
public Job Job { get; set; } = null!;
}