Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add missing return types for Transmissions and Activities in OpenAPI spec #1244

Merged
merged 10 commits into from
Oct 10, 2024
Merged
1,161 changes: 1,005 additions & 156 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 @@ -8,49 +8,145 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogTrans

public sealed class GetDialogTransmissionDto
{
/// <summary>
/// The unique identifier for the transmission in UUIDv7 format.
/// </summary>
public Guid Id { get; set; }

/// <summary>
/// The date and time when the transmission was created.
/// </summary>
public DateTimeOffset CreatedAt { get; set; }

/// <summary>
/// The authorization attribute associated with the transmission.
/// </summary>
public string? AuthorizationAttribute { get; set; }

/// <summary>
/// Flag indicating if the authenticated user is authorized for this transmission. If not, embedded content and
/// the attachments will not be available
/// </summary>
public bool IsAuthorized { get; set; }

/// <summary>
/// The extended type URI for the transmission.
/// </summary>
public Uri? ExtendedType { get; set; }

/// <summary>
/// The unique identifier for the related transmission, if any.
/// </summary>
public Guid? RelatedTransmissionId { get; set; }

/// <summary>
/// The date and time when the transmission was deleted, if applicable.
/// </summary>
public DateTimeOffset? DeletedAt { get; set; }

/// <summary>
/// The type of the transmission.
/// </summary>
public DialogTransmissionType.Values Type { get; set; }

/// <summary>
/// The sender actor information for the transmission.
/// </summary>
public GetDialogTransmissionSenderActorDto Sender { get; set; } = null!;

/// <summary>
/// The content of the transmission.
/// </summary>
public GetDialogTransmissionContentDto Content { get; set; } = null!;

/// <summary>
/// The attachments associated with the transmission.
/// </summary>
public List<GetDialogTransmissionAttachmentDto> Attachments { get; set; } = [];
}

public sealed class GetDialogTransmissionSenderActorDto
{
/// <summary>
/// The unique identifier for the sender actor in UUIDv7 format.
/// </summary>
public Guid Id { get; set; }

/// <summary>
/// The type of the actor.
/// </summary>
public ActorType.Values ActorType { get; set; }

/// <summary>
/// The name of the actor.
/// </summary>
public string ActorName { get; set; } = null!;

oskogstad marked this conversation as resolved.
Show resolved Hide resolved
/// <summary>
/// The identifier of the actor.
/// </summary>
public string ActorId { get; set; } = null!;
}

public sealed class GetDialogTransmissionContentDto
{
/// <summary>
/// The title of the content.
/// </summary>
public ContentValueDto Title { get; set; } = null!;

/// <summary>
/// The summary of the content.
/// </summary>
oskogstad marked this conversation as resolved.
Show resolved Hide resolved
public ContentValueDto Summary { get; set; } = null!;
}

public sealed class GetDialogTransmissionAttachmentDto
{
/// <summary>
/// The unique identifier for the attachment in UUIDv7 format.
/// </summary>
public Guid Id { get; set; }

/// <summary>
/// The display name of the attachment that should be used in GUIs.
/// </summary>
public List<LocalizationDto> DisplayName { get; set; } = [];

/// <summary>
/// The URLs associated with the attachment, each referring to a different representation of the attachment.
/// </summary>
public List<GetDialogTransmissionAttachmentUrlDto> Urls { get; set; } = [];
}

public sealed class GetDialogTransmissionAttachmentUrlDto
{
/// <summary>
/// The unique identifier for the attachment URL in UUIDv7 format.
/// </summary>
public Guid Id { get; set; }

/// <summary>
/// The fully qualified URL of the attachment. Will be set to "urn:dialogporten:unauthorized" if the user is
/// not authorized to access the transmission.
/// </summary>
/// <example>
/// https://someendpoint.com/someattachment.pdf
/// urn:dialogporten:unauthorized
/// </example>
oskogstad marked this conversation as resolved.
Show resolved Hide resolved
public Uri Url { get; set; } = null!;

/// <summary>
/// The media type of the attachment.
/// </summary>
/// <example>
/// application/pdf
/// application/zip
/// </example>
public string? MediaType { get; set; } = null!;

/// <summary>
/// The type of consumer the URL is intended for.
/// </summary>
public AttachmentUrlConsumerType.Values ConsumerType { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public sealed class GetDialogDialogTransmissionDto
/// <summary>
/// The transmission-level attachments
/// </summary>
public List<GetDialogTransmissionAttachmentDto> Attachments { get; set; } = [];
public List<GetDialogDialogTransmissionAttachmentDto> Attachments { get; set; } = [];
}

public sealed class GetDialogDialogSeenLogDto
Expand Down Expand Up @@ -629,7 +629,7 @@ public sealed class GetDialogDialogAttachmentUrlDto
public AttachmentUrlConsumerType.Values ConsumerType { get; set; }
}

