1+ using System . Text . Json . Serialization ;
12using ModularityKit . Mutator . Abstractions . Context ;
23using ModularityKit . Mutator . Abstractions . Effects ;
34using ModularityKit . Mutator . Abstractions . Intent ;
@@ -19,45 +20,25 @@ public sealed record MutationRequest
1920 public string RequestId { get ; init ; } = Guid . NewGuid ( ) . ToString ( ) ;
2021
2122 /// <summary>
22- /// Identifier of the state targeted by this request.
23+ /// Target scope details for the governed request.
2324 /// </summary>
24- public string StateId { get ; init ; } = string . Empty ;
25+ public MutationRequestScopeDetails Scope { get ; init ; } = new ( ) ;
2526
2627 /// <summary>
27- /// Logical state type targeted by the request.
28+ /// Submitted mutation payload details for the governed request.
2829 /// </summary>
29- public string StateType { get ; init ; } = string . Empty ;
30+ public MutationRequestPayloadDetails Payload { get ; init ; } = new ( ) ;
3031
3132 /// <summary>
32- /// CLR type name of the underlying mutation .
33+ /// Lifecycle state and lifecycle timestamps associated with the request .
3334 /// </summary>
34- public string MutationType { get ; init ; } = string . Empty ;
35-
36- /// <summary>
37- /// Intent associated with the requested mutation.
38- /// </summary>
39- public MutationIntent Intent { get ; init ; } = null ! ;
40-
41- /// <summary>
42- /// Request context describing who requested the mutation and why.
43- /// </summary>
44- public MutationContext Context { get ; init ; } = null ! ;
35+ public MutationRequestLifecycleDetails Lifecycle { get ; init ; } = new ( ) ;
4536
4637 /// <summary>
4738 /// Governed execution-specific details associated with this request.
4839 /// </summary>
4940 public GovernedExecutionDetails Execution { get ; init ; } = new ( ) ;
5041
51- /// <summary>
52- /// Current lifecycle status of the request.
53- /// </summary>
54- public MutationRequestStatus Status { get ; init ; } = MutationRequestStatus . Created ;
55-
56- /// <summary>
57- /// Reason why the request is pending, if it has not executed yet.
58- /// </summary>
59- public PendingMutationReason ? PendingReason { get ; init ; }
60-
6142 /// <summary>
6243 /// Requirements that must be fulfilled before execution may proceed.
6344 /// </summary>
@@ -89,22 +70,37 @@ public sealed record MutationRequest
8970 public MutationRequestVersioningDetails Versioning { get ; init ; } = new ( ) ;
9071
9172 /// <summary>
92- /// Optional expiration time for pending requests .
73+ /// Additional governance metadata carried by the request .
9374 /// </summary>
94- public DateTimeOffset ? ExpiresAt { get ; init ; }
75+ public IReadOnlyDictionary < string , object > Metadata { get ; init ; } = new Dictionary < string , object > ( ) ;
9576
96- /// <summary>
97- /// Timestamp when the request was first created.
98- /// </summary>
99- public DateTimeOffset CreatedAt { get ; init ; } = DateTimeOffset . UtcNow ;
77+ [ JsonIgnore ]
78+ public string StateId => Scope . StateId ;
10079
101- /// <summary>
102- /// Timestamp of the last lifecycle update applied to the request.
103- /// </summary>
104- public DateTimeOffset UpdatedAt { get ; init ; } = DateTimeOffset . UtcNow ;
80+ [ JsonIgnore ]
81+ public string StateType => Scope . StateType ;
10582
106- /// <summary>
107- /// Additional governance metadata carried by the request.
108- /// </summary>
109- public IReadOnlyDictionary < string , object > Metadata { get ; init ; } = new Dictionary < string , object > ( ) ;
83+ [ JsonIgnore ]
84+ public string MutationType => Scope . MutationType ;
85+
86+ [ JsonIgnore ]
87+ public MutationIntent Intent => Payload . Intent ;
88+
89+ [ JsonIgnore ]
90+ public MutationContext Context => Payload . Context ;
91+
92+ [ JsonIgnore ]
93+ public MutationRequestStatus Status => Lifecycle . Status ;
94+
95+ [ JsonIgnore ]
96+ public PendingMutationReason ? PendingReason => Lifecycle . PendingReason ;
97+
98+ [ JsonIgnore ]
99+ public DateTimeOffset ? ExpiresAt => Lifecycle . ExpiresAt ;
100+
101+ [ JsonIgnore ]
102+ public DateTimeOffset CreatedAt => Lifecycle . CreatedAt ;
103+
104+ [ JsonIgnore ]
105+ public DateTimeOffset UpdatedAt => Lifecycle . UpdatedAt ;
110106}
0 commit comments