< Summary - Heimdall API

Information
Class: ArturRios.Heimdall.Data.EntityMaps.AttemptNoticeBudgetDbMap
Assembly: ArturRios.Heimdall.Data
File(s): /home/runner/work/heimdall-api/heimdall-api/src/Infrastructure/ArturRios.Heimdall.Data/EntityMaps/AttemptNoticeBudgetDbMap.cs
Line coverage
100%
Covered lines: 8
Uncovered lines: 0
Coverable lines: 8
Total lines: 26
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/AttemptNoticeBudgetDbMap.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 AttemptNoticeBudgetDbMap
 8{
 9    public static void Configure(this EntityTypeBuilder<AttemptNoticeBudget> budget)
 10    {
 311        budget.ToTable("attempt_notice_budget");
 12
 13        // Internal bigint Id, never exposed (NFR-15): the row is reached by its address digest only.
 314        budget.HasKey(x => x.Id);
 15
 16        // One row per address. The charge's INSERT … ON CONFLICT (address_hash) relies on this index.
 317        budget.Property(x => x.AddressHash).IsRequired().HasMaxLength(64);
 318        budget.HasIndex(x => x.AddressHash).IsUnique();
 19
 320        budget.Property(x => x.NoticesSent).IsRequired();
 321        budget.Property(x => x.WindowEndsAt).IsRequired();
 22
 23        // The purge reads budgets whose window ended before the grace period.
 324        budget.HasIndex(x => x.WindowEndsAt);
 325    }
 26}