PIBD14-Boyko-M.S.-GSM-Autot.../ProjectGSM/Entities/Case.cs
2024-11-18 23:50:05 +04:00

47 lines
1.4 KiB
C#

using System.Text.Json.Serialization;
using ProjectGSM.Entities.Enums;
namespace ProjectGSM.Entities;
public class Case
{
public int Id { get; private set; }
public TypeAppeal TypeAppeal { get; private set; }
public bool Payment { get; private set; } = false;
public decimal Price { get; private set; }
public decimal VictoryPrice { get; private set; }
public bool Verdict { get; private set; } = false;
public int CourtId { get; private set; }
public int ClientId { get; private set; }
public string Description { get; private set; } = string.Empty;
public DateTime CreatedAt { get; private set; } = DateTime.UtcNow;
[JsonIgnore]public List<CaseAdvocate> Advocates { get; set; }
// Конструктор для создания сущности
public static Case CreateEntity(
int id,
TypeAppeal typeAppeal,
bool payment,
decimal price,
decimal victoryPrice,
bool verdict,
int courtId,
int clientId,
string description
)
{
return new Case
{
Id = id,
TypeAppeal = typeAppeal,
Payment = payment,
Price = price,
VictoryPrice = victoryPrice,
Verdict = verdict,
CourtId = courtId,
ClientId = clientId,
Description = description ?? string.Empty,
CreatedAt = DateTime.UtcNow
};
}
}