using gehGassiApp.Domain.Base; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; using gehGassiApp.Domain.Common; namespace gehGassiApp.Domain.Users { /// /// Repräsentiert das Profil eines DogWalkers /// public class DogWalkerProfile : SyncEntity { private double _radius; private string _about; private DogWalkRequestType _allowedRequests; private bool _puppyAllowed; private bool _difficultAllowed; private DogAggressionLevel _aggressionLevel; private DogSize _acceptedSize; private decimal _priceWalk; private decimal _priceDay; private decimal _priceSitting; private bool _notAvailable; private string _notAvailableInfo; /// /// Radius für Anfragen /// [Required] public double Radius { get => _radius; set { _radius = value; OnPropertyChanged(); } } /// /// Über mich /// [MaxLength(300)] public string About { get => _about; set { _about = value; OnPropertyChanged(); } } /// /// Welche Anfragen erlauben /// [Required] public DogWalkRequestType AllowedRequests { get => _allowedRequests; set { _allowedRequests = value; OnPropertyChanged(); OnPropertyChanged(nameof(ProfileNotFinished)); } } /// /// nimmt Welpen an /// [Required] public bool PuppyAllowed { get => _puppyAllowed; set { _puppyAllowed = value; OnPropertyChanged(); } } /// /// Nimmt schwierige Hunde an /// [Required] public bool DifficultAllowed { get => _difficultAllowed; set { _difficultAllowed = value; OnPropertyChanged(); } } /// /// Aggressionsgrad des Hundes, wenn schwierige Hunde errlaubt /// [Required] public DogAggressionLevel AggressionLevel { get => _aggressionLevel; set { _aggressionLevel = value; OnPropertyChanged(); } } /// /// Akzeptierte Hundegröße /// [Required] public DogSize AcceptedSize { get => _acceptedSize; set { _acceptedSize = value; OnPropertyChanged(); } } /// /// Preis für einen Walk je Stunde /// [Required] public decimal PriceWalk { get => _priceWalk; set { _priceWalk = value; OnPropertyChanged(); OnPropertyChanged(nameof(ProfileNotFinished)); } } /// /// Preis für Tagesbetreuung je Stunde /// [Required] public decimal PriceDay { get => _priceDay; set { _priceDay = value; OnPropertyChanged(); OnPropertyChanged(nameof(ProfileNotFinished)); } } /// /// Preis für Sitting je Tag /// [Required] public decimal PriceSitting { get => _priceSitting; set { _priceSitting = value; OnPropertyChanged(); OnPropertyChanged(nameof(ProfileNotFinished)); } } /// /// Walker ist derzeit für Buchungen nicht verfügbar /// [Required] public bool NotAvailable { get => _notAvailable; set { _notAvailable = value; OnPropertyChanged(); } } /// /// Optional: Info warum nicht verfügbar /// [MaxLength(500)] public string NotAvailableInfo { get => _notAvailableInfo; set { _notAvailableInfo = value; OnPropertyChanged(); } } /// /// Gibt an ob der Benutzer das Profile noch nicht abgeschlossen hat /// public bool ProfileNotFinished { get { //Prüfen ob im Profil noch Daten fehlen var notFinished = false; if (AllowedRequests == DogWalkRequestType.None) notFinished = true; else if (AllowedRequests is DogWalkRequestType.Walking or DogWalkRequestType.Both && PriceWalk == 0) notFinished = true; else if (AllowedRequests is DogWalkRequestType.Sitting or DogWalkRequestType.Both && PriceDay == 0) notFinished = true; else if (AllowedRequests is DogWalkRequestType.Sitting or DogWalkRequestType.Both && PriceSitting == 0) notFinished = true; if (Radius < 1) notFinished = true; return notFinished; } } } }