public sealed class GetDialogTransmissionAttachmentDto
public sealed class GetDialogDialogTransmissionAttachmentDto
{
/// <summary>
/// The unique identifier for the attachment in UUIDv7 format.
Expand All @@ -644,10 +644,10 @@ public sealed class GetDialogTransmissionAttachmentDto
/// <summary>
/// The URLs associated with the attachment, each referring to a different representation of the attachment.
/// </summary>
public List<GetDialogTransmissionAttachmentUrlDto> Urls { get; set; } = [];
public List<GetDialogDialogTransmissionAttachmentUrlDto> Urls { get; set; } = [];
}

public sealed class GetDialogTransmissionAttachmentUrlDto
public sealed class GetDialogDialogTransmissionAttachmentUrlDto
{
/// <summary>
/// The fully qualified URL of the attachment. Will be set to "urn:dialogporten:unauthorized" if the user is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ public MappingProfile()
CreateMap<DialogTransmission, GetDialogDialogTransmissionDto>()
.ForMember(dest => dest.Type, opt => opt.MapFrom(src => src.TypeId));

CreateMap<DialogTransmissionAttachment, GetDialogTransmissionAttachmentDto>();
CreateMap<AttachmentUrl, GetDialogTransmissionAttachmentUrlDto>()
CreateMap<DialogTransmissionAttachment, GetDialogDialogTransmissionAttachmentDto>();
oskogstad marked this conversation as resolved.
Show resolved Hide resolved
CreateMap<AttachmentUrl, GetDialogDialogTransmissionAttachmentUrlDto>()
.ForMember(dest => dest.ConsumerType, opt => opt.MapFrom(src => src.ConsumerTypeId));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,48 +8,139 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.Dialog

public sealed class GetDialogTransmissionDto
{
/// <summary>
/// The unique identifier for the transmission in UUIDv7 format.
/// </summary>
public Guid Id { get; set; }

/// <summary>
/// The date and time when the transmission was created.
/// </summary>
public DateTimeOffset CreatedAt { get; set; }

/// <summary>
/// The authorization attribute associated with the transmission.
/// </summary>
public string? AuthorizationAttribute { get; set; }

/// <summary>
/// The extended type URI for the transmission.
/// </summary>
public Uri? ExtendedType { get; set; }

/// <summary>
/// The unique identifier for the related transmission, if any.
/// </summary>
public Guid? RelatedTransmissionId { get; set; }

/// <summary>
/// The date and time when the transmission was deleted, if applicable.
/// </summary>
public DateTimeOffset? DeletedAt { get; set; }

/// <summary>
/// The type of the transmission.
/// </summary>
public DialogTransmissionType.Values Type { get; set; }

/// <summary>
/// The sender actor information for the transmission.
/// </summary>
public GetDialogTransmissionSenderActorDto Sender { get; set; } = null!;

/// <summary>
/// The content of the transmission.
/// </summary>
public GetDialogTransmissionContentDto Content { get; set; } = null!;

/// <summary>
/// The attachments associated with the transmission.
/// </summary>
public List<GetDialogTransmissionAttachmentDto> Attachments { get; set; } = [];
}

public sealed class GetDialogTransmissionSenderActorDto
{
/// <summary>
/// The unique identifier for the sender actor in UUIDv7 format.
/// </summary>
public Guid Id { get; set; }

/// <summary>
/// The type of the actor.
/// </summary>
public ActorType.Values ActorType { get; set; }

/// <summary>
/// The name of the actor.
/// </summary>
public string ActorName { get; set; } = null!;

/// <summary>
/// The identifier of the actor.
/// </summary>
public string ActorId { get; set; } = null!;
}

public sealed class GetDialogTransmissionContentDto
{
/// <summary>
/// The title of the content.
/// </summary>
public ContentValueDto Title { get; set; } = null!;

/// <summary>
/// The summary of the content.
/// </summary>
public ContentValueDto Summary { get; set; } = null!;
}

public sealed class GetDialogTransmissionAttachmentDto
{
/// <summary>
/// The unique identifier for the attachment in UUIDv7 format.
/// </summary>
public Guid Id { get; set; }

/// <summary>
/// The display name of the attachment that should be used in GUIs.
/// </summary>
public List<LocalizationDto> DisplayName { get; set; } = [];

/// <summary>
/// The URLs associated with the attachment, each referring to a different representation of the attachment.
/// </summary>
public List<GetDialogTransmissionAttachmentUrlDto> Urls { get; set; } = [];
}

public sealed class GetDialogTransmissionAttachmentUrlDto
{
/// <summary>
/// The unique identifier for the attachment URL in UUIDv7 format.
/// </summary>
public Guid Id { get; set; }

/// <summary>
/// The fully qualified URL of the attachment. Will be set to "urn:dialogporten:unauthorized" if the user is
/// not authorized to access the transmission.
/// </summary>
/// <example>
/// https://someendpoint.com/someattachment.pdf
/// urn:dialogporten:unauthorized
/// </example>
public Uri Url { get; set; } = null!;

/// <summary>
/// The media type of the attachment.
/// </summary>
/// <example>
/// application/pdf
/// application/zip
/// </example>
public string? MediaType { get; set; } = null!;

/// <summary>
/// The type of consumer the URL is intended for.
/// </summary>
public AttachmentUrlConsumerType.Values ConsumerType { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public sealed class GetDialogDialogTransmissionDto
/// <summary>
/// The transmission-level attachments
/// </summary>
public List<GetDialogTransmissionAttachmentDto> Attachments { get; set; } = [];
public List<GetDialogDialogTransmissionAttachmentDto> Attachments { get; set; } = [];
}

public sealed class GetDialogDialogSeenLogDto
Expand Down Expand Up @@ -636,7 +636,7 @@ public sealed class GetDialogDialogAttachmentUrlDto
public AttachmentUrlConsumerType.Values ConsumerType { get; set; }
}

public sealed class GetDialogTransmissionAttachmentDto
public sealed class GetDialogDialogTransmissionAttachmentDto
{
/// <summary>
/// The unique identifier for the attachment in UUIDv7 format.
Expand All @@ -651,10 +651,10 @@ public sealed class GetDialogTransmissionAttachmentDto
/// <summary>
/// The URLs associated with the attachment, each referring to a different representation of the attachment.
/// </summary>
public List<GetDialogTransmissionAttachmentUrlDto> Urls { get; set; } = [];
public List<GetDialogDialogTransmissionAttachmentUrlDto> Urls { get; set; } = [];
}

public sealed class GetDialogTransmissionAttachmentUrlDto
public sealed class GetDialogDialogTransmissionAttachmentUrlDto
{
/// <summary>
/// The fully qualified URL of the attachment. Will be set to "urn:dialogporten:unauthorized" if the user is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ public MappingProfile()
CreateMap<DialogTransmission, GetDialogDialogTransmissionDto>()
.ForMember(dest => dest.Type, opt => opt.MapFrom(src => src.TypeId));

CreateMap<DialogTransmissionAttachment, GetDialogTransmissionAttachmentDto>();
CreateMap<AttachmentUrl, GetDialogTransmissionAttachmentUrlDto>()
CreateMap<DialogTransmissionAttachment, GetDialogDialogTransmissionAttachmentDto>();
CreateMap<AttachmentUrl, GetDialogDialogTransmissionAttachmentUrlDto>()
oskogstad marked this conversation as resolved.
Show resolved Hide resolved
.ForMember(dest => dest.ConsumerType, opt => opt.MapFrom(src => src.ConsumerTypeId));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public MappingProfile()
CreateMap<GetDialogDialogTransmissionDto, Transmission>()
.ForMember(dest => dest.Type, opt => opt.MapFrom(src => src.Type));
CreateMap<GetDialogDialogTransmissionSenderActorDto, Actor>();
CreateMap<GetDialogTransmissionAttachmentDto, Attachment>();
CreateMap<GetDialogTransmissionAttachmentUrlDto, AttachmentUrl>()
CreateMap<GetDialogDialogTransmissionAttachmentDto, Attachment>();
CreateMap<GetDialogDialogTransmissionAttachmentUrlDto, AttachmentUrl>()
.ForMember(dest => dest.ConsumerType, opt => opt.MapFrom(src => src.ConsumerType));
CreateMap<GetDialogDialogTransmissionContentDto, TransmissionContent>();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.EndUser.DialogActivities.Get;

public sealed class GetDialogActivityEndpoint : Endpoint<GetDialogActivityQuery>
public sealed class GetDialogActivityEndpoint : Endpoint<GetDialogActivityQuery, GetDialogActivityDto>
{
private readonly ISender _sender;

Expand Down
Loading
Loading