< Summary - Heimdall API

Information
Class: ArturRios.Heimdall.Data.EntityMaps.RoleDbMap
Assembly: ArturRios.Heimdall.Data
File(s): /home/runner/work/heimdall-api/heimdall-api/src/Infrastructure/ArturRios.Heimdall.Data/EntityMaps/RoleDbMap.cs
Line coverage
100%
Covered lines: 8
Uncovered lines: 0
Coverable lines: 8
Total lines: 30
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/RoleDbMap.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 RoleDbMap
 8{
 9    public static void Configure(this EntityTypeBuilder<Role> role)
 10    {
 311        role.ToTable("role");
 12
 313        role.HasKey(x => x.Id);
 14
 15        // Role ids are assigned from the Roles enum by DatabaseSeeder (SystemAdmin = 1,
 16        // ScopeAdmin = 2, User = 3), not generated by the database. Roles are fixed reference data
 17        // (FR-RO-01), so there is no identity sequence left to drift out of step with the rows.
 318        role.Property(x => x.Id).ValueGeneratedNever();
 19
 320        role.Property(x => x.PublicId).IsRequired();
 321        role.HasIndex(x => x.PublicId).IsUnique();
 22
 323        role.Property(x => x.Name).IsRequired();
 24
 25        // Role name is unique — User | ScopeAdmin | SystemAdmin (§4.3).
 326        role.HasIndex(x => x.Name).IsUnique();
 27
 28        // The Person -> Role relationship is configured in PersonDbMap.
 329    }
 30}