< Summary

Information
Class: AsiBackbone.EntityFrameworkCore.Configurations.AsiBackboneGovernanceOutboxEntryEntityConfiguration
Assembly: AsiBackbone.EntityFrameworkCore
File(s): /home/runner/work/AsiBackbone/AsiBackbone/src/AsiBackbone.EntityFrameworkCore/Configurations/AsiBackboneGovernanceOutboxEntryEntityConfiguration.cs
Line coverage
100%
Covered lines: 135
Uncovered lines: 0
Coverable lines: 135
Total lines: 230
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/AsiBackbone/AsiBackbone/src/AsiBackbone.EntityFrameworkCore/Configurations/AsiBackboneGovernanceOutboxEntryEntityConfiguration.cs

#LineLine coverage
 1using AsiBackbone.EntityFrameworkCore.Persistence;
 2using Microsoft.EntityFrameworkCore;
 3using Microsoft.EntityFrameworkCore.Metadata.Builders;
 4
 5namespace AsiBackbone.EntityFrameworkCore.Configurations;
 6
 7/// <summary>
 8/// Configures the Entity Framework Core persistence mapping for <see cref="AsiBackboneGovernanceOutboxEntryEntity" />.
 9/// </summary>
 10public sealed class AsiBackboneGovernanceOutboxEntryEntityConfiguration
 11    : IEntityTypeConfiguration<AsiBackboneGovernanceOutboxEntryEntity>
 12{
 13    private const int IdentifierMaxLength = 128;
 14    private const int SchemaVersionMaxLength = 64;
 15    private const int StatusMaxLength = 128;
 16    private const int ProviderMaxLength = 128;
 17    private const int ErrorCodeMaxLength = 128;
 18    private const int ProviderErrorCodeMaxLength = 128;
 19    private const int StageMaxLength = 128;
 20    private const int OperationNameMaxLength = 256;
 21    private const int OutcomeMaxLength = 128;
 22    private const int PolicyVersionMaxLength = 128;
 23    private const int HashMaxLength = 512;
 24    private const int ContentTypeMaxLength = 256;
 25    private const int PayloadTypeMaxLength = 128;
 26    private const int ConcurrencyStampMaxLength = 64;
 27
 28    /// <inheritdoc />
 29    public void Configure(EntityTypeBuilder<AsiBackboneGovernanceOutboxEntryEntity> builder)
 30    {
 2231        ArgumentNullException.ThrowIfNull(builder);
 32
 2233        _ = builder.ToTable("AsiBackboneGovernanceOutboxEntries");
 34
 2235        _ = builder.HasKey(outboxEntry => outboxEntry.Id);
 36
 2237        _ = builder.Property(outboxEntry => outboxEntry.Id)
 2238            .ValueGeneratedNever();
 39
 2240        _ = builder.Property(outboxEntry => outboxEntry.ConcurrencyStamp)
 2241            .IsRequired()
 2242            .HasMaxLength(ConcurrencyStampMaxLength)
 2243            .IsConcurrencyToken();
 44
 2245        _ = builder.Property(outboxEntry => outboxEntry.OutboxEntryId)
 2246            .IsRequired()
 2247            .HasMaxLength(IdentifierMaxLength);
 48
 2249        _ = builder.Property(outboxEntry => outboxEntry.Status)
 2250            .HasConversion<string>()
 2251            .IsRequired()
 2252            .HasMaxLength(StatusMaxLength);
 53
 2254        _ = builder.Property(outboxEntry => outboxEntry.CreatedUtc)
 2255            .IsRequired();
 56
 2257        _ = builder.Property(outboxEntry => outboxEntry.UpdatedUtc)
 2258            .IsRequired();
 59
 2260        _ = builder.Property(outboxEntry => outboxEntry.RetryCount)
 2261            .IsRequired();
 62
 2263        _ = builder.Property(outboxEntry => outboxEntry.MaxRetryCount)
 2264            .IsRequired();
 65
 2266        _ = builder.Property(outboxEntry => outboxEntry.ProviderName)
 2267            .HasMaxLength(ProviderMaxLength);
 68
 2269        _ = builder.Property(outboxEntry => outboxEntry.ProviderRecordId)
 2270            .HasMaxLength(IdentifierMaxLength);
 71
 2272        _ = builder.Property(outboxEntry => outboxEntry.LastErrorCode)
 2273            .HasMaxLength(ErrorCodeMaxLength);
 74
 2275        _ = builder.Property(outboxEntry => outboxEntry.LastErrorProviderName)
 2276            .HasMaxLength(ProviderMaxLength);
 77
 2278        _ = builder.Property(outboxEntry => outboxEntry.LastErrorProviderErrorCode)
 2279            .HasMaxLength(ProviderErrorCodeMaxLength);
 80
 2281        _ = builder.Property(outboxEntry => outboxEntry.MetadataJson)
 2282            .IsRequired();
 83
 2284        _ = builder.Property(outboxEntry => outboxEntry.EnvelopeId)
 2285            .IsRequired()
 2286            .HasMaxLength(IdentifierMaxLength);
 87
 2288        _ = builder.Property(outboxEntry => outboxEntry.EnvelopeSchemaVersion)
 2289            .IsRequired()
 2290            .HasMaxLength(SchemaVersionMaxLength);
 91
 2292        _ = builder.Property(outboxEntry => outboxEntry.EnvelopeEventType)
 2293            .HasConversion<string>()
 2294            .IsRequired()
 2295            .HasMaxLength(StatusMaxLength);
 96
 2297        _ = builder.Property(outboxEntry => outboxEntry.EnvelopeEventId)
 2298            .HasMaxLength(IdentifierMaxLength);
 99
 22100        _ = builder.Property(outboxEntry => outboxEntry.EnvelopeOccurredUtc)
 22101            .IsRequired();
 102
 22103        _ = builder.Property(outboxEntry => outboxEntry.EnvelopeCreatedUtc)
 22104            .IsRequired();
 105
 22106        _ = builder.Property(outboxEntry => outboxEntry.EnvelopeCorrelationId)
 22107            .HasMaxLength(IdentifierMaxLength);
 108
 22109        _ = builder.Property(outboxEntry => outboxEntry.EnvelopeAuditResidueId)
 22110            .HasMaxLength(IdentifierMaxLength);
 111
 22112        _ = builder.Property(outboxEntry => outboxEntry.EnvelopeLifecycleStage)
 22113            .HasConversion<string>()
 22114            .HasMaxLength(StageMaxLength);
 115
 22116        _ = builder.Property(outboxEntry => outboxEntry.EnvelopePolicyVersion)
 22117            .HasMaxLength(PolicyVersionMaxLength);
 118
 22119        _ = builder.Property(outboxEntry => outboxEntry.EnvelopePolicyHash)
 22120            .HasMaxLength(HashMaxLength);
 121
 22122        _ = builder.Property(outboxEntry => outboxEntry.EnvelopeTraceId)
 22123            .HasMaxLength(IdentifierMaxLength);
 124
 22125        _ = builder.Property(outboxEntry => outboxEntry.EnvelopeSpanId)
 22126            .HasMaxLength(IdentifierMaxLength);
 127
 22128        _ = builder.Property(outboxEntry => outboxEntry.EnvelopeParentSpanId)
 22129            .HasMaxLength(IdentifierMaxLength);
 130
 22131        _ = builder.Property(outboxEntry => outboxEntry.EnvelopeOperationName)
 22132            .HasMaxLength(OperationNameMaxLength);
 133
 22134        _ = builder.Property(outboxEntry => outboxEntry.EnvelopeOutcome)
 22135            .HasMaxLength(OutcomeMaxLength);
 136
 22137        _ = builder.Property(outboxEntry => outboxEntry.EnvelopeActorId)
 22138            .HasMaxLength(IdentifierMaxLength);
 139
 22140        _ = builder.Property(outboxEntry => outboxEntry.EnvelopeEmitterStatus)
 22141            .HasMaxLength(StatusMaxLength);
 142
 22143        _ = builder.Property(outboxEntry => outboxEntry.EnvelopeEmitterProvider)
 22144            .HasMaxLength(ProviderMaxLength);
 145
 22146        _ = builder.Property(outboxEntry => outboxEntry.EnvelopeGatewayExecutionId)
 22147            .HasMaxLength(IdentifierMaxLength);
 148
 22149        _ = builder.Property(outboxEntry => outboxEntry.EnvelopeDecisionStage)
 22150            .HasMaxLength(StageMaxLength);
 151
 22152        _ = builder.Property(outboxEntry => outboxEntry.EnvelopeMetadataJson)
 22153            .IsRequired();
 154
 22155        _ = builder.Property(outboxEntry => outboxEntry.EnvelopePayloadType)
 22156            .HasMaxLength(PayloadTypeMaxLength);
 157
 22158        _ = builder.Property(outboxEntry => outboxEntry.EnvelopePayloadSchemaVersion)
 22159            .HasMaxLength(SchemaVersionMaxLength);
 160
 22161        _ = builder.Property(outboxEntry => outboxEntry.EnvelopePayloadContentType)
 22162            .HasMaxLength(ContentTypeMaxLength);
 163
 22164        _ = builder.Property(outboxEntry => outboxEntry.EnvelopePayloadContentHash)
 22165            .HasMaxLength(HashMaxLength);
 166
 22167        _ = builder.Property(outboxEntry => outboxEntry.EnvelopePayloadMetadataJson)
 22168            .IsRequired();
 169
 22170        _ = builder.HasIndex(outboxEntry => outboxEntry.OutboxEntryId)
 22171            .IsUnique();
 172
 22173        _ = builder.HasIndex(outboxEntry => outboxEntry.Status);
 174
 22175        _ = builder.HasIndex(outboxEntry => outboxEntry.NextRetryUtc);
 176
 22177        _ = builder.HasIndex(outboxEntry => outboxEntry.CreatedUtc);
 178
 22179        _ = builder.HasIndex(outboxEntry => outboxEntry.UpdatedUtc);
 180
 22181        _ = builder.HasIndex(outboxEntry => outboxEntry.DeliveredUtc);
 182
 22183        _ = builder.HasIndex(outboxEntry => outboxEntry.ProviderName);
 184
 22185        _ = builder.HasIndex(outboxEntry => outboxEntry.ProviderRecordId);
 186
 22187        _ = builder.HasIndex(outboxEntry => outboxEntry.LastErrorCode);
 188
 22189        _ = builder.HasIndex(outboxEntry => outboxEntry.EnvelopeId);
 190
 22191        _ = builder.HasIndex(outboxEntry => outboxEntry.EnvelopeEventId);
 192
 22193        _ = builder.HasIndex(outboxEntry => outboxEntry.EnvelopeCorrelationId);
 194
 22195        _ = builder.HasIndex(outboxEntry => outboxEntry.EnvelopeAuditResidueId);
 196
 22197        _ = builder.HasIndex(outboxEntry => outboxEntry.EnvelopePolicyVersion);
 198
 22199        _ = builder.HasIndex(outboxEntry => outboxEntry.EnvelopePolicyHash);
 200
 22201        _ = builder.HasIndex(outboxEntry => outboxEntry.EnvelopeTraceId);
 202
 22203        _ = builder.HasIndex(outboxEntry => outboxEntry.EnvelopeOutboxSequence);
 204
 22205        _ = builder.HasIndex(outboxEntry => new
 22206        {
 22207            outboxEntry.Status,
 22208            outboxEntry.NextRetryUtc,
 22209            outboxEntry.UpdatedUtc
 22210        });
 211
 22212        _ = builder.HasIndex(outboxEntry => new
 22213        {
 22214            outboxEntry.Status,
 22215            outboxEntry.CreatedUtc
 22216        });
 217
 22218        _ = builder.HasIndex(outboxEntry => new
 22219        {
 22220            outboxEntry.EnvelopeCorrelationId,
 22221            outboxEntry.CreatedUtc
 22222        });
 223
 22224        _ = builder.HasIndex(outboxEntry => new
 22225        {
 22226            outboxEntry.EnvelopeAuditResidueId,
 22227            outboxEntry.CreatedUtc
 22228        });
 22229    }
 230}