Added shared projects
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user