< Summary - Heimdall API

Information
Class: ArturRios.Heimdall.Data.EntityMaps.PasswordResetTokenDbMap
Assembly: ArturRios.Heimdall.Data
File(s): /home/runner/work/heimdall-api/heimdall-api/src/Infrastructure/ArturRios.Heimdall.Data/EntityMaps/PasswordResetTokenDbMap.cs
Line coverage
100%
Covered lines: 12
Uncovered lines: 0
Coverable lines: 12
Total lines: 29
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/PasswordResetTokenDbMap.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 PasswordResetTokenDbMap
 8{
 9    public static void Configure(this EntityTypeBuilder<PasswordResetToken> token)
 10    {
 311        token.ToTable("password_reset_token");
 12
 13        // Internal bigint Id only; no PublicId — the caller-facing reference is the Token string (§4.0).
 314        token.HasKey(x => x.Id);
 15
 316        token.Property(x => x.TokenHash).IsRequired();
 317        token.HasIndex(x => x.TokenHash).IsUnique();
 18
 319        token.Property(x => x.ExpiresAt).IsRequired();
 320        token.Property(x => x.Used).HasDefaultValue(false);
 21
 22        // Tokens are removed when their person is hard-deleted (UC-10).
 323        token.HasOne(x => x.Person)
 324            .WithMany(p => p.PasswordResetTokens)
 325            .HasForeignKey(x => x.PersonId)
 326            .IsRequired()
 327            .OnDelete(DeleteBehavior.Cascade);
 328    }
 29}