Rework jobs

This commit is contained in:
2026-03-20 21:40:05 +01:00
parent b781374691
commit 4a17b21f19
22 changed files with 449 additions and 157 deletions
@@ -15,9 +15,9 @@ namespace Musify.Application.Contracts.Infrastructure
DbSet<Upload> Uploads { get; }
DbSet<Job> Jobs { get; }
DbSet<ProcessExecution> ProcessExecutions { get; }
DbSet<JobOperation> JobOperations { get; }
DbSet<ProcessStepExecution> ProcessStepExecutions { get; }
Task<int> SaveChangesAsync(CancellationToken cancellationToken);
}
@@ -0,0 +1,25 @@
using Musify.Domain.Entities;
namespace Musify.Application.Contracts.Infrastructure
{
public interface IProcessTrackingStore
{
Task<Guid> GetOrCreateProcessAsync(
string processName,
Guid? correlationId,
Guid? conversationId,
Guid? messageId,
CancellationToken cancellationToken);
Task<Guid> StartStepAsync(
Guid processExecutionId,
string stepName,
ProcessStepComponentType componentType,
int attempt,
CancellationToken cancellationToken);
Task CompleteStepAsync(Guid processExecutionId, Guid stepExecutionId, CancellationToken cancellationToken);
Task FailStepAsync(Guid processExecutionId, Guid stepExecutionId, string errorMessage, CancellationToken cancellationToken);
}
}