29 lines
751 B
C#
29 lines
751 B
C#
using LiteCharms.Features.Shop;
|
|
using LiteCharms.Models;
|
|
|
|
namespace LiteCharms.Features.Leads.Commands;
|
|
|
|
public class UpdateLeadCommand : IRequest<Result>
|
|
{
|
|
public Guid LeadId { get; set; }
|
|
|
|
public LeadStatus Status { get; set; }
|
|
|
|
private UpdateLeadCommand(Guid leadId, LeadStatus status)
|
|
{
|
|
LeadId = leadId;
|
|
Status = status;
|
|
}
|
|
|
|
public static UpdateLeadCommand Create(Guid leadId, LeadStatus status)
|
|
{
|
|
if (leadId == Guid.Empty)
|
|
throw new ArgumentException("Lead ID cannot be empty.", nameof(leadId));
|
|
|
|
if (!Enum.IsDefined(typeof(LeadStatus), status))
|
|
throw new ArgumentException("Invalid lead status.", nameof(status));
|
|
|
|
return new(leadId, status);
|
|
}
|
|
}
|