Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(graphql): Add SystemLabel search filter #1767

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/schema/V1/schema.verified.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ input SearchDialogInput {
externalReference: String
"Filter by status"
status: [DialogStatus!]
"Filter by system label"
systemLabel: [SystemLabel!]
"Only return dialogs created after this date"
createdAfter: DateTime
"Only return dialogs created before this date"
Expand Down Expand Up @@ -456,4 +458,4 @@ scalar DateTime @specifiedBy(url: "https:\/\/www.graphql-scalars.com\/date-time"

scalar URL @specifiedBy(url: "https:\/\/tools.ietf.org\/html\/rfc3986")

scalar UUID @specifiedBy(url: "https:\/\/tools.ietf.org\/html\/rfc4122")
scalar UUID @specifiedBy(url: "https:\/\/tools.ietf.org\/html\/rfc4122")
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,10 @@ public enum DialogStatus
[GraphQLDescription("The dialogue was completed. This typically means that the dialogue is moved to a GUI archive or similar.")]
Completed = 6
}

public enum SystemLabel
{
Default = 1,
Bin = 2,
Archive = 3
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Digdir.Domain.Dialogporten.GraphQL.EndUser.Common;
using Digdir.Domain.Dialogporten.GraphQL.EndUser.MutationTypes;

namespace Digdir.Domain.Dialogporten.GraphQL.EndUser.DialogById;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using Digdir.Domain.Dialogporten.GraphQL.EndUser.Common;

namespace Digdir.Domain.Dialogporten.GraphQL.EndUser.MutationTypes;

public sealed class SetSystemLabelPayload
Expand All @@ -12,13 +14,6 @@ public sealed class SetSystemLabelInput
public SystemLabel Label { get; set; }
}

public enum SystemLabel
{
Default = 1,
Bin = 2,
Archive = 3
}

[InterfaceType("SetSystemLabelError")]
public interface ISetSystemLabelError
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public MappingProfile()
CreateMap<SearchDialogInput, SearchDialogQuery>()
.ForMember(dest => dest.OrderBy, opt => opt.Ignore())
.ForMember(dest => dest.ContinuationToken, opt => opt.Ignore())
.ForMember(dest => dest.SystemLabel, opt => opt.MapFrom(src => src.SystemLabel))
.ForMember(dest => dest.Status, opt => opt.MapFrom(src => src.Status));

CreateMap<PaginatedList<DialogDto>, SearchDialogsPayload>()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Digdir.Domain.Dialogporten.Application.Common.Pagination.Order;
using Digdir.Domain.Dialogporten.GraphQL.EndUser.Common;
using Digdir.Domain.Dialogporten.GraphQL.EndUser.MutationTypes;

namespace Digdir.Domain.Dialogporten.GraphQL.EndUser.SearchDialogs;

Expand Down Expand Up @@ -105,6 +104,9 @@ public sealed class SearchDialogInput
[GraphQLDescription("Filter by status")]
public List<DialogStatus>? Status { get; init; }

[GraphQLDescription("Filter by system label")]
public List<SystemLabel>? SystemLabel { get; init; }

[GraphQLDescription("Only return dialogs created after this date")]
public DateTimeOffset? CreatedAfter { get; init; }

Expand Down