229 lines
5.8 KiB
C#

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
{
/// <summary>
/// Repräsentiert das Profil eines DogWalkers
/// </summary>
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;
/// <summary>
/// Radius für Anfragen
/// </summary>
[Required]
public double Radius
{
get => _radius;
set
{
_radius = value;
OnPropertyChanged();
}
}
/// <summary>
/// Über mich
/// </summary>
[MaxLength(300)]
public string About
{
get => _about;
set
{
_about = value;
OnPropertyChanged();
}
}
/// <summary>
/// Welche Anfragen erlauben
/// </summary>
[Required]
public DogWalkRequestType AllowedRequests
{
get => _allowedRequests;
set
{
_allowedRequests = value;
OnPropertyChanged();
OnPropertyChanged(nameof(ProfileNotFinished));
}
}
/// <summary>
/// nimmt Welpen an
/// </summary>
[Required]
public bool PuppyAllowed
{
get => _puppyAllowed;
set
{
_puppyAllowed = value;
OnPropertyChanged();
}
}
/// <summary>
/// Nimmt schwierige Hunde an
/// </summary>
[Required]
public bool DifficultAllowed
{
get => _difficultAllowed;
set
{
_difficultAllowed = value;
OnPropertyChanged();
}
}
/// <summary>
/// Aggressionsgrad des Hundes, wenn schwierige Hunde errlaubt
/// </summary>
[Required]
public DogAggressionLevel AggressionLevel
{
get => _aggressionLevel;
set
{
_aggressionLevel = value;
OnPropertyChanged();
}
}
/// <summary>
/// Akzeptierte Hundegröße
/// </summary>
[Required]
public DogSize AcceptedSize
{
get => _acceptedSize;
set
{
_acceptedSize = value;
OnPropertyChanged();
}
}
/// <summary>
/// Preis für einen Walk je Stunde
/// </summary>
[Required]
public decimal PriceWalk
{
get => _priceWalk;
set
{
_priceWalk = value;
OnPropertyChanged();
OnPropertyChanged(nameof(ProfileNotFinished));
}
}
/// <summary>
/// Preis für Tagesbetreuung je Stunde
/// </summary>
[Required]
public decimal PriceDay
{
get => _priceDay;
set
{
_priceDay = value;
OnPropertyChanged();
OnPropertyChanged(nameof(ProfileNotFinished));
}
}
/// <summary>
/// Preis für Sitting je Tag
/// </summary>
[Required]
public decimal PriceSitting
{
get => _priceSitting;
set
{
_priceSitting = value;
OnPropertyChanged();
OnPropertyChanged(nameof(ProfileNotFinished));
}
}
/// <summary>
/// Walker ist derzeit für Buchungen nicht verfügbar
/// </summary>
[Required]
public bool NotAvailable
{
get => _notAvailable;
set
{
_notAvailable = value;
OnPropertyChanged();
}
}
/// <summary>
/// Optional: Info warum nicht verfügbar
/// </summary>
[MaxLength(500)]
public string NotAvailableInfo
{
get => _notAvailableInfo;
set
{
_notAvailableInfo = value;
OnPropertyChanged();
}
}
/// <summary>
/// Gibt an ob der Benutzer das Profile noch nicht abgeschlossen hat
/// </summary>
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;
}
}
}
}