From 553598437704704d95d30fb38ece0379334b076b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20J=C3=B8rgen=20Skogstad?= Date: Tue, 6 Feb 2024 15:53:48 +0100 Subject: [PATCH] --wip-- [skip ci] --- .../V1/EndUser/Dialogs/Queries/Search/MappingProfile.cs | 4 ++++ .../V1/EndUser/Dialogs/Queries/Search/SearchDialogDto.cs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/MappingProfile.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/MappingProfile.cs index 9a907fa31..3b842eb66 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/MappingProfile.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/MappingProfile.cs @@ -2,6 +2,7 @@ using Digdir.Domain.Dialogporten.Domain.Dialogs.Entities; using Digdir.Domain.Dialogporten.Domain.Dialogs.Entities.Activities; using Digdir.Domain.Dialogporten.Domain.Dialogs.Entities.Content; +using Digdir.Domain.Dialogporten.Domain.Dialogs.Entities.Elements; namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.Dialogs.Queries.Search; @@ -11,6 +12,9 @@ public MappingProfile() { CreateMap() .ForMember(dest => dest.LatestActivities, opt => opt.Ignore()) + .ForMember(dest => dest.GuiAttachmentCount, opt => + opt.MapFrom(src => src.Elements.Count(x => x.Urls + .Any(url => url.ConsumerTypeId == DialogElementUrlConsumerType.Values.Gui)))) .ForMember(dest => dest.Content, opt => opt.MapFrom(src => src.Content.Where(x => x.Type.OutputInList))) .ForMember(dest => dest.Status, opt => opt.MapFrom(src => src.StatusId)); diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/SearchDialogDto.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/SearchDialogDto.cs index 802f91aff..2f4ce1bc6 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/SearchDialogDto.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/SearchDialogDto.cs @@ -12,6 +12,7 @@ public sealed class SearchDialogDto public string ServiceResource { get; set; } = null!; public string Party { get; set; } = null!; public int? Progress { get; set; } + public int? GuiAttachmentCount { get; set; } public string? ExtendedStatus { get; set; } public DateTimeOffset CreatedAt { get; set; } public DateTimeOffset UpdatedAt { get; set; } @@ -21,7 +22,6 @@ public sealed class SearchDialogDto public List Content { get; set; } = []; public List LatestActivities { get; set; } = []; - } public sealed class SearchDialogContentDto