diff --git a/services/Directory/FilterLists.Directory.Api/Controllers/ChangesController.cs b/services/Directory/FilterLists.Directory.Api/Controllers/ChangesController.cs index 281ea3a71..919fb314a 100644 --- a/services/Directory/FilterLists.Directory.Api/Controllers/ChangesController.cs +++ b/services/Directory/FilterLists.Directory.Api/Controllers/ChangesController.cs @@ -39,7 +39,7 @@ public Task Get(CancellationToken cancellationToken) [ProducesResponseType(StatusCodes.Status404NotFound)] public Task GetDetails(long id, CancellationToken cancellationToken) { - return CacheGetOrCreateAsync(() => _mediator.Send(new GetChange.Query(id), cancellationToken), id); + return CacheGetOrCreateAsync(() => _mediator.Send(new GetChange.Query { Id = id }, cancellationToken), id); } } diff --git a/services/Directory/FilterLists.Directory.Application/Queries/GetChange.cs b/services/Directory/FilterLists.Directory.Application/Queries/GetChange.cs index 65c2f34da..6b73d305e 100644 --- a/services/Directory/FilterLists.Directory.Application/Queries/GetChange.cs +++ b/services/Directory/FilterLists.Directory.Application/Queries/GetChange.cs @@ -11,7 +11,14 @@ namespace FilterLists.Directory.Application.Queries; public static class GetChange { - public record Query(long Id) : IRequest; + public record Query : IRequest + { + /// + /// The identifier of the change. + /// + /// 99 + public long Id { get; init; } + } internal class Handler : IRequestHandler { @@ -43,21 +50,102 @@ public ChangesVmProfile() public record ChangeVm { + /// + /// The identifier of the change. + /// + /// 99 public long Id { get; private init; } + + /// + /// The reason for the change. + /// + /// Adding EasyList because I did not see it on FilterLists.com yet. public string? Reason { get; private init; } + + /// + /// The time at which the change was submitted. + /// + /// 2021-11-26T20:42:36.022483Z public DateTime SubmittedAt { get; private init; } + + /// + /// The time at which the change was approved. + /// + /// 2021-11-28T22:43:34.022533Z public DateTime? ApprovedAt { get; private init; } + + /// + /// The time at which the change was rejected. + /// + /// null public DateTime? RejectedAt { get; private init; } + + /// + /// The reason that the change was rejected. + /// + /// null public string? RejectedReason { get; private init; } + + /// + /// The snapshot of the entity before this change. + /// + /// null public JsonDocument? Before { get; private init; } + + /// + /// The snapshot of the entity after this change. + /// + /// {"Name":"EasyList2","ChatUrl":null,"HomeUrl":"https://easylist.to/","ForumUrl":"https://forums.lanik.us/viewforum.php?f=23","OnionUrl":null,"DonateUrl":null,"IssuesUrl":"https://github.com/easylist/easylist/issues","LicenseId":4,"PolicyUrl":null,"ViewUrlIds":[0],"Description":"EasyList is the primary filter list that removes most adverts from international web pages, including unwanted frames, images, and objects. It is the most popular list used by many ad blockers and forms the basis of over a dozen combination and supplementary filter lists.","EmailAddress":"easylist@protonmail.com","SubmissionUrl":null} public JsonDocument? After { get; private init; } + + /// + /// The type of the entity being changed. + /// + /// + /// + /// public AggregateType AggregateType { get; private init; } + + /// + /// The identifier of the FilterList being changed. + /// + /// 3001 public long? FilterListId { get; private init; } + + /// + /// The identifier of the Language being changed. + /// + /// null public long? LanguageId { get; private init; } + + /// + /// The identifier of the License being changed. + /// + /// null public long? LicenseId { get; private init; } + + /// + /// The identifier of the Maintainer being changed. + /// + /// null public long? MaintainerId { get; private init; } + + /// + /// The identifier of the Software being changed. + /// + /// null public long? SoftwareId { get; private init; } + + /// + /// The identifier of the Syntax being changed. + /// + /// null public long? SyntaxId { get; private init; } + + /// + /// The identifier of the Tag being changed. + /// + /// null public long? TagId { get; private init; } } } diff --git a/services/Directory/FilterLists.Directory.Application/Queries/GetChanges.cs b/services/Directory/FilterLists.Directory.Application/Queries/GetChanges.cs index 4c2fd195e..4520e6760 100644 --- a/services/Directory/FilterLists.Directory.Application/Queries/GetChanges.cs +++ b/services/Directory/FilterLists.Directory.Application/Queries/GetChanges.cs @@ -44,21 +44,102 @@ public ChangesVmProfile() public record ChangeVm { + /// + /// The identifier of the change. + /// + /// 99 public long Id { get; private init; } + + /// + /// The reason for the change. + /// + /// Adding EasyList because I did not see it on FilterLists.com yet. public string? Reason { get; private init; } + + /// + /// The time at which the change was submitted. + /// + /// 2021-11-26T20:42:36.022483Z public DateTime SubmittedAt { get; private init; } + + /// + /// The time at which the change was approved. + /// + /// 2021-11-28T22:43:34.022533Z public DateTime? ApprovedAt { get; private init; } + + /// + /// The time at which the change was rejected. + /// + /// null public DateTime? RejectedAt { get; private init; } + + /// + /// The reason that the change was rejected. + /// + /// null public string? RejectedReason { get; private init; } + + /// + /// The snapshot of the entity before this change. + /// + /// null public JsonDocument? Before { get; private init; } + + /// + /// The snapshot of the entity after this change. + /// + /// {"Name":"EasyList2","ChatUrl":null,"HomeUrl":"https://easylist.to/","ForumUrl":"https://forums.lanik.us/viewforum.php?f=23","OnionUrl":null,"DonateUrl":null,"IssuesUrl":"https://github.com/easylist/easylist/issues","LicenseId":4,"PolicyUrl":null,"ViewUrlIds":[0],"Description":"EasyList is the primary filter list that removes most adverts from international web pages, including unwanted frames, images, and objects. It is the most popular list used by many ad blockers and forms the basis of over a dozen combination and supplementary filter lists.","EmailAddress":"easylist@protonmail.com","SubmissionUrl":null} public JsonDocument? After { get; private init; } + + /// + /// The type of the entity being changed. + /// + /// + /// + /// public AggregateType AggregateType { get; private init; } + + /// + /// The identifier of the FilterList being changed. + /// + /// 3001 public long? FilterListId { get; private init; } + + /// + /// The identifier of the Language being changed. + /// + /// null public long? LanguageId { get; private init; } + + /// + /// The identifier of the License being changed. + /// + /// null public long? LicenseId { get; private init; } + + /// + /// The identifier of the Maintainer being changed. + /// + /// null public long? MaintainerId { get; private init; } + + /// + /// The identifier of the Software being changed. + /// + /// null public long? SoftwareId { get; private init; } + + /// + /// The identifier of the Syntax being changed. + /// + /// null public long? SyntaxId { get; private init; } + + /// + /// The identifier of the Tag being changed. + /// + /// null public long? TagId { get; private init; } } }