-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #724 from bcgov/DIAM-56-admin
Diam 56 admin
- Loading branch information
Showing
162 changed files
with
2,078 additions
and
8,942 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
namespace CommonModels.Models.DIAMAdmin; | ||
|
||
public enum AdminCommandSet | ||
{ | ||
PING, | ||
PARTY_REMOVE_REQUEST, | ||
PARTY_ACCESS_REQUEST_RESET, | ||
PARTY_ACCESS_REQUEST_REMOVE, | ||
SSO_USER_GROUP_ADD, | ||
SSO_USER_GROUP_REMOVE, | ||
SSO_GROUP_ADD, | ||
SSO_GROUP_DELETE, | ||
SSO_GROUP_CHILD_ADD, | ||
SSO_GROUP_CLIENT_ROLES_ADD, | ||
SSO_GROUP_CLIENT_ROLES_REMOVE, | ||
SSO_CLIENT_ADD, | ||
SSO_CLIENT_UPDATE | ||
|
||
|
||
} | ||
|
||
public static class AdminCommandSetExtensions | ||
{ | ||
public static string ToSnakeCase(this AdminCommandSet commandSet) => commandSet.ToString().ToLower().Replace('_', '-'); | ||
} |
24 changes: 24 additions & 0 deletions
24
backend/CommonModels/Models/DIAMAdmin/AdminRequestModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
namespace CommonModels.Models.DIAMAdmin; | ||
|
||
/// <summary> | ||
/// Represents a request for a service to take an admin action | ||
/// For instance this could represent a request to remove a users access to a service | ||
/// </summary> | ||
public class AdminRequestModel | ||
{ | ||
public string? TargetKafkaInstance { get; set; } | ||
public required string TargetEnvironment { get; set; } | ||
public required AdminCommandSet RequestType { get; set; } | ||
public required string Requestor { get; set; } | ||
public string? RequestorIPAddress { get; set; } | ||
public Dictionary<string, string> RequestData { get; set; } = []; | ||
public DateTime RequestDateTime { get; set; } | ||
|
||
} | ||
|
||
public class AdminRequestKey | ||
{ | ||
public required string Key { get; set; } | ||
public List<string> TargetServices { get; set; } = []; | ||
} | ||
|
22 changes: 22 additions & 0 deletions
22
backend/CommonModels/Models/DIAMAdmin/AdminRequestStatusModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
namespace CommonModels.Models.DIAMAdmin; | ||
|
||
|
||
public class AdminRequestStatusModel | ||
{ | ||
public int RequestId { get; set; } | ||
public string? Instance { get; set; } | ||
public string? KafkaInstance { get; set; } | ||
public required Guid MessageId { get; set; } | ||
public required string Requestor { get; set; } | ||
public required string RequestIPAddress { get; set; } | ||
public DateTime RequestTime { get; set; } = DateTime.UtcNow; | ||
public DateTime? DeliveredTime { get; set; } | ||
public DateTime? CompletedTime { get; set; } | ||
public string? Errors { get; set; } | ||
public required AdminCommandSet RequestType { get; set; } | ||
public string? Status { get; set; } | ||
public string? RequestData { get; set; } | ||
public string? ResponseData { get; set; } | ||
|
||
|
||
} |
17 changes: 17 additions & 0 deletions
17
backend/CommonModels/Models/DIAMAdmin/AdminResponseModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace CommonModels.Models.DIAMAdmin; | ||
|
||
/// <summary> | ||
/// When a service has picked up and processed an AdminRequest a response | ||
/// should be generated that contains response data | ||
/// </summary> | ||
public class AdminResponseModel | ||
{ | ||
public required Guid RequestId { get; set; } | ||
public DateTime RequestProcessDateTime { get; set; } | ||
public required string Hostname { get; set; } | ||
public AdminCommandSet RequestType { get; set; } | ||
public string? Errors { get; set; } | ||
public bool Success { get; set; } | ||
public Dictionary<string, string> ResponseData { get; set; } = []; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace CommonModels.Models.DIAMAdmin; | ||
|
||
|
||
public class AdminSignal | ||
{ | ||
public string Msg { get; set; } | ||
public AdminCommandSet Command { get; set; } | ||
public string UserId { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
namespace CommonModels.Models.DIAMAdmin; | ||
|
||
|
||
public class ChartDataModel | ||
{ | ||
public string DataName { get; set; } = "No name"; | ||
public List<ChartDataInstance> Data { get; set; } = []; | ||
|
||
|
||
public List<string> GetLabels() | ||
{ | ||
if (this.Data == null || this.Data.Count == 0) | ||
{ | ||
return []; | ||
} | ||
return [.. this.Data.Select(d => d.Label).Distinct().OrderBy(x => x)]; | ||
} | ||
|
||
public ChartDataInstance GetDataForLabel(string label) | ||
{ | ||
if (this.Data == null || this.Data.Count == 0 || !this.Data.Any(d => d.Label == label)) | ||
{ | ||
return new ChartDataInstance(); | ||
} | ||
return this.Data.FirstOrDefault(d => d.Label == label); | ||
} | ||
} | ||
|
||
public class ChartDataInstance | ||
{ | ||
public double Value { get; set; } | ||
public string Label { get; set; } = "No label"; | ||
public string Colour { get; set; } = string.Empty; | ||
} |
14 changes: 14 additions & 0 deletions
14
backend/CommonModels/Models/EDT/EdtDisclosureUserMergeUpdateModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace CommonModels.Models.EDT; | ||
|
||
|
||
/// <summary> | ||
/// Used to tell EDT Disclosure when a user should be added to a Folio as a result of a merge event | ||
/// </summary> | ||
public class EdtDisclosureUserMergeUpdateModel | ||
{ | ||
public string? Id { get; set; } | ||
public string? Key { get; set; } | ||
public string? UserName { get; set; } | ||
public int SourceDisclosureCaseId { get; set; } | ||
public int TargetDisclosureCaseId { get; set; } | ||
} |
27 changes: 27 additions & 0 deletions
27
backend/CommonModels/Models/JUSTIN/ParticipantMergeDetailModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
namespace CommonModels.Models.JUSTIN; | ||
|
||
using Common.Models.JUSTIN; | ||
using NodaTime; | ||
|
||
|
||
|
||
/// <summary> | ||
/// Represents two JUSTIN records merged together | ||
/// </summary> | ||
public class ParticipantMergeDetailModel | ||
{ | ||
public int MergeId { get; set; } | ||
public ParticipantType ParticipantType { get; set; } | ||
public Instant CreatedOn { get; set; } = Instant.FromDateTimeUtc(DateTime.UtcNow); | ||
public ParticipantDetail? SourceParticipant { get; set; } | ||
public ParticipantDetail? TargetParticipant { get; set; } | ||
|
||
} | ||
|
||
public enum ParticipantType | ||
{ | ||
ACCUSED, | ||
LEGALCOUNSEL, | ||
BCPSUSER | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace CommonModels.Models.Web; | ||
|
||
using System.Text.Json.Serialization; | ||
|
||
public class TreeNode | ||
{ | ||
public int Id { get; set; } | ||
public int ParentId { get; set; } | ||
public required string Name { get; set; } | ||
public string? InternalId { get; set; } | ||
public int Level { get; set; } | ||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | ||
public string? Icon { get; set; } | ||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] | ||
public List<TreeNode> Children { get; set; } = []; | ||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | ||
public string? ClassName { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
namespace CommonModels.Models.Web; | ||
|
||
using System.Text.Json.Serialization; | ||
|
||
/// <summary> | ||
/// Represents a tree of data | ||
/// </summary> | ||
public class WebTreeView : TreeNode | ||
{ | ||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | ||
public string? Path { get; set; } | ||
|
||
|
||
|
||
public bool Selected { get; set; } | ||
|
||
public bool Expanded { get; set; } | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.