-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMutationApprovalQuery.cs
More file actions
71 lines (61 loc) · 2.41 KB
/
Copy pathMutationApprovalQuery.cs
File metadata and controls
71 lines (61 loc) · 2.41 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
61
62
63
64
65
66
67
68
69
70
71
using ModularityKit.Mutator.Governance.Abstractions.Approval.Model;
using ModularityKit.Mutator.Governance.Abstractions.Lifecycle.Model;
namespace ModularityKit.Mutator.Governance.Abstractions.Queries.Model;
/// <summary>
/// Defines storage-agnostic filters for approval-oriented governance queries.
/// </summary>
public sealed record MutationApprovalQuery
{
/// <summary>
/// Request-level filters applied before approval requirements are projected.
/// </summary>
public MutationRequestQuery RequestQuery { get; init; } = new();
/// <summary>
/// Request categories to include.
/// </summary>
public IReadOnlySet<string> Categories { get; init; } = new HashSet<string>();
/// <summary>
/// Allowed approver identifiers.
/// </summary>
public IReadOnlySet<string> ApproverIds { get; init; } = new HashSet<string>();
/// <summary>
/// Allowed approver roles.
/// </summary>
public IReadOnlySet<string> ApproverRoles { get; init; } = new HashSet<string>();
/// <summary>
/// Allowed approver groups.
/// </summary>
public IReadOnlySet<string> ApproverGroups { get; init; } = new HashSet<string>();
/// <summary>
/// Allowed approval requirement statuses.
/// </summary>
public IReadOnlySet<MutationApprovalRequirementStatus> ApprovalStatuses { get; init; }
= new HashSet<MutationApprovalRequirementStatus>();
/// <summary>
/// Allowed pending reasons for the parent request.
/// </summary>
public IReadOnlySet<PendingMutationReason> PendingReasons { get; init; } = new HashSet<PendingMutationReason>();
/// <summary>
/// Allowed request statuses for the parent request.
/// </summary>
public IReadOnlySet<MutationRequestStatus> RequestStatuses { get; init; } = new HashSet<MutationRequestStatus>();
/// <summary>
/// Creates a query for pending approval work.
/// </summary>
public static MutationApprovalQuery Pending()
=> new()
{
ApprovalStatuses = new HashSet<MutationApprovalRequirementStatus>
{
MutationApprovalRequirementStatus.Pending
},
RequestStatuses = new HashSet<MutationRequestStatus>
{
MutationRequestStatus.Pending
},
PendingReasons = new HashSet<PendingMutationReason>
{
PendingMutationReason.Approval
}
};
}