< Summary - Heimdall API

Information
Class: ArturRios.Heimdall.Data.EntityMaps.ErasedSubjectDbMap
Assembly: ArturRios.Heimdall.Data
File(s): /home/runner/work/heimdall-api/heimdall-api/src/Infrastructure/ArturRios.Heimdall.Data/EntityMaps/ErasedSubjectDbMap.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 28
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage
100%
Covered methods: 1
Fully covered methods: 1
Total methods: 1
Method coverage: 100%
Full method coverage: 100%

Metrics

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

File(s)

/home/runner/work/heimdall-api/heimdall-api/src/Infrastructure/ArturRios.Heimdall.Data/EntityMaps/ErasedSubjectDbMap.cs

#LineLine coverage
 1using ArturRios.Heimdall.Domain.Entities;
 2using Microsoft.EntityFrameworkCore;
 3using Microsoft.EntityFrameworkCore.Metadata.Builders;
 4
 5namespace ArturRios.Heimdall.Data.EntityMaps;
 6
 7internal static class ErasedSubjectDbMap
 8{
 9    public static void Configure(this EntityTypeBuilder<ErasedSubject> erasedSubject)
 10    {
 311        erasedSubject.ToTable("erased_subject");
 12
 13        // The key is the removed identity's PublicId (#195): the trail's target_id is looked up here
 14        // directly, and an id can be tombstoned only once. Never generated — it is copied from the
 15        // row being deleted.
 316        erasedSubject.HasKey(x => x.Id);
 317        erasedSubject.Property(x => x.Id).HasColumnName("public_id").ValueGeneratedNever();
 18
 319        erasedSubject.Property(x => x.Kind).IsRequired();
 320        erasedSubject.Property(x => x.CreatedAt).HasDefaultValueSql("now()");
 21
 22        // The pass's cleanup reads tombstones older than the grace period.
 323        erasedSubject.HasIndex(x => x.CreatedAt);
 24
 25        // No foreign key to person or google_user: the row it names is about to be deleted, and the
 26        // tombstone has to outlive it.
 327    }
 28}