< Summary - Heimdall API

Information
Class: ArturRios.Heimdall.Domain.Entities.Role
Assembly: ArturRios.Heimdall.Domain
File(s): /home/runner/work/heimdall-api/heimdall-api/src/Domain/ArturRios.Heimdall.Domain/Entities/Role.cs
Line coverage
100%
Covered lines: 4
Uncovered lines: 0
Coverable lines: 4
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: 4
Fully covered methods: 4
Total methods: 4
Method coverage: 100%
Full method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_PublicId()100%11100%
get_Name()100%11100%
get_Description()100%11100%
get_Persons()100%11100%

File(s)

/home/runner/work/heimdall-api/heimdall-api/src/Domain/ArturRios.Heimdall.Domain/Entities/Role.cs

#LineLine coverage
 1using System.ComponentModel.DataAnnotations;
 2using ArturRios.Data.Relational.Core.Entities;
 3
 4namespace ArturRios.Heimdall.Domain.Entities;
 5
 6/// <summary>
 7///     A named permission level referenced by a <see cref="Person" /> via its <c>RoleId</c>.
 8///     The name is one of <c>User</c>, <c>ScopeAdmin</c>, or <c>SystemAdmin</c>.
 9/// </summary>
 10public class Role : Entity<long>
 11{
 12    /// <summary>
 13    ///     External identifier, generated on creation and used everywhere the role is addressed
 14    ///     from outside the database. The internal <see cref="Entity{TKey}.Id" /> is never exposed to callers.
 15    /// </summary>
 270616    public Guid PublicId { get; set; } = Guid.NewGuid();
 17
 18    /// <summary>Role name. Required, unique — <c>User</c>, <c>ScopeAdmin</c>, or <c>SystemAdmin</c>.</summary>
 19    [MaxLength(200)]
 541220    public string Name { get; set; } = string.Empty;
 21
 22    /// <summary>Optional human-readable explanation of the role's purpose and permissions.</summary>
 23    [MaxLength(500)]
 270624    public string? Description { get; set; }
 25
 26    // Navigation properties
 27
 28    /// <summary>Persons classified by this role.</summary>
 270629    public ICollection<Person> Persons { get; set; } = new List<Person>();
 30}