using System.Text.Json.Serialization; namespace CarCareTracker.Models { public class Vehicle { public int Id { get; set; } public string ImageLocation { get; set; } = "/defaults/noimage.png"; public string MapLocation { get; set; } = ""; public int Year { get; set; } public string Make { get; set; } public string Model { get; set; } public string LicensePlate { get; set; } [JsonConverter(typeof(FromDateOptional))] public string PurchaseDate { get; set; } [JsonConverter(typeof(FromDateOptional))] public string SoldDate { get; set; } public decimal PurchasePrice { get; set; } public decimal SoldPrice { get; set; } public bool IsElectric { get; set; } = false; public bool IsDiesel { get; set; } = false; public bool UseHours { get; set; } = false; public bool OdometerOptional { get; set; } = false; public List ExtraFields { get; set; } = new List(); public List Tags { get; set; } = new List(); public bool HasOdometerAdjustment { get; set; } = false; /// /// Primarily used for vehicles with odometer units different from user's settings. /// [JsonConverter(typeof(FromDecimalOptional))] public string OdometerMultiplier { get; set; } = "1"; /// /// Primarily used for vehicles where the odometer does not reflect actual mileage. /// [JsonConverter(typeof(FromIntOptional))] public string OdometerDifference { get; set; } = "0"; public List DashboardMetrics { get; set; } = new List(); /// /// Determines what is displayed in place of the license plate. /// public string VehicleIdentifier { get; set; } = "LicensePlate"; } }