This commit introduces new payment types, including "MangoPay" and "Cash", to the localization resource files for both German and English. A new enum `WalkPaymentType` is created to represent these payment types, and the `Walk` class is updated to include a required `PaymentType` property of this enum type. The database context is modified to add a `PaymentType` column to the `Walks` table, accompanied by a migration to implement this change and set a default value. The `WalkController` is updated to support filtering by the new `PaymentType` field, and the mapping profile is enhanced to include mappings for `WalkPaymentType` and its view model counterpart. View models are also updated to incorporate the new `PaymentType` and its display name. Front-end TypeScript files are adjusted to utilize the new `WalkPaymentType` enum and related properties, while the UI is enhanced to display the payment type in the details view of walks. Version numbers in various configuration files are incremented to reflect these changes.
505 lines
14 KiB
C#
505 lines
14 KiB
C#
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 gehGassi.Domain.Base;
|
||
using gehGassi.Domain.Common;
|
||
using gehGassi.Domain.Dogs;
|
||
using gehGassi.Domain.Ratings;
|
||
using NetTopologySuite.Geometries;
|
||
|
||
namespace gehGassi.Domain.Walks
|
||
{
|
||
/// <summary>
|
||
/// Repräsentiert einen Walk
|
||
/// </summary>
|
||
public class Walk : SyncEntity, IAuditable
|
||
{
|
||
/// <summary>
|
||
/// Art der Walk Anfrage
|
||
/// </summary>
|
||
[Required]
|
||
public WalkType Type { get; set; }
|
||
|
||
/// <summary>
|
||
/// Welche Art von Service soll durchgeführt werden
|
||
/// </summary>
|
||
[Required]
|
||
public WalkServiceType ServiceType { get; set; }
|
||
|
||
/// <summary>
|
||
/// Id des Walkers
|
||
/// </summary>
|
||
[Required]
|
||
[MaxLength(128)]
|
||
public string DogWalkerId { get; set; }
|
||
|
||
/// <summary>
|
||
/// Id des Hundebesitzers
|
||
/// </summary>
|
||
[Required]
|
||
[MaxLength(128)]
|
||
public string DogOwnerId { get; set; }
|
||
|
||
/// <summary>
|
||
/// Id der öffentlichen Anfrage, wenn über diese erstellt
|
||
/// </summary>
|
||
[MaxLength(128)]
|
||
public string PublicWalkRequestId { get; set; }
|
||
|
||
/// <summary>
|
||
/// Jsonliste mit Id´s der Hunde die ausgewählt wurden
|
||
/// </summary>
|
||
public string DogsJson { get; set; }
|
||
|
||
/// <summary>
|
||
/// Anzahl der Hunde
|
||
/// </summary>
|
||
[Required]
|
||
public int DogCount { get; set; }
|
||
|
||
/// <summary>
|
||
/// Startdatum des Walks mit Urhrzeit
|
||
/// </summary>
|
||
[Required]
|
||
public DateTimeOffset Start { get; set; }
|
||
|
||
/// <summary>
|
||
/// Enddatum des Walks mit Uhrzeit
|
||
/// </summary>
|
||
[Required]
|
||
public DateTimeOffset End { get; set; }
|
||
|
||
/// <summary>
|
||
/// Wo soll der Hunde abgeholt werden
|
||
/// </summary>
|
||
public Address PickupAddress { get; set; }
|
||
|
||
/// <summary>
|
||
/// Geo-Koordinaten der Abhol-Adresse
|
||
/// </summary>
|
||
public Point PickupLocation { get; set; }
|
||
|
||
/// <summary>
|
||
/// Wo soll der Hunde zurückgegeben werden werden
|
||
/// </summary>
|
||
public Address ReturnAddress { get; set; }
|
||
|
||
/// <summary>
|
||
/// Geo-Koordinaten der Rückgabe-Adresse
|
||
/// </summary>
|
||
public Point ReturnLocation { get; set; }
|
||
|
||
/// <summary>
|
||
/// Preis für den Walk / Das Sitting. Wird gesetzt und kann entweder fix sein (öffentliche Anfrage) oder errechnet
|
||
/// </summary>
|
||
public decimal Price { get; set; }
|
||
|
||
/// <summary>
|
||
/// Zusatzinfo für den Walk. Z.B. bei Susi klingeln
|
||
/// </summary>
|
||
[MaxLength(500)]
|
||
public string Info { get; set; }
|
||
|
||
/// <summary>
|
||
/// Status eines Walks
|
||
/// </summary>
|
||
[Required]
|
||
public WalkStatus Status { get; set; }
|
||
|
||
/// <summary>
|
||
/// Wann wurde der Walk / Sitting gestartet?
|
||
/// </summary>
|
||
public DateTimeOffset? Started { get; set; }
|
||
|
||
/// <summary>
|
||
/// Wann wurde der Walk / Sitting beendet?
|
||
/// </summary>
|
||
public DateTimeOffset? Completed { get; set; }
|
||
|
||
/// <summary>
|
||
/// Wann wurde der Walk / Sitting bestätigt?
|
||
/// </summary>
|
||
public DateTimeOffset? Confirmed { get; set; }
|
||
|
||
/// <summary>
|
||
/// Wann wurde der Walk / Sitting reklamiert?
|
||
/// </summary>
|
||
public DateTimeOffset? Complained { get; set; }
|
||
|
||
/// <summary>
|
||
/// Optional: Grund für die Reklamation
|
||
/// </summary>
|
||
[MaxLength(500)]
|
||
public string ComplainReason { get; set; }
|
||
|
||
#region Status Infos
|
||
|
||
/// <summary>
|
||
/// Optional: Grund für die Ablehnung
|
||
/// </summary>
|
||
[MaxLength(500)]
|
||
public string DeclinedReason { get; set; }
|
||
|
||
/// <summary>
|
||
/// Optional: Grund für die Stornierung
|
||
/// </summary>
|
||
[MaxLength(500)]
|
||
public string CancelledReason { get; set; }
|
||
|
||
/// <summary>
|
||
/// Wer hat eine Stornierung durchgeführt
|
||
/// </summary>
|
||
[Required]
|
||
public CancellationSource CancelledBy { get; set; }
|
||
|
||
/// <summary>
|
||
/// Anmerkungen vom Walker nach dem Abschluss
|
||
/// </summary>
|
||
[MaxLength(500)]
|
||
public string CompletedInfo { get; set; }
|
||
|
||
/// <summary>
|
||
/// Kotabsatz?
|
||
/// </summary>
|
||
[Required]
|
||
public bool Defactation { get; set; }
|
||
|
||
#endregion
|
||
|
||
#region Payment
|
||
|
||
/// <summary>
|
||
/// Zahlungsstatus des Walks
|
||
/// </summary>
|
||
[Required]
|
||
public PaymentStatus PaymentStatus { get; set; }
|
||
|
||
/// <summary>
|
||
/// Welche Art von Bezahlung wurde verwendet
|
||
/// </summary>
|
||
[Required]
|
||
public WalkPaymentType PaymentType { get; set; }
|
||
|
||
/// <summary>
|
||
/// Id des Gutscheins der verwendet wurde, wenn einer verwendet wurde
|
||
/// </summary>
|
||
[MaxLength(128)]
|
||
public string? VoucherId { get; set; }
|
||
|
||
/// <summary>
|
||
/// Wert des Gutscheins - real verwendeter Wert
|
||
/// </summary>
|
||
public decimal VoucherAmmount { get; set; }
|
||
|
||
#endregion
|
||
|
||
/// <summary>
|
||
/// Datum der Erstellung des Walks
|
||
/// </summary>
|
||
[Required]
|
||
public DateTimeOffset Created { get; set; }
|
||
|
||
public Walk()
|
||
{
|
||
PickupLocation = new Point(0, 0);
|
||
ReturnLocation = new Point(0, 0);
|
||
}
|
||
|
||
#region IAuditable
|
||
/// <summary>
|
||
/// Gibt den eindeutigen Key für die Entität zurück;
|
||
/// Hier als String gelöst, weil damit auch kombinierte Schlüssel möglich sind.
|
||
/// </summary>
|
||
/// <returns>Eindeutiger Key</returns>
|
||
public string AuditKey()
|
||
{
|
||
return Id.ToString();
|
||
}
|
||
|
||
/// <summary>
|
||
/// Gibt den Objektnamen bzw. die Tabelle der Entität zurück
|
||
/// </summary>
|
||
/// <returns>Objektnamen</returns>
|
||
public string AuditTable()
|
||
{
|
||
return "Walks";
|
||
}
|
||
|
||
public AuditableOptions Options()
|
||
{
|
||
return AuditableOptions.Create | AuditableOptions.Edit | AuditableOptions.Delete;
|
||
}
|
||
|
||
#endregion
|
||
}
|
||
|
||
/// <summary>
|
||
/// Repräsentiert einen Walk mit Namen und Objekten aufgelöst
|
||
/// </summary>
|
||
public class WalkWithNames : SyncEntityVw
|
||
{
|
||
/// <summary>
|
||
/// Art der Walk Anfrage
|
||
/// </summary>
|
||
public WalkType Type { get; set; }
|
||
|
||
/// <summary>
|
||
/// Welche Art von Service soll durchgeführt werden
|
||
/// </summary>
|
||
public WalkServiceType ServiceType { get; set; }
|
||
|
||
/// <summary>
|
||
/// Id des Walkers
|
||
/// </summary>
|
||
public string DogWalkerId { get; set; }
|
||
|
||
/// <summary>
|
||
/// Name des DogWalkers
|
||
/// </summary>
|
||
public string DogWalkerName { get; set; }
|
||
|
||
/// <summary>
|
||
/// Foto des Dogwalkers
|
||
/// </summary>
|
||
public string DogWalkerPhoto { get; set; }
|
||
|
||
/// <summary>
|
||
/// Walker gesperrt
|
||
/// </summary>
|
||
public bool DogWalkerLocked { get; set; }
|
||
|
||
/// <summary>
|
||
/// Walker blockiert
|
||
/// </summary>
|
||
public bool DogWalkerBlocked { get; set; }
|
||
|
||
/// <summary>
|
||
/// Id des Hundebesitzers
|
||
/// </summary>
|
||
public string DogOwnerId { get; set; }
|
||
|
||
/// <summary>
|
||
/// Name des Hundebesitzers
|
||
/// </summary>
|
||
public string DogOwnerName { get; set; }
|
||
|
||
/// <summary>
|
||
/// Foto des Hundebesitzers
|
||
/// </summary>
|
||
public string DogOwnerPhoto { get; set; }
|
||
|
||
/// <summary>
|
||
/// Hundebesitzer gesperrt
|
||
/// </summary>
|
||
public bool DogOwnerLocked { get; set; }
|
||
|
||
/// <summary>
|
||
/// Hundebesitzer blockiert
|
||
/// </summary>
|
||
public bool DogOwnerBlocked { get; set; }
|
||
|
||
/// <summary>
|
||
/// Id der öffentlichen Anfrage, wenn über diese erstellt
|
||
/// </summary>
|
||
public string PublicWalkRequestId { get; set; }
|
||
|
||
/// <summary>
|
||
/// Jsonliste mit Id´s der Hunde die ausgewählt wurden
|
||
/// </summary>
|
||
public string DogsJson { get; set; }
|
||
|
||
/// <summary>
|
||
/// Liste der Hunde
|
||
/// </summary>
|
||
[NotMapped]
|
||
public List<DogMinInfo> Dogs { get; set; }
|
||
|
||
/// <summary>
|
||
/// Anzahl der Hunde
|
||
/// </summary>
|
||
public int DogCount { get; set; }
|
||
|
||
/// <summary>
|
||
/// Startdatum des Walks mit Urhrzeit
|
||
/// </summary>
|
||
public DateTimeOffset Start { get; set; }
|
||
|
||
/// <summary>
|
||
/// Enddatum des Walks mit Uhrzeit
|
||
/// </summary>
|
||
public DateTimeOffset End { get; set; }
|
||
|
||
/// <summary>
|
||
/// Abholadresse - Adresszeile 1
|
||
/// </summary>
|
||
public string PickupAddress_AddressLine1 { get; set; }
|
||
|
||
/// <summary>
|
||
/// Abholadresse - Adresszeile 2
|
||
/// </summary>
|
||
public string PickupAddress_AddressLine2 { get; set; }
|
||
|
||
/// <summary>
|
||
/// Abholadresse - Stadt / Ort
|
||
/// </summary>
|
||
public string PickupAddress_City { get; set; }
|
||
|
||
/// <summary>
|
||
/// Abholadresse - PLZ
|
||
/// </summary>
|
||
public string PickupAddress_Zip { get; set; }
|
||
|
||
/// <summary>
|
||
/// Abholadresse - Bundesland / Staat
|
||
/// </summary>
|
||
public string PickupAddress_State { get; set; }
|
||
|
||
/// <summary>
|
||
/// Abholadresse - ISO2 Ländercode
|
||
/// </summary>
|
||
public string PickupAddress_CountryCode { get; set; }
|
||
|
||
/// <summary>
|
||
/// Geo-Koordinaten der Abhol-Adresse
|
||
/// </summary>
|
||
public Point PickupLocation { get; set; }
|
||
|
||
/// <summary>
|
||
/// RückgabeAdresse - Adresszeile 1
|
||
/// </summary>
|
||
public string ReturnAddress_AddressLine1 { get; set; }
|
||
|
||
/// <summary>
|
||
/// RückgabeAdresse - Adresszeile 2
|
||
/// </summary>
|
||
public string ReturnAddress_AddressLine2 { get; set; }
|
||
|
||
/// <summary>
|
||
/// RückgabeAdresse - Stadt / Ort
|
||
/// </summary>
|
||
public string ReturnAddress_City { get; set; }
|
||
|
||
/// <summary>
|
||
/// RückgabeAdresse - PLZ
|
||
/// </summary>
|
||
public string ReturnAddress_Zip { get; set; }
|
||
|
||
/// <summary>
|
||
/// RückgabeAdresse - Bundesland / Staat
|
||
/// </summary>
|
||
public string ReturnAddress_State { get; set; }
|
||
|
||
/// <summary>
|
||
/// RückgabeAdresse - ISO2 Ländercode
|
||
/// </summary>
|
||
public string ReturnAddress_CountryCode { get; set; }
|
||
|
||
/// <summary>
|
||
/// Geo-Koordinaten der Rückgabe-Adresse
|
||
/// </summary>
|
||
public Point ReturnLocation { get; set; }
|
||
|
||
/// <summary>
|
||
/// Preis für den Walk / Das Sitting. Wird gesetzt und kann entweder fix sein (öffentliche Anfrage) oder errechnet
|
||
/// </summary>
|
||
public decimal Price { get; set; }
|
||
|
||
/// <summary>
|
||
/// Zusatzinfo für den Walk. Z.B. bei Susi klingeln
|
||
/// </summary>
|
||
public string Info { get; set; }
|
||
|
||
/// <summary>
|
||
/// Status eines Walks
|
||
/// </summary>
|
||
public WalkStatus Status { get; set; }
|
||
|
||
/// <summary>
|
||
/// Wann wurde der Walk / Sitting gestartet?
|
||
/// </summary>
|
||
public DateTimeOffset? Started { get; set; }
|
||
|
||
/// <summary>
|
||
/// Wann wurde der Walk / Sitting beendet?
|
||
/// </summary>
|
||
public DateTimeOffset? Completed { get; set; }
|
||
|
||
/// <summary>
|
||
/// Wann wurde der Walk / Sitting bestätigt?
|
||
/// </summary>
|
||
public DateTimeOffset? Confirmed { get; set; }
|
||
|
||
/// <summary>
|
||
/// Wann wurde der Walk / Sitting reklamiert?
|
||
/// </summary>
|
||
public DateTimeOffset? Complained { get; set; }
|
||
|
||
/// <summary>
|
||
/// Optional: Grund für die Reklamation
|
||
/// </summary>
|
||
public string ComplainReason { get; set; }
|
||
|
||
#region Status Infos
|
||
|
||
/// <summary>
|
||
/// Optional: Grund für die Ablehnung
|
||
/// </summary>
|
||
public string DeclinedReason { get; set; }
|
||
|
||
/// <summary>
|
||
/// Optional: Grund für die Stornierung
|
||
/// </summary>
|
||
public string CancelledReason { get; set; }
|
||
|
||
/// <summary>
|
||
/// Wer hat eine Stornierung durchgeführt
|
||
/// </summary>
|
||
public CancellationSource CancelledBy { get; set; }
|
||
|
||
/// <summary>
|
||
/// Anmerkungen vom Walker nach dem Abschluss
|
||
/// </summary>
|
||
public string CompletedInfo { get; set; }
|
||
|
||
/// <summary>
|
||
/// Kotabsatz?
|
||
/// </summary>
|
||
public bool Defactation { get; set; }
|
||
|
||
#endregion
|
||
|
||
#region Payment
|
||
|
||
/// <summary>
|
||
/// Zahlungsstatus des Walks
|
||
/// </summary>
|
||
public PaymentStatus PaymentStatus { get; set; }
|
||
|
||
/// <summary>
|
||
/// Welche Art von Bezahlung wurde verwendet
|
||
/// </summary>
|
||
public WalkPaymentType PaymentType { get; set; }
|
||
|
||
/// <summary>
|
||
/// Id des Gutscheins der verwendet wurde, wenn einer verwendet wurde
|
||
/// </summary>
|
||
public string? VoucherId { get; set; }
|
||
|
||
/// <summary>
|
||
/// Wert des Gutscheins - real verwendeter Wert
|
||
/// </summary>
|
||
public decimal VoucherAmmount { get; set; }
|
||
|
||
#endregion
|
||
|
||
/// <summary>
|
||
/// Datum der Erstellung des Walks
|
||
/// </summary>
|
||
public DateTimeOffset Created { get; set; }
|
||
}
|
||
}
|