-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAnalyticsEvent.cs
More file actions
60 lines (43 loc) · 1.8 KB
/
Copy pathAnalyticsEvent.cs
File metadata and controls
60 lines (43 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using System.ComponentModel;
using System.Text.Json.Serialization;
namespace Defra.WasteObligations.AuditEvents.Analytics;
public record AnalyticsEvent
{
[JsonPropertyName("eventId")]
public required string EventId { get; init; }
[JsonPropertyName("sequence")]
public long Sequence { get; init; }
[JsonPropertyName("entity")]
public required string Entity { get; init; }
[JsonPropertyName("entityId")]
public required string EntityId { get; init; }
[JsonPropertyName("operation")]
public required string Operation { get; init; }
[JsonPropertyName("eventType")]
public required string EventType { get; init; }
[JsonPropertyName("deletedReason")]
public string? DeletedReason { get; init; }
[JsonPropertyName("piiKeyRef")]
public string? PiiKeyRef { get; init; }
[Description("UTC ISO 8601 format with millisecond precision")]
[JsonConverter(typeof(UtcMillisecondDateTimeOffsetJsonConverter))]
[JsonPropertyName("occurredAt")]
public DateTimeOffset OccurredAt { get; init; }
[Description("UTC ISO 8601 format with millisecond precision")]
[JsonConverter(typeof(UtcMillisecondDateTimeOffsetJsonConverter))]
[JsonPropertyName("recordedAt")]
public DateTimeOffset RecordedAt { get; init; }
[JsonPropertyName("actor")]
public required string Actor { get; init; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("correlationId")]
public string? CorrelationId { get; init; }
[JsonPropertyName("version")]
public int Version { get; init; }
[JsonPropertyName("before")]
public object? Before { get; init; }
[JsonPropertyName("after")]
public object? After { get; init; }
[JsonPropertyName("schemaVersion")]
public required string SchemaVersion { get; init; }
}