Enhance DTOs and controller with documentation and checks

- Added XML documentation comments to properties in `EnvelopeHistoryDto.cs`.
- Changed `EnvelopeId` to non-nullable in `ReadHistoryQuery.cs` and added `Status` parameter for filtering.
- Removed unused `using` directives in `HistoryController.cs` and updated `GetAllAsync` to filter histories by `Status`, returning `NotFound` if no results are found.
This commit is contained in:
Developer 02
2025-05-11 20:54:04 +02:00
parent 6126fce24d
commit fd53f5bfd6
3 changed files with 41 additions and 26 deletions

View File

@@ -5,19 +5,32 @@ using EnvelopeGenerator.Application.DTOs.Receiver;
using Microsoft.AspNetCore.Mvc;
using static EnvelopeGenerator.Common.Constants;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory
{
[ApiExplorerSettings(IgnoreApi = true)]
public record EnvelopeHistoryDto(
long Id,
int EnvelopeId,
string UserReference,
int Status,
string? StatusName,
DateTime AddedWhen,
DateTime? ActionDate,
UserCreateDto? Sender,
ReceiverReadDto? Receiver,
ReferenceType ReferenceType,
string? Comment = null) : BaseDTO<long>(Id), IUnique<long>;
}
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
/// <summary>
///
/// </summary>
/// <param name="Id"></param>
/// <param name="EnvelopeId"></param>
/// <param name="UserReference"></param>
/// <param name="Status"></param>
/// <param name="StatusName"></param>
/// <param name="AddedWhen"></param>
/// <param name="ActionDate"></param>
/// <param name="Sender"></param>
/// <param name="Receiver"></param>
/// <param name="ReferenceType"></param>
/// <param name="Comment"></param>
[ApiExplorerSettings(IgnoreApi = true)]
public record EnvelopeHistoryDto(
long Id,
int EnvelopeId,
string UserReference,
int Status,
string? StatusName,
DateTime AddedWhen,
DateTime? ActionDate,
UserCreateDto? Sender,
ReceiverReadDto? Receiver,
ReferenceType ReferenceType,
string? Comment = null) : BaseDTO<long>(Id), IUnique<long>;