using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; 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.Walks { /// /// Repräsentiert eine Antwort auf eine öffentliche Anfrage /// public class PublicWalkResponse : SyncEntity { private decimal _price; private string _info; private string _answer; private PublicWalkResponseStatus _status; private string _cancellationReason; /// /// Id der öffentlichen Anfrage /// [MaxLength(128)] public string PublicWalkRequestId { get; set; } /// /// Id des App-Users / Walker /// Ist eine AppUserId /// [MaxLength(128)] public string DogWalkerId { get; set; } /// /// Preis den der Walker anbietet /// [Required] public decimal Price { get => _price; set { _price = value; OnPropertyChanged(); } } /// /// Zusatzinfo für das Angebot /// [MaxLength(500)] public string Info { get => _info; set { _info = value; OnPropertyChanged(); } } /// /// Optional: Antwort des Hundebesitzers /// [MaxLength(500)] public string Answer { get => _answer; set { _answer = value; OnPropertyChanged(); } } /// /// Status des Angebotes /// public PublicWalkResponseStatus Status { get => _status; set { _status = value; OnPropertyChanged(); } } /// /// Grund für die Stornierung /// [MaxLength(500)] public string CancellationReason { get => _cancellationReason; set { _cancellationReason = value; OnPropertyChanged(); } } /// /// Wann wurde das Angebot erstellt? /// public DateTimeOffset Created { get; set; } } /// /// Antwort auf eine öffentliche Anfrage mit Namen aufgelöst /// public class PublicWalkResponseWithNames : SyncEntityVw { /// /// Id der öffentlichen Anfrage /// public string PublicWalkRequestId { get; set; } /// /// Id des App-Users / Walker /// Ist eine AppUserId /// public string DogWalkerId { get; set; } /// /// Name des DogWalkers /// public string DogWalkerName { get; set; } /// /// Foto des DogWalkers /// public string DogWalkerPhoto { get; set; } /// /// Dogwalker verifiziert? /// public bool DogWalkerVerified { get; set; } /// /// Dogwalker blockiert? /// [NotMapped] public bool DogWalkerBlocked { get; set; } /// /// Dogwalker gesperrt? /// [NotMapped] public bool DogWalkerLocked { get; set; } /// /// Blockiert oder gesperrt /// [NotMapped] public bool DogWalkerBlockedOrLocked => DogWalkerBlocked || DogWalkerLocked; /// /// Preis den der Walker anbietet /// [Required] public decimal Price { get; set; } /// /// Zusatzinfo für das Angebot /// public string Info { get; set; } /// /// Optional: Antwort des Hundebesitzers /// public string Answer { get; set; } /// /// Status des Angebotes /// public PublicWalkResponseStatus Status { get; set; } /// /// Grund für die Stornierung /// public string CancellationReason { get; set; } /// /// Wann wurde das Angebot erstellt? /// public DateTimeOffset Created { get; set; } /// /// Vorname + Nachname erster Buchstabe + Punkt, oder nur Vorname wenn kein Nachname /// [NotMapped] public string DogWalkerFullNameShort { get { if (!string.IsNullOrWhiteSpace(DogWalkerName)) { var parts = DogWalkerName.Split(" "); var firstName = parts[0]; var lastName = string.Empty; if (parts.Length > 1) lastName = parts[1]; return string.IsNullOrWhiteSpace(lastName) ? firstName : $"{firstName} {lastName[..1]}."; } return string.Empty; } } } }