[FA-misc] Add IJobStatusUpdate event contract and publishing helper

This commit is contained in:
gamer147
2026-01-30 16:32:01 -05:00
parent be1ebbea39
commit c25f59a4b4
2 changed files with 43 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
using FictionArchive.Common.Enums;
using FictionArchive.Service.Shared.Contracts.Events;
using MassTransit;
namespace FictionArchive.Service.Shared.Extensions;
public static class JobStatusPublisher
{
public static Task ReportJobStatus(
this IPublishEndpoint endpoint,
Guid jobId,
string jobType,
string displayName,
JobStatus status,
Guid? parentJobId = null,
string? errorMessage = null,
Dictionary<string, string>? metadata = null)
=> endpoint.Publish<IJobStatusUpdate>(new JobStatusUpdate(
jobId, parentJobId, jobType, displayName, status, errorMessage, metadata));
}