< Summary - Heimdall API

Information
Class: ArturRios.Heimdall.Domain.Entities.ScopePermission
Assembly: ArturRios.Heimdall.Domain
File(s): /home/runner/work/heimdall-api/heimdall-api/src/Domain/ArturRios.Heimdall.Domain/Entities/ScopePermission.cs
Line coverage
100%
Covered lines: 9
Uncovered lines: 0
Coverable lines: 9
Total lines: 51
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage
100%
Covered methods: 9
Fully covered methods: 9
Total methods: 9
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_IncludeAsJwtClaim()100%11100%
get_IsDeleted()100%11100%
get_ScopeId()100%11100%
get_CreatedAt()100%11100%
get_UpdatedAt()100%11100%
get_Scope()100%11100%

File(s)

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

#LineLine coverage
 1using System.ComponentModel.DataAnnotations;
 2using ArturRios.Data.Relational.Core.Entities;
 3
 4namespace ArturRios.Heimdall.Domain.Entities;
 5
 6/// <summary>
 7///     A scope-specific permission that can be created, read, updated, and deleted within a
 8///     <see cref="Scope" />. The <see cref="IncludeAsJwtClaim" /> flag controls whether the
 9///     permission's <see cref="Name" /> is folded into the acting identity's JWT as a claim at
 10///     login. A scope's permissions are managed by that scope's owners or a System Admin.
 11/// </summary>
 12public class ScopePermission : Entity<long>
 13{
 14    /// <summary>
 15    ///     External identifier, generated on creation and used everywhere the permission is
 16    ///     addressed from outside the database (API paths, response bodies). The internal
 17    ///     <see cref="Entity{TKey}.Id" /> is never exposed to callers.
 18    /// </summary>
 56619    public Guid PublicId { get; set; } = Guid.NewGuid();
 20
 21    /// <summary>Permission display name. Required, max 200 characters.</summary>
 22    [MaxLength(200)]
 41023    public string Name { get; set; } = string.Empty;
 24
 25    /// <summary>Optional description of the permission's purpose. Max 500 characters.</summary>
 26    [MaxLength(500)]
 21827    public string? Description { get; set; }
 28
 29    /// <summary>
 30    ///     When <c>true</c>, this permission's <see cref="Name" /> is added as a claim on the JWT
 31    ///     issued to identities acting within the owning scope. Defaults to <c>false</c>.
 32    /// </summary>
 21633    public bool IncludeAsJwtClaim { get; set; }
 34
 35    /// <summary>Logical deletion flag. Logically deleted permissions are excluded from default queries.</summary>
 24636    public bool IsDeleted { get; set; }
 37
 38    /// <summary>Foreign key to the owning <see cref="Scope" /> (internal Id). Required.</summary>
 21439    public long ScopeId { get; set; }
 40
 41    /// <summary>Creation timestamp.</summary>
 10642    public DateTime CreatedAt { get; set; }
 43
 44    /// <summary>Last update timestamp.</summary>
 12845    public DateTime UpdatedAt { get; set; }
 46
 47    // Navigation properties
 48
 49    /// <summary>The scope this permission belongs to.</summary>
 14050    public Scope Scope { get; set; } = null!;
 51}