< Summary - Heimdall API

Information
Class: ArturRios.Heimdall.Data.EntityMaps.AuditLogDbMap
Assembly: ArturRios.Heimdall.Data
File(s): /home/runner/work/heimdall-api/heimdall-api/src/Infrastructure/ArturRios.Heimdall.Data/EntityMaps/AuditLogDbMap.cs
Line coverage
100%
Covered lines: 10
Uncovered lines: 0
Coverable lines: 10
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/AuditLogDbMap.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 AuditLogDbMap
 8{
 9    public static void Configure(this EntityTypeBuilder<AuditLog> auditLog)
 10    {
 311        auditLog.ToTable("audit_log");
 312        auditLog.HasKey(x => x.Id);
 13
 314        auditLog.Property(x => x.PublicId).IsRequired();
 315        auditLog.HasIndex(x => x.PublicId).IsUnique();
 316        auditLog.HasIndex(x => x.CreatedAt);
 317        auditLog.HasIndex(x => x.ActorPersonId);
 18
 19        // UC-48 filters by target ("what happened to this entity?"); without this that is a scan of
 20        // a table that only grows.
 321        auditLog.HasIndex(x => x.TargetId);
 22
 323        auditLog.Property(x => x.Action).IsRequired();
 324        auditLog.Property(x => x.CreatedAt).HasDefaultValueSql("now()");
 25
 26        // ActorPersonId/ActorRole/TargetId are plain nullable columns — no FK, no required navigation.
 327    }
 28}