Refactor UpdateDocStatusCommand to use generic base class

Refactored UpdateDocStatusCommand to inherit from a generic UpdateCommand base class with a new DocStatusUpdateDto record. Added explicit EnvelopeId, ReceiverId, and Value properties. Removed ChangedWhen property and implemented BuildQueryExpression for querying. Updated using directives and improved XML documentation.
This commit is contained in:
2026-02-19 14:32:45 +01:00
parent 01f3335238
commit 8258d9f43f

View File

@@ -1,14 +1,41 @@
using EnvelopeGenerator.Domain; using EnvelopeGenerator.Application.Common.Commands;
using EnvelopeGenerator.Domain.Entities;
using System.Linq.Expressions;
namespace EnvelopeGenerator.Application.DocStatus.Commands; namespace EnvelopeGenerator.Application.DocStatus.Commands;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public record UpdateDocStatusCommand : ModifyDocStatusCommandBase /// <param name="Value"></param>
public record DocStatusUpdateDto(string? Value);
/// <summary>
///
/// </summary>
public record UpdateDocStatusCommand : UpdateCommand<DocStatusUpdateDto, DocumentStatus>
{ {
/// <summary> /// <summary>
/// Gets timestamp when this record was added. Returns the StatusChangedWhen value. ///
/// </summary> /// </summary>
public DateTime? ChangedWhen => StatusChangedWhen; public int EnvelopeId { get; set; }
/// <summary>
///
/// </summary>
public int ReceiverId { get; set; }
/// <summary>
/// Gets or sets the display value associated with the status.
/// </summary>
public string? Value { get; set; }
/// <summary>
///
/// </summary>
/// <returns></returns>
public override Expression<Func<DocumentStatus, bool>> BuildQueryExpression()
{
return ds => ds.EnvelopeId == EnvelopeId && ds.ReceiverId == ReceiverId;
}
} }