Skip to content

Commit

Permalink
feat: update swagger name generation (#1350)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fargekritt authored Oct 31, 2024
1 parent 16f160d commit 94c5544
Show file tree
Hide file tree
Showing 146 changed files with 3,950 additions and 4,204 deletions.
6,021 changes: 3,014 additions & 3,007 deletions docs/schema/V1/swagger.verified.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogActivities.Queries.Get;

public sealed class GetDialogActivityDto
public sealed class ActivityDto
{
public Guid Id { get; set; }
public DateTimeOffset? CreatedAt { get; set; }
Expand All @@ -14,11 +14,11 @@ public sealed class GetDialogActivityDto

public Guid? TransmissionId { get; set; }

public GetDialogActivityPerformedByActorDto PerformedBy { get; set; } = null!;
public PerformedByActorDto PerformedBy { get; set; } = null!;
public List<LocalizationDto> Description { get; set; } = [];
}

public sealed class GetDialogActivityPerformedByActorDto
public sealed class PerformedByActorDto
{
public Guid Id { get; set; }
public ActorType.Values ActorType { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@

namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogActivities.Queries.Get;

public sealed class GetDialogActivityQuery : IRequest<GetDialogActivityResult>
public sealed class GetActivityQuery : IRequest<GetActivityResult>
{
public Guid DialogId { get; set; }
public Guid ActivityId { get; set; }
}

[GenerateOneOf]
public sealed partial class GetDialogActivityResult : OneOfBase<GetDialogActivityDto, EntityNotFound, EntityDeleted>;
public sealed partial class GetActivityResult : OneOfBase<ActivityDto, EntityNotFound, EntityDeleted>;

internal sealed class GetDialogActivityQueryHandler : IRequestHandler<GetDialogActivityQuery, GetDialogActivityResult>
internal sealed class GetActivityQueryHandler : IRequestHandler<GetActivityQuery, GetActivityResult>
{
private readonly IMapper _mapper;
private readonly IAltinnAuthorization _altinnAuthorization;
private readonly IDialogDbContext _dbContext;

public GetDialogActivityQueryHandler(
public GetActivityQueryHandler(
IDialogDbContext dbContext,
IMapper mapper,
IAltinnAuthorization altinnAuthorization)
Expand All @@ -35,7 +35,7 @@ public GetDialogActivityQueryHandler(
_altinnAuthorization = altinnAuthorization ?? throw new ArgumentNullException(nameof(altinnAuthorization));
}

public async Task<GetDialogActivityResult> Handle(GetDialogActivityQuery request,
public async Task<GetActivityResult> Handle(GetActivityQuery request,
CancellationToken cancellationToken)
{
var dialog = await _dbContext.Dialogs
Expand Down Expand Up @@ -74,6 +74,6 @@ public async Task<GetDialogActivityResult> Handle(GetDialogActivityQuery request
return new EntityNotFound<DialogActivity>(request.ActivityId);
}

return _mapper.Map<GetDialogActivityDto>(activity);
return _mapper.Map<ActivityDto>(activity);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ internal sealed class MappingProfile : Profile
{
public MappingProfile()
{
CreateMap<DialogActivity, GetDialogActivityDto>()
CreateMap<DialogActivity, ActivityDto>()
.ForMember(dest => dest.Type, opt => opt.MapFrom(src => src.TypeId));

CreateMap<DialogActivityPerformedByActor, GetDialogActivityPerformedByActorDto>()
CreateMap<DialogActivityPerformedByActor, PerformedByActorDto>()
.ForMember(dest => dest.ActorType, opt => opt.MapFrom(src => src.ActorTypeId))
.ForMember(dest => dest.ActorId, opt => opt.MapFrom(src => IdentifierMasker.GetMaybeMaskedIdentifier(src.ActorId)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogActivities.Queries.Search;

public sealed class SearchDialogActivityDto
public sealed class ActivityDto
{
public Guid Id { get; set; }
public DateTimeOffset CreatedAt { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ internal sealed class MappingProfile : Profile
{
public MappingProfile()
{
CreateMap<DialogActivity, SearchDialogActivityDto>()
CreateMap<DialogActivity, ActivityDto>()
.ForMember(dest => dest.Type, opt => opt.MapFrom(src => src.TypeId));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@

namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogActivities.Queries.Search;

public sealed class SearchDialogActivityQuery : IRequest<SearchDialogActivityResult>
public sealed class SearchActivityQuery : IRequest<SearchActivityResult>
{
public Guid DialogId { get; set; }
}

[GenerateOneOf]
public sealed partial class SearchDialogActivityResult : OneOfBase<List<SearchDialogActivityDto>, EntityNotFound, EntityDeleted>;
public sealed partial class SearchActivityResult : OneOfBase<List<ActivityDto>, EntityNotFound, EntityDeleted>;

internal sealed class SearchDialogActivityQueryHandler : IRequestHandler<SearchDialogActivityQuery, SearchDialogActivityResult>
internal sealed class SearchActivityQueryHandler : IRequestHandler<SearchActivityQuery, SearchActivityResult>
{
private readonly IDialogDbContext _db;
private readonly IMapper _mapper;
private readonly IAltinnAuthorization _altinnAuthorization;

public SearchDialogActivityQueryHandler(
public SearchActivityQueryHandler(
IDialogDbContext db,
IMapper mapper,
IAltinnAuthorization altinnAuthorization)
Expand All @@ -33,7 +33,7 @@ public SearchDialogActivityQueryHandler(
_altinnAuthorization = altinnAuthorization ?? throw new ArgumentNullException(nameof(altinnAuthorization));
}

public async Task<SearchDialogActivityResult> Handle(SearchDialogActivityQuery request, CancellationToken cancellationToken)
public async Task<SearchActivityResult> Handle(SearchActivityQuery request, CancellationToken cancellationToken)
{
var dialog = await _db.Dialogs
.Include(x => x.Activities)
Expand Down Expand Up @@ -61,6 +61,6 @@ public async Task<SearchDialogActivityResult> Handle(SearchDialogActivityQuery r
return new EntityDeleted<DialogEntity>(request.DialogId);
}

return _mapper.Map<List<SearchDialogActivityDto>>(dialog.Activities);
return _mapper.Map<List<ActivityDto>>(dialog.Activities);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogLabelAssignmentLog.Queries.Search;

public sealed class SearchDialogLabelAssignmentLogDto
public sealed class LabelAssignmentLogDto
{
public DateTimeOffset CreatedAt { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public sealed class MappingProfile : Profile
{
public MappingProfile()
{
CreateMap<LabelAssignmentLog, SearchDialogLabelAssignmentLogDto>();
CreateMap<LabelAssignmentLog, LabelAssignmentLogDto>();
CreateMap<LabelAssignmentLogActor, LabelAssignmentLogActorDto>();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,28 @@

namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogLabelAssignmentLog.Queries.Search;

public sealed class SearchDialogLabelAssignmentLogQuery : IRequest<SearchDialogLabelAssignmentLogResult>
public sealed class SearchLabelAssignmentLogQuery : IRequest<SearchLabelAssignmentLogResult>
{
public Guid DialogId { get; set; }
}

[GenerateOneOf]
public sealed partial class SearchDialogLabelAssignmentLogResult : OneOfBase<List<SearchDialogLabelAssignmentLogDto>, EntityNotFound, EntityDeleted>;
public sealed partial class SearchLabelAssignmentLogResult : OneOfBase<List<LabelAssignmentLogDto>, EntityNotFound, EntityDeleted>;

internal sealed class SearchDialogLabelAssignmentLogQueryHandler : IRequestHandler<SearchDialogLabelAssignmentLogQuery, SearchDialogLabelAssignmentLogResult>
internal sealed class SearchLabelAssignmentLogQueryHandler : IRequestHandler<SearchLabelAssignmentLogQuery, SearchLabelAssignmentLogResult>
{
private readonly IDialogDbContext _dialogDbContext;
private readonly IMapper _mapper;
private readonly IAltinnAuthorization _altinnAuthorization;

public SearchDialogLabelAssignmentLogQueryHandler(IDialogDbContext dialogDbContext, IMapper mapper, IAltinnAuthorization altinnAuthorization)
public SearchLabelAssignmentLogQueryHandler(IDialogDbContext dialogDbContext, IMapper mapper, IAltinnAuthorization altinnAuthorization)
{
_dialogDbContext = dialogDbContext ?? throw new ArgumentNullException(nameof(dialogDbContext));
_mapper = mapper ?? throw new ArgumentNullException(nameof(mapper));
_altinnAuthorization = altinnAuthorization ?? throw new ArgumentNullException(nameof(altinnAuthorization));
}

public async Task<SearchDialogLabelAssignmentLogResult> Handle(SearchDialogLabelAssignmentLogQuery request, CancellationToken cancellationToken)
public async Task<SearchLabelAssignmentLogResult> Handle(SearchLabelAssignmentLogQuery request, CancellationToken cancellationToken)
{
var dialog = await _dialogDbContext.Dialogs
.AsNoTracking()
Expand All @@ -55,6 +55,6 @@ public async Task<SearchDialogLabelAssignmentLogResult> Handle(SearchDialogLabel
return new EntityDeleted<DialogEntity>(request.DialogId);
}

return _mapper.Map<List<SearchDialogLabelAssignmentLogDto>>(dialog.DialogEndUserContext.LabelAssignmentLogs);
return _mapper.Map<List<LabelAssignmentLogDto>>(dialog.DialogEndUserContext.LabelAssignmentLogs);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@

namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogSeenLogs.Queries.Get;

public sealed class GetDialogSeenLogQuery : IRequest<GetDialogSeenLogResult>
public sealed class GetSeenLogQuery : IRequest<GetSeenLogResult>
{
public Guid DialogId { get; set; }
public Guid SeenLogId { get; set; }
}

[GenerateOneOf]
public sealed partial class GetDialogSeenLogResult : OneOfBase<GetDialogSeenLogDto, EntityNotFound, EntityDeleted, Forbidden>;
public sealed partial class GetSeenLogResult : OneOfBase<SeenLogDto, EntityNotFound, EntityDeleted, Forbidden>;

internal sealed class GetDialogSeenLogQueryHandler : IRequestHandler<GetDialogSeenLogQuery, GetDialogSeenLogResult>
internal sealed class GetSeenLogQueryHandler : IRequestHandler<GetSeenLogQuery, GetSeenLogResult>
{
private readonly IMapper _mapper;
private readonly IDialogDbContext _dbContext;
private readonly IAltinnAuthorization _altinnAuthorization;
private readonly IUserRegistry _userRegistry;

public GetDialogSeenLogQueryHandler(
public GetSeenLogQueryHandler(
IMapper mapper,
IDialogDbContext dbContext,
IAltinnAuthorization altinnAuthorization,
Expand All @@ -38,7 +38,7 @@ public GetDialogSeenLogQueryHandler(
_userRegistry = userRegistry ?? throw new ArgumentNullException(nameof(userRegistry));
}

public async Task<GetDialogSeenLogResult> Handle(GetDialogSeenLogQuery request,
public async Task<GetSeenLogResult> Handle(GetSeenLogQuery request,
CancellationToken cancellationToken)
{
var currentUserInformation = await _userRegistry.GetCurrentUserInformation(cancellationToken);
Expand Down Expand Up @@ -77,7 +77,7 @@ public async Task<GetDialogSeenLogResult> Handle(GetDialogSeenLogQuery request,
return new EntityNotFound<DialogSeenLog>(request.SeenLogId);
}

var dto = _mapper.Map<GetDialogSeenLogDto>(seenLog);
var dto = _mapper.Map<SeenLogDto>(seenLog);
dto.IsCurrentEndUser = currentUserInformation.UserId.ExternalIdWithPrefix == seenLog.SeenBy.ActorId;

return dto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ public sealed class MappingProfile : Profile
{
public MappingProfile()
{
CreateMap<DialogSeenLog, GetDialogSeenLogDto>()
CreateMap<DialogSeenLog, SeenLogDto>()
.ForMember(dest => dest.SeenAt, opt => opt.MapFrom(src => src.CreatedAt));

CreateMap<DialogSeenLogSeenByActor, GetDialogSeenLogSeenByActorDto>()
CreateMap<DialogSeenLogSeenByActor, SeenLogSeenByActorDto>()
.ForMember(dest => dest.ActorId,
opt => opt.MapFrom(src => IdentifierMasker.GetMaybeMaskedIdentifier(src.ActorId)));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogSeenLogs.Queries.Get;

public sealed class GetDialogSeenLogDto
public sealed class SeenLogDto
{
public Guid Id { get; set; }
public DateTimeOffset SeenAt { get; set; }
public GetDialogSeenLogSeenByActorDto SeenBy { get; set; } = null!;
public SeenLogSeenByActorDto SeenBy { get; set; } = null!;

public bool IsViaServiceOwner { get; set; }
public bool IsCurrentEndUser { get; set; }
}

public sealed class GetDialogSeenLogSeenByActorDto
public sealed class SeenLogSeenByActorDto
{
public Guid Id { get; set; }
public string ActorName { get; set; } = null!;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ public sealed class MappingProfile : Profile
{
public MappingProfile()
{
CreateMap<DialogSeenLog, SearchDialogSeenLogDto>()
CreateMap<DialogSeenLog, SeenLogDto>()
.ForMember(dest => dest.SeenAt, opt => opt.MapFrom(src => src.CreatedAt));

CreateMap<DialogSeenLogSeenByActor, SearchDialogSeenLogSeenByActorDto>()
CreateMap<DialogSeenLogSeenByActor, SeenLogSeenByActorDto>()
.ForMember(dest => dest.ActorId, opt => opt.MapFrom(src => IdentifierMasker.GetMaybeMaskedIdentifier(src.ActorId)));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@

namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogSeenLogs.Queries.Search;

public sealed class SearchDialogSeenLogQuery : IRequest<SearchDialogSeenLogResult>
public sealed class SearchSeenLogQuery : IRequest<SearchSeenLogResult>
{
public Guid DialogId { get; set; }
}

[GenerateOneOf]
public sealed partial class SearchDialogSeenLogResult : OneOfBase<List<SearchDialogSeenLogDto>, EntityNotFound, EntityDeleted, Forbidden>;
public sealed partial class SearchSeenLogResult : OneOfBase<List<SeenLogDto>, EntityNotFound, EntityDeleted, Forbidden>;

internal sealed class SearchDialogSeenLogQueryHandler : IRequestHandler<SearchDialogSeenLogQuery, SearchDialogSeenLogResult>
internal sealed class SearchSeenLogQueryHandler : IRequestHandler<SearchSeenLogQuery, SearchSeenLogResult>
{
private readonly IDialogDbContext _db;
private readonly IMapper _mapper;
private readonly IAltinnAuthorization _altinnAuthorization;
private readonly IUserRegistry _userRegistry;

public SearchDialogSeenLogQueryHandler(
public SearchSeenLogQueryHandler(
IDialogDbContext db,
IMapper mapper,
IAltinnAuthorization altinnAuthorization,
Expand All @@ -37,7 +37,7 @@ public SearchDialogSeenLogQueryHandler(
_userRegistry = userRegistry ?? throw new ArgumentNullException(nameof(userRegistry));
}

public async Task<SearchDialogSeenLogResult> Handle(SearchDialogSeenLogQuery request, CancellationToken cancellationToken)
public async Task<SearchSeenLogResult> Handle(SearchSeenLogQuery request, CancellationToken cancellationToken)
{
var currentUserInformation = await _userRegistry.GetCurrentUserInformation(cancellationToken);

Expand Down Expand Up @@ -72,7 +72,7 @@ public async Task<SearchDialogSeenLogResult> Handle(SearchDialogSeenLogQuery req
return dialog.SeenLog
.Select(x =>
{
var dto = _mapper.Map<SearchDialogSeenLogDto>(x);
var dto = _mapper.Map<SeenLogDto>(x);
dto.IsCurrentEndUser = currentUserInformation.UserId.ExternalIdWithPrefix == x.SeenBy.ActorId;
return dto;
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogSeenLogs.Queries.Search;

public sealed class SearchDialogSeenLogDto
public sealed class SeenLogDto
{
public Guid Id { get; set; }
public DateTimeOffset SeenAt { get; set; }

public SearchDialogSeenLogSeenByActorDto SeenBy { get; set; } = null!;
public SeenLogSeenByActorDto SeenBy { get; set; } = null!;

public bool IsViaServiceOwner { get; set; }
public bool IsCurrentEndUser { get; set; }
}

public sealed class SearchDialogSeenLogSeenByActorDto
public sealed class SeenLogSeenByActorDto
{
public Guid Id { get; set; }
public string ActorName { get; set; } = null!;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

public sealed class SetDialogSystemLabelCommandValidator : AbstractValidator<SetDialogSystemLabelCommand>
public sealed class SetDialogSystemLabelCommandValidator : AbstractValidator<SystemLabelCommand>
{
public SetDialogSystemLabelCommandValidator()
{
Expand Down
Loading

0 comments on commit 94c5544

Please sign in to comment.