129 lines
3.6 KiB
C#
129 lines
3.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace gehGassiApp.Domain.Common
|
|
{
|
|
/// <summary>
|
|
/// App-User-Blockierung mit Namen aufgelöst
|
|
/// </summary>
|
|
public class AppUserBlockWithNames
|
|
{
|
|
/// <summary>
|
|
/// Id der Blockierung
|
|
/// </summary>
|
|
public long Id { get; set; }
|
|
|
|
/// <summary>
|
|
/// Id des App-Users der die Blockierung erstellt hat
|
|
/// </summary>
|
|
public string BlockingAppUserId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Id des App-Users der blockiert wurde
|
|
/// </summary>
|
|
public string? BlockedAppUserId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Wie lange ist die Blockierung gültig?
|
|
/// Wenn null, dann dauerhaft
|
|
/// </summary>
|
|
public DateTimeOffset? BlockedUntil { get; set; }
|
|
|
|
/// <summary>
|
|
/// Optional: Verweis auf einen AppUserReport
|
|
/// </summary>
|
|
public long? AppUserReportId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Erstellt von?
|
|
/// </summary>
|
|
public string CreatedBy { get; set; }
|
|
|
|
/// <summary>
|
|
/// Wann wurde die Blockierung erstellt?
|
|
/// </summary>
|
|
public DateTimeOffset Created { get; set; }
|
|
|
|
/// <summary>
|
|
/// Art des App-Users
|
|
/// </summary>
|
|
public AppUserType Type { get; set; }
|
|
|
|
/// <summary>
|
|
/// Vorname
|
|
/// </summary>
|
|
public string FirstName { get; set; }
|
|
|
|
/// <summary>
|
|
/// Nachname
|
|
/// </summary>
|
|
public string LastName { get; set; }
|
|
|
|
/// <summary>
|
|
/// Optional - Foto des Benutzers
|
|
/// </summary>
|
|
public string Photo { get; set; }
|
|
|
|
/// <summary>
|
|
/// Hinweis auf den Ort wo jemand zu Hause ist
|
|
/// </summary>
|
|
public string LocationHint { get; set; }
|
|
|
|
/// <summary>
|
|
/// Breitengrad der Adresse
|
|
/// </summary>
|
|
public double Lat { get; set; }
|
|
|
|
/// <summary>
|
|
/// Längengrad der Adresse
|
|
/// </summary>
|
|
public double Lng { get; set; }
|
|
|
|
/// <summary>
|
|
/// Distanz zum Lookup
|
|
/// </summary>
|
|
public double Distance { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gesperrt
|
|
/// </summary>
|
|
public bool Locked { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gesperrt
|
|
/// </summary>
|
|
public bool Deleted { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gibt die Initialien zurück
|
|
/// </summary>
|
|
public string Initials
|
|
{
|
|
get
|
|
{
|
|
if (!string.IsNullOrWhiteSpace(FirstName) && !string.IsNullOrWhiteSpace(LastName))
|
|
return $"{FirstName.Substring(0, 1)}{LastName.Substring(0, 1)}";
|
|
else if (!string.IsNullOrWhiteSpace(FirstName) && FirstName.Length >= 2 && string.IsNullOrWhiteSpace(LastName))
|
|
return $"{FirstName.Substring(0, 2)}";
|
|
else if (string.IsNullOrWhiteSpace(FirstName) && string.IsNullOrWhiteSpace(LastName) && LastName.Length >= 2)
|
|
return $"{LastName.Substring(0, 2)}";
|
|
else
|
|
return "??";
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Voller Name
|
|
/// </summary>
|
|
public string FullName => $"{FirstName} {LastName}";
|
|
|
|
/// <summary>
|
|
/// Vorname + Nachname erster Buchstabe + Punkt, oder nur Vorname wenn kein Nachname
|
|
/// </summary>
|
|
public string FullNameShort => string.IsNullOrWhiteSpace(LastName) ? FirstName : $"{FirstName} {LastName[..1]}.";
|
|
}
|
|
}
|