< Summary

Information
Class: RoleRadar.Domain.Audit.AuditDetails
Assembly: RoleRadar.Domain
File(s): /home/runner/work/roleradar/roleradar/src/RoleRadar.Domain/Audit/AuditDetails.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 22
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
get_ChangedFields()100%11100%
get_Before()100%11100%
get_After()100%11100%
get_ContactId()100%11100%
ForContact(...)100%11100%
ForEntity(...)100%11100%

File(s)

/home/runner/work/roleradar/roleradar/src/RoleRadar.Domain/Audit/AuditDetails.cs

#LineLine coverage
 1namespace RoleRadar.Domain.Audit;
 2
 3/// <summary>
 4/// Structured summary of changes recorded in an audit log entry for tracking entities.
 5/// For contact entities, strictly contains changed field names and contact ID with zero personal details.
 6/// For other tracking entities, contains changed field names and optional non-sensitive before/after snapshots.
 7/// </summary>
 43668public sealed record AuditDetails(
 8109    IReadOnlyList<string> ChangedFields,
 102010    IReadOnlyDictionary<string, object?>? Before = null,
 241211    IReadOnlyDictionary<string, object?>? After = null,
 518812    Guid? ContactId = null)
 13{
 14    public static AuditDetails ForContact(Guid contactId, IReadOnlyList<string> changedFields) =>
 1215        new(changedFields, ContactId: contactId);
 16
 17    public static AuditDetails ForEntity(
 18        IReadOnlyList<string> changedFields,
 19        IReadOnlyDictionary<string, object?>? before = null,
 20        IReadOnlyDictionary<string, object?>? after = null) =>
 372821        new(changedFields, Before: before, After: after);
 22}