< Summary

Information
Class: ProjectTemplate.Infrastructure.Data.Configurations.ApplicationAuditCompletionOutboxEntryConfiguration
Assembly: ProjectTemplate.Infrastructure
File(s): /home/runner/work/NetCoreApplicationTemplate/NetCoreApplicationTemplate/src/ProjectTemplate.Infrastructure/Data/Configurations/ApplicationAuditCompletionOutboxEntryConfiguration.cs
Line coverage
100%
Covered lines: 42
Uncovered lines: 0
Coverable lines: 42
Total lines: 61
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
Configure(...)100%11100%

File(s)

/home/runner/work/NetCoreApplicationTemplate/NetCoreApplicationTemplate/src/ProjectTemplate.Infrastructure/Data/Configurations/ApplicationAuditCompletionOutboxEntryConfiguration.cs

#LineLine coverage
 1using Microsoft.EntityFrameworkCore;
 2using Microsoft.EntityFrameworkCore.Metadata.Builders;
 3using ProjectTemplate.Infrastructure.Data.Entities;
 4
 5namespace ProjectTemplate.Infrastructure.Data.Configurations;
 6
 7/// <summary>
 8/// Configures durable audit-completion outbox persistence.
 9/// </summary>
 10public sealed class ApplicationAuditCompletionOutboxEntryConfiguration
 11    : IEntityTypeConfiguration<ApplicationAuditCompletionOutboxEntry>
 12{
 13    /// <inheritdoc />
 14    public void Configure(EntityTypeBuilder<ApplicationAuditCompletionOutboxEntry> builder)
 15    {
 816        builder.ToTable("ApplicationAuditCompletionOutbox");
 17
 818        builder.HasKey(entry => entry.Id);
 819        builder.Property(entry => entry.Id).ValueGeneratedNever();
 20
 821        builder.Property(entry => entry.SchemaVersion)
 822            .HasMaxLength(32)
 823            .IsRequired();
 824        builder.Property(entry => entry.Destination)
 825            .HasMaxLength(128)
 826            .IsRequired();
 827        builder.Property(entry => entry.IdempotencyKey)
 828            .HasMaxLength(128)
 829            .IsRequired();
 830        builder.Property(entry => entry.MutationBatchId)
 831            .HasMaxLength(64)
 832            .IsRequired();
 833        builder.Property(entry => entry.PersistenceOutcome)
 834            .HasMaxLength(64)
 835            .IsRequired();
 836        builder.Property(entry => entry.MutationManifestHash)
 837            .HasMaxLength(256)
 838            .IsRequired();
 839        builder.Property(entry => entry.MutationManifestAlgorithm)
 840            .HasMaxLength(64)
 841            .IsRequired();
 842        builder.Property(entry => entry.MutationManifestSchemaVersion)
 843            .HasMaxLength(32)
 844            .IsRequired();
 845        builder.Property(entry => entry.OperationExecutionId).HasMaxLength(128);
 846        builder.Property(entry => entry.ExecutionAttemptId).HasMaxLength(128);
 847        builder.Property(entry => entry.DecisionAuditRecordId).HasMaxLength(128);
 848        builder.Property(entry => entry.CorrelationId).HasMaxLength(128);
 849        builder.Property(entry => entry.TraceId).HasMaxLength(64);
 850        builder.Property(entry => entry.Status)
 851            .HasMaxLength(32)
 852            .IsRequired();
 853        builder.Property(entry => entry.LastErrorCode).HasMaxLength(128);
 854        builder.Property(entry => entry.LastErrorMessage).HasMaxLength(512);
 55
 856        builder.HasIndex(entry => entry.IdempotencyKey).IsUnique();
 857        builder.HasIndex(entry => new { entry.Destination, entry.MutationBatchId }).IsUnique();
 858        builder.HasIndex(entry => new { entry.Status, entry.NextAttemptUtc });
 859        builder.HasIndex(entry => entry.CreatedUtc);
 860    }
 61}