35 lines
778 B
C#
35 lines
778 B
C#
using JSMR.Application.Scanning.Contracts;
|
|
|
|
namespace JSMR.Application.Scanning.Ports;
|
|
|
|
public interface IVoiceWorkUpdater
|
|
{
|
|
Task<VoiceWorkUpsertResult[]> UpsertAsync(IReadOnlyCollection<VoiceWorkIngest> ingests, CancellationToken cancellationToken);
|
|
}
|
|
|
|
public class VoiceWorkUpsertResult
|
|
{
|
|
public int? VoiceWorkId { get; set; }
|
|
public ICollection<VoiceWorkUpsertIssue> Issues { get; } = [];
|
|
public VoiceWorkUpsertStatus Status { get; set; } = VoiceWorkUpsertStatus.Unchanged;
|
|
}
|
|
|
|
public record VoiceWorkUpsertIssue(
|
|
string Message,
|
|
VoiceWorkUpsertIssueSeverity Severity
|
|
);
|
|
|
|
public enum VoiceWorkUpsertIssueSeverity
|
|
{
|
|
Information,
|
|
Warning,
|
|
Error
|
|
}
|
|
|
|
public enum VoiceWorkUpsertStatus
|
|
{
|
|
Unchanged,
|
|
Inserted,
|
|
Updated,
|
|
Skipped
|
|
} |