Added English localization integration tests.
This commit is contained in:
@@ -4,5 +4,32 @@ namespace JSMR.Application.Scanning.Ports;
|
||||
|
||||
public interface IVoiceWorkUpdater
|
||||
{
|
||||
Task<int[]> UpsertAsync(IReadOnlyCollection<VoiceWorkIngest> ingests, CancellationToken cancellationToken);
|
||||
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
|
||||
}
|
||||
@@ -43,7 +43,9 @@ public sealed class ScanVoiceWorksHandler(
|
||||
return VoiceWorkIngest.From(work, value);
|
||||
})];
|
||||
|
||||
int[] voiceWorkIds = await updater.UpsertAsync(ingests, cancellationToken);
|
||||
VoiceWorkUpsertResult[] upsertResults = await updater.UpsertAsync(ingests, cancellationToken);
|
||||
int[] voiceWorkIds = [.. upsertResults.Where(x => x.VoiceWorkId.HasValue).Select(x => x.VoiceWorkId!.Value)];
|
||||
|
||||
await searchUpdater.UpdateAsync(voiceWorkIds, cancellationToken);
|
||||
|
||||
return new();
|
||||
|
||||
Reference in New Issue
Block a user