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.
41 lines
1000 B
C#
41 lines
1000 B
C#
using EnvelopeGenerator.Application.Common.Commands;
|
|
using EnvelopeGenerator.Domain.Entities;
|
|
using System.Linq.Expressions;
|
|
|
|
namespace EnvelopeGenerator.Application.DocStatus.Commands;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="Value"></param>
|
|
public record DocStatusUpdateDto(string? Value);
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public record UpdateDocStatusCommand : UpdateCommand<DocStatusUpdateDto, DocumentStatus>
|
|
{
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
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;
|
|
}
|
|
} |