From 74219621a5dfadce039ec89be3132b308516ed99 Mon Sep 17 00:00:00 2001 From: Amund Myrbostad Date: Thu, 3 Oct 2024 10:33:38 +0200 Subject: [PATCH] cleanup --- .../Queries/Search/MappingProfile.cs | 1 - .../Commands/Set/SetDialogSystemLabelCommand.cs | 12 ++++++------ .../Commands/Set/SetDialogSystemLabelDto.cs | 1 - .../Dialogs/Commands/Update/UpdateDialogCommand.cs | 14 +++++++------- .../SearchDialogLabelAssignmentLogEndpoint.cs} | 7 +++---- .../SearchDialogLabelAssignmentSwaggerConfig.cs | 2 +- 6 files changed, 17 insertions(+), 20 deletions(-) rename src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/{DialogLabelAssigmentLogs/Search/SearchDialogLabelAssigmentLogEndpoint.cs => DialogLabelAssignmentLogs/Search/SearchDialogLabelAssignmentLogEndpoint.cs} (79%) rename src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/{DialogLabelAssigmentLogs => DialogLabelAssignmentLogs}/Search/SearchDialogLabelAssignmentSwaggerConfig.cs (95%) diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogLabelAssignmentLog/Queries/Search/MappingProfile.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogLabelAssignmentLog/Queries/Search/MappingProfile.cs index 1db5b48d9..12c4780e4 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogLabelAssignmentLog/Queries/Search/MappingProfile.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogLabelAssignmentLog/Queries/Search/MappingProfile.cs @@ -1,4 +1,3 @@ -using System.Reflection.Emit; using AutoMapper; using Digdir.Domain.Dialogporten.Domain.DialogEndUserContexts.Entities; diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSystemLabels/Commands/Set/SetDialogSystemLabelCommand.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSystemLabels/Commands/Set/SetDialogSystemLabelCommand.cs index f3fea832f..71edd6831 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSystemLabels/Commands/Set/SetDialogSystemLabelCommand.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSystemLabels/Commands/Set/SetDialogSystemLabelCommand.cs @@ -10,22 +10,22 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogSystemLabels.Commands.Set; -public sealed class SetDialogSystemLabelCommand : SetDialogSystemLabelDto, IRequest +public sealed class SetDialogSystemLabelCommand : SetDialogSystemLabelDto, IRequest { public Guid? IfMatchDialogRevision { get; set; } } [GenerateOneOf] -public sealed partial class SetDialogLabelResult : OneOfBase; +public sealed partial class SetDialogSystemLabelResult : OneOfBase; -internal sealed class SetDialogLabelCommandHandler : IRequestHandler +internal sealed class SetDialogSystemLabelCommandHandler : IRequestHandler { private readonly IDialogDbContext _db; private readonly IUnitOfWork _unitOfWork; private readonly IUserRegistry _userRegistry; private readonly IAltinnAuthorization _altinnAuthorization; - public SetDialogLabelCommandHandler(IDialogDbContext db, IUnitOfWork unitOfWork, IUserRegistry userRegistry, IAltinnAuthorization altinnAuthorization) + public SetDialogSystemLabelCommandHandler(IDialogDbContext db, IUnitOfWork unitOfWork, IUserRegistry userRegistry, IAltinnAuthorization altinnAuthorization) { _db = db ?? throw new ArgumentNullException(nameof(db)); _unitOfWork = unitOfWork ?? throw new ArgumentNullException(nameof(unitOfWork)); @@ -33,7 +33,7 @@ public SetDialogLabelCommandHandler(IDialogDbContext db, IUnitOfWork unitOfWork, _altinnAuthorization = altinnAuthorization ?? throw new ArgumentNullException(nameof(altinnAuthorization)); } - public async Task Handle( + public async Task Handle( SetDialogSystemLabelCommand request, CancellationToken cancellationToken) { @@ -64,7 +64,7 @@ public async Task Handle( var saveResult = await _unitOfWork .EnableConcurrencyCheck(dialog.DialogEndUserContext, request.IfMatchDialogRevision) .SaveChangesAsync(cancellationToken); - return saveResult.Match( + return saveResult.Match( success => success, domainError => domainError, concurrencyError => concurrencyError); diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSystemLabels/Commands/Set/SetDialogSystemLabelDto.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSystemLabels/Commands/Set/SetDialogSystemLabelDto.cs index 8e7f017a2..8a6a9cac7 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSystemLabels/Commands/Set/SetDialogSystemLabelDto.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSystemLabels/Commands/Set/SetDialogSystemLabelDto.cs @@ -1,4 +1,3 @@ -using System.Diagnostics.CodeAnalysis; using Digdir.Domain.Dialogporten.Domain.DialogEndUserContexts.Entities; namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogSystemLabels.Commands.Set; diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Update/UpdateDialogCommand.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Update/UpdateDialogCommand.cs index 4e5e9f456..4aaac0441 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Update/UpdateDialogCommand.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Update/UpdateDialogCommand.cs @@ -7,8 +7,8 @@ using Digdir.Domain.Dialogporten.Application.Externals; using Digdir.Domain.Dialogporten.Application.Externals.Presentation; using Digdir.Domain.Dialogporten.Domain.Actors; -using Digdir.Domain.Dialogporten.Domain.Common; using Digdir.Domain.Dialogporten.Domain.Attachments; +using Digdir.Domain.Dialogporten.Domain.Common; using Digdir.Domain.Dialogporten.Domain.DialogEndUserContexts.Entities; using Digdir.Domain.Dialogporten.Domain.Dialogs.Entities; using Digdir.Domain.Dialogporten.Domain.Dialogs.Entities.Actions; @@ -67,18 +67,18 @@ public async Task Handle(UpdateDialogCommand request, Cancel var dialog = await _db.Dialogs .Include(x => x.Activities) .Include(x => x.Content) - .ThenInclude(x => x.Value.Localizations) + .ThenInclude(x => x.Value.Localizations) .Include(x => x.SearchTags) .Include(x => x.Attachments) - .ThenInclude(x => x.DisplayName!.Localizations) + .ThenInclude(x => x.DisplayName!.Localizations) .Include(x => x.Attachments) - .ThenInclude(x => x.Urls) + .ThenInclude(x => x.Urls) .Include(x => x.GuiActions) - .ThenInclude(x => x.Title!.Localizations) + .ThenInclude(x => x.Title!.Localizations) .Include(x => x.GuiActions) - .ThenInclude(x => x.Prompt!.Localizations) + .ThenInclude(x => x.Prompt!.Localizations) .Include(x => x.ApiActions) - .ThenInclude(x => x.Endpoints) + .ThenInclude(x => x.Endpoints) .Include(x => x.Transmissions) .Include(x => x.DialogEndUserContext) .IgnoreQueryFilters() diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogLabelAssigmentLogs/Search/SearchDialogLabelAssigmentLogEndpoint.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogLabelAssignmentLogs/Search/SearchDialogLabelAssignmentLogEndpoint.cs similarity index 79% rename from src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogLabelAssigmentLogs/Search/SearchDialogLabelAssigmentLogEndpoint.cs rename to src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogLabelAssignmentLogs/Search/SearchDialogLabelAssignmentLogEndpoint.cs index 58b3f150c..f87b992bf 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogLabelAssigmentLogs/Search/SearchDialogLabelAssigmentLogEndpoint.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogLabelAssignmentLogs/Search/SearchDialogLabelAssignmentLogEndpoint.cs @@ -1,17 +1,16 @@ -using System.Diagnostics; using Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogLabelAssignmentLog.Queries.Search; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; using FastEndpoints; using MediatR; -namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.EndUser.DialogLabelAssigmentLogs.Search; +namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.EndUser.DialogLabelAssignmentLogs.Search; -public sealed class SearchDialogLabelAssigmentLogEndpoint : Endpoint> +public sealed class SearchDialogLabelAssignmentLogEndpoint : Endpoint> { private readonly ISender _sender; - public SearchDialogLabelAssigmentLogEndpoint(ISender sender) + public SearchDialogLabelAssignmentLogEndpoint(ISender sender) { _sender = sender ?? throw new ArgumentNullException(nameof(sender)); } diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogLabelAssigmentLogs/Search/SearchDialogLabelAssignmentSwaggerConfig.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogLabelAssignmentLogs/Search/SearchDialogLabelAssignmentSwaggerConfig.cs similarity index 95% rename from src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogLabelAssigmentLogs/Search/SearchDialogLabelAssignmentSwaggerConfig.cs rename to src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogLabelAssignmentLogs/Search/SearchDialogLabelAssignmentSwaggerConfig.cs index 2ac4a8e1a..a506acf98 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogLabelAssigmentLogs/Search/SearchDialogLabelAssignmentSwaggerConfig.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogLabelAssignmentLogs/Search/SearchDialogLabelAssignmentSwaggerConfig.cs @@ -2,7 +2,7 @@ using Digdir.Domain.Dialogporten.WebApi.Common.Swagger; using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; -namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.EndUser.DialogLabelAssigmentLogs.Search; +namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.EndUser.DialogLabelAssignmentLogs.Search; public sealed class SearchDialogLabelAssignmentSwaggerConfig : ISwaggerConfig {