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

namespace dealer
{
    public class Owner
    {
        public Guid Id { get; set; } = Guid.NewGuid();
        public string? Jmeno { get; set; }
        public string? Prijmeni { get; set; }
        public string? Adresa { get; set; }
        public string? Telefon { get; set; }
        public string? Email { get; set; }

        public string CeleJmeno => $"{Jmeno} {Prijmeni}".Trim();
        
        public string DisplayText => string.IsNullOrEmpty(CeleJmeno) 
            ? Email ?? Telefon ?? "Neznamy vlastnik" 
            : CeleJmeno;

        public override string ToString() => DisplayText;
    }
}
