Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Fargekritt committed Oct 3, 2024
1 parent 51213a7 commit 7421962
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Reflection.Emit;
using AutoMapper;
using Digdir.Domain.Dialogporten.Domain.DialogEndUserContexts.Entities;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@

namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogSystemLabels.Commands.Set;

public sealed class SetDialogSystemLabelCommand : SetDialogSystemLabelDto, IRequest<SetDialogLabelResult>
public sealed class SetDialogSystemLabelCommand : SetDialogSystemLabelDto, IRequest<SetDialogSystemLabelResult>
{
public Guid? IfMatchDialogRevision { get; set; }
}

[GenerateOneOf]
public sealed partial class SetDialogLabelResult : OneOfBase<Success, EntityNotFound, EntityDeleted, DomainError, ValidationError, ConcurrencyError>;
public sealed partial class SetDialogSystemLabelResult : OneOfBase<Success, EntityNotFound, EntityDeleted, DomainError, ValidationError, ConcurrencyError>;

internal sealed class SetDialogLabelCommandHandler : IRequestHandler<SetDialogSystemLabelCommand, SetDialogLabelResult>
internal sealed class SetDialogSystemLabelCommandHandler : IRequestHandler<SetDialogSystemLabelCommand, SetDialogSystemLabelResult>
{
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));
_userRegistry = userRegistry ?? throw new ArgumentNullException(nameof(userRegistry));
_altinnAuthorization = altinnAuthorization ?? throw new ArgumentNullException(nameof(altinnAuthorization));
}

public async Task<SetDialogLabelResult> Handle(
public async Task<SetDialogSystemLabelResult> Handle(
SetDialogSystemLabelCommand request,
CancellationToken cancellationToken)
{
Expand Down Expand Up @@ -64,7 +64,7 @@ public async Task<SetDialogLabelResult> Handle(
var saveResult = await _unitOfWork
.EnableConcurrencyCheck(dialog.DialogEndUserContext, request.IfMatchDialogRevision)
.SaveChangesAsync(cancellationToken);
return saveResult.Match<SetDialogLabelResult>(
return saveResult.Match<SetDialogSystemLabelResult>(
success => success,
domainError => domainError,
concurrencyError => concurrencyError);
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -67,18 +67,18 @@ public async Task<UpdateDialogResult> 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()
Expand Down
Original file line number Diff line number Diff line change
@@ -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<SearchDialogLabelAssignmentLogQuery, List<SearchDialogLabelAssignmentLogDto>>
public sealed class SearchDialogLabelAssignmentLogEndpoint : Endpoint<SearchDialogLabelAssignmentLogQuery, List<SearchDialogLabelAssignmentLogDto>>
{
private readonly ISender _sender;

public SearchDialogLabelAssigmentLogEndpoint(ISender sender)
public SearchDialogLabelAssignmentLogEndpoint(ISender sender)
{
_sender = sender ?? throw new ArgumentNullException(nameof(sender));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit 7421962

Please sign in to comment.