2024-11-18 23:50:05 +04:00
|
|
|
|
using System.Text.Json.Serialization;
|
|
|
|
|
using ProjectGSM.Entities.Enums;
|
2024-11-09 03:06:08 +04:00
|
|
|
|
|
|
|
|
|
namespace ProjectGSM.Entities;
|
2024-11-05 03:59:13 +04:00
|
|
|
|
|
|
|
|
|
public class Case
|
|
|
|
|
{
|
|
|
|
|
public int Id { get; private set; }
|
2024-11-09 03:06:08 +04:00
|
|
|
|
public TypeAppeal TypeAppeal { get; private set; }
|
2024-11-05 03:59:13 +04:00
|
|
|
|
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;
|
2024-11-18 23:50:05 +04:00
|
|
|
|
[JsonIgnore]public List<CaseAdvocate> Advocates { get; set; }
|
2024-11-05 03:59:13 +04:00
|
|
|
|
// Конструктор для создания сущности
|
|
|
|
|
public static Case CreateEntity(
|
|
|
|
|
int id,
|
2024-11-09 03:06:08 +04:00
|
|
|
|
TypeAppeal typeAppeal,
|
2024-11-05 03:59:13 +04:00
|
|
|
|
bool payment,
|
|
|
|
|
decimal price,
|
|
|
|
|
decimal victoryPrice,
|
|
|
|
|
bool verdict,
|
|
|
|
|
int courtId,
|
|
|
|
|
int clientId,
|
|
|
|
|
string description
|
|
|
|
|
)
|
|
|
|
|
{
|
|
|
|
|
return new Case
|
|
|
|
|
{
|
|
|
|
|
Id = id,
|
2024-11-09 03:06:08 +04:00
|
|
|
|
TypeAppeal = typeAppeal,
|
2024-11-05 03:59:13 +04:00
|
|
|
|
Payment = payment,
|
|
|
|
|
Price = price,
|
|
|
|
|
VictoryPrice = victoryPrice,
|
|
|
|
|
Verdict = verdict,
|
|
|
|
|
CourtId = courtId,
|
|
|
|
|
ClientId = clientId,
|
|
|
|
|
Description = description ?? string.Empty,
|
|
|
|
|
CreatedAt = DateTime.UtcNow
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|