133 lines
3.3 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using gehGassiApp.Domain.Base;
using gehGassiApp.Domain.Common;
namespace gehGassiApp.Domain.Lookup
{
/// <summary>
/// Repräsentiert Detail-Infos zu einem DogOwner
/// </summary>
public class DogOwnerInfo : SyncEntity
{
/// <summary>
/// Art des App-Users
/// </summary>
public AppUserType Type { get; set; }
/// <summary>
/// Nummer des App-Users
/// </summary>
public string Number { get; set; }
/// <summary>
/// Anrede / titel
/// </summary>
public string Title { get; set; }
/// <summary>
/// Vorname
/// </summary>
public string FirstName { get; set; }
/// <summary>
/// Nachname
/// </summary>
public string LastName { get; set; }
/// <summary>
/// Geschlecht
/// </summary>
public Sex Sex { get; set; }
/// <summary>
/// Optional - Geburtstag
/// </summary>
public DateTimeOffset? BirthDate { get; set; }
/// <summary>
/// Optional - Foto des Benutzers
/// </summary>
public string Photo { get; set; }
/// <summary>
/// Kontaktdaten
/// </summary>
public ContactMin Contact { get; set; }
/// <summary>
/// Adresse
/// </summary>
public Address Address { get; set; }
/// <summary>
/// Breitengrad der Adresse
/// </summary>
public double Lat { get; set; }
/// <summary>
/// Längengrad der Adresse
/// </summary>
public double Lng { get; set; }
/// <summary>
/// Interne Anmerkungen
/// </summary>
public string Comment { get; set; }
/// <summary>
/// Statistiken als Owner
/// </summary>
public RatingStatistics RatingStatistics { get; set; }
/// <summary>
/// Datum der Erstellung
/// </summary>
public DateTimeOffset Created { get; set; }
/// <summary>
/// Abstand zum aktuellen Standort in KM
/// </summary>
[NotMapped]
public double Distance { get; set; }
/// <summary>
/// Voller Name des Walkers
/// </summary>
[NotMapped]
public string FullName => $"{FirstName} {LastName}";
/// <summary>
/// Vorname + Nachname erster Buchstabe + Punkt, oder nur Vorname wenn kein Nachname
/// </summary>
[NotMapped]
public string FullNameShort => string.IsNullOrWhiteSpace(LastName) ? FirstName : $"{FirstName} {LastName[..1]}.";
#region Erweiterung Blockier- und Sperrinfo
/// <summary>
/// Hundebesitzer ist blockiert
/// </summary>
[NotMapped]
public bool Blocked { get; set; }
/// <summary>
/// Hundebesitzer ist gesperrt
/// </summary>
[NotMapped]
public bool Locked { get; set; }
/// <summary>
/// Hundebesitzer blockiert oder gesperrt?
/// </summary>
[NotMapped]
public bool BlockedOrLocked => Blocked || Locked;
#endregion
}
}