using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace dealer
{
    public class Vehicle
    {
        public string? Spz { get; set; }
        public string? Znacka { get; set; }
        public string? Model { get; set; }
        public string? Barva { get; set; }
        public int? RokVyroby { get; set; }
        public string? Palivo { get; set; }
        public int? NajeteKm { get; set; }
        public decimal? Cena { get; set; }
        
        public Guid? FotografieId { get; set; }
        
        [JsonIgnore]
        public Image? Fotografie { get; set; }
        
        public Guid? VlastnikId { get; set; }
        
        [JsonIgnore]
        public Owner? Vlastnik { get; set; }

        public string ZnackaModel => !string.IsNullOrEmpty(Znacka) && !string.IsNullOrEmpty(Model) 
            ? $"{Znacka} {Model}" 
            : Model ?? Znacka ?? "Nezadano";
    }
}
