< 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    {
 516        builder.ToTable("ApplicationAuditCompletionOutbox");
 17
 518        builder.HasKey(entry => entry.Id);
 519        builder.Property(entry => entry.Id).ValueGeneratedNever();
 20
 521        builder.Property(entry => entry.SchemaVersion)
 522            .HasMaxLength(32)
 523            .IsRequired();
 524        builder.Property(entry => entry.Destination)
 525            .HasMaxLength(128)
 526            .IsRequired();
 527        builder.Property(entry => entry.IdempotencyKey)
 528            .HasMaxLength(128)
 529            .IsRequired();
 530        builder.Property(entry => entry.MutationBatchId)
 531            .HasMaxLength(64)
 532            .IsRequired();
 533        builder.Property(entry => entry.PersistenceOutcome)
 534            .HasMaxLength(64)
 535            .IsRequired();
 536        builder.Property(entry => entry.MutationManifestHash)
 537            .HasMaxLength(256)
 538            .IsRequired();
 539        builder.Property(entry => entry.MutationManifestAlgorithm)
 540            .HasMaxLength(64)
 541            .IsRequired();
 542        builder.Property(entry => entry.MutationManifestSchemaVersion)
 543            .HasMaxLength(32)
 544            .IsRequired();
 545        builder.Property(entry => entry.OperationExecutionId).HasMaxLength(128);
 546        builder.Property(entry => entry.ExecutionAttemptId).HasMaxLength(128);
 547        builder.Property(entry => entry.DecisionAuditRecordId).HasMaxLength(128);
 548        builder.Property(entry => entry.CorrelationId).HasMaxLength(128);
 549        builder.Property(entry => entry.TraceId).HasMaxLength(64);
 550        builder.Property(entry => entry.Status)
 551            .HasMaxLength(32)
 552            .IsRequired();
 553        builder.Property(entry => entry.LastErrorCode).HasMaxLength(128);
 554        builder.Property(entry => entry.LastErrorMessage).HasMaxLength(512);
 55
 556        builder.HasIndex(entry => entry.IdempotencyKey).IsUnique();
 557        builder.HasIndex(entry => new { entry.Destination, entry.MutationBatchId }).IsUnique();
 558        builder.HasIndex(entry => new { entry.Status, entry.NextAttemptUtc });
 559        builder.HasIndex(entry => entry.CreatedUtc);
 560    }
 61}