Skip to content

Commit

Permalink
feat: Add element count to eu list dto (#414)
Browse files Browse the repository at this point in the history
#370 

Latest activities og progress er tatt i andre PRs
  • Loading branch information
oskogstad authored Feb 8, 2024
1 parent e38de0d commit 934fa93
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -11,6 +12,9 @@ public MappingProfile()
{
CreateMap<DialogEntity, SearchDialogDto>()
.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));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand All @@ -21,7 +22,6 @@ public sealed class SearchDialogDto

public List<SearchDialogContentDto> Content { get; set; } = [];
public List<SearchDialogDialogActivityDto> LatestActivities { get; set; } = [];

}

public sealed class SearchDialogContentDto
Expand Down

0 comments on commit 934fa93

Please sign in to comment.