PIBD14-Boyko-M.S.-GSM-Autot.../ProjectGSM/Entities/StatusHistory.cs
2024-11-09 03:06:08 +04:00

24 lines
698 B
C#

using ProjectGSM.Entities.Enums;
namespace ProjectGSM.Entities;
public class StatusHistory
{
public int CaseId { get; private set; }
public Status Status { get; private set; }
public decimal Price { get; private set; }
public DateTime CreatedAt { get; private set; } = DateTime.UtcNow;
// Конструктор для создания сущности
public static StatusHistory CreateEntity(int caseId, Status status, decimal price, DateTime? dateTime = null)
{
return new StatusHistory
{
CaseId = caseId,
Status = status,
Price = price,
CreatedAt = dateTime ?? DateTime.UtcNow
};
}
}