using Heimdall.Domain.Primitives;
namespace Heimdall.Domain.Entities;
///
/// A vehicle of interest detected by the system.
/// Linked to a person (owner) and to license plate detections.
///
public class Vehicle : Entity, IAuditableEntity
{
public string? LicensePlate { get; private set; }
public Guid? PersonId { get; private set; }
public string? Make { get; private set; }
public string? Model { get; private set; }
public string? Color { get; private set; }
public DateTime CreatedAt { get; set; }
public DateTime UpdatedAt { get; set; }
// Navigation
public Person? Person { get; private set; }
private Vehicle() { } // EF Core
public Vehicle(string? licensePlate, Guid? personId = null, string? make = null, string? model = null, string? color = null)
: base(Guid.NewGuid())
{
LicensePlate = licensePlate;
PersonId = personId;
Make = make;
Model = model;
Color = color;
}
public void Update(string? licensePlate, string? make, string? model, string? color)
{
LicensePlate = licensePlate;
Make = make;
Model = model;
Color = color;
}
public void AssignPerson(Guid? personId) => PersonId = personId;
}