| | | 1 | | namespace 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> |
| | 4366 | 8 | | public sealed record AuditDetails( |
| | 810 | 9 | | IReadOnlyList<string> ChangedFields, |
| | 1020 | 10 | | IReadOnlyDictionary<string, object?>? Before = null, |
| | 2412 | 11 | | IReadOnlyDictionary<string, object?>? After = null, |
| | 5188 | 12 | | Guid? ContactId = null) |
| | | 13 | | { |
| | | 14 | | public static AuditDetails ForContact(Guid contactId, IReadOnlyList<string> changedFields) => |
| | 12 | 15 | | 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) => |
| | 3728 | 21 | | new(changedFields, Before: before, After: after); |
| | | 22 | | } |