95 lines
2.0 KiB
C#
95 lines
2.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using gehGassi.Domain.Base;
|
|
using gehGassi.Domain.Common;
|
|
|
|
namespace gehGassi.Domain.Payment
|
|
{
|
|
/// <summary>
|
|
/// Repräsentiert eine Wallet eines App-Users
|
|
/// </summary>
|
|
public class Wallet : SyncEntity, IAuditable
|
|
{
|
|
/// <summary>
|
|
/// Id des App-Users
|
|
/// </summary>
|
|
[Required]
|
|
[MaxLength(128)]
|
|
public string AppUserId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Id des Wallets bei MangoPay
|
|
/// </summary>
|
|
[Required]
|
|
[MaxLength(255)]
|
|
public string WalletId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Typ des Wallets
|
|
/// </summary>
|
|
[Required]
|
|
public WalletType Type { get; set; }
|
|
|
|
/// <summary>
|
|
/// Id des Payment-Users bei MangoPay
|
|
/// </summary>
|
|
[Required]
|
|
[MaxLength(255)]
|
|
public string OwnerId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Währung ISO 4217 Code
|
|
/// </summary>
|
|
[Required]
|
|
[MaxLength(3)]
|
|
public string Currency { get; set; }
|
|
|
|
/// <summary>
|
|
/// Kontostand des Wallets in der kleinsten Einheit der Währung
|
|
/// Beispiel: 12.60 EUR werden als 1260 übertragen
|
|
/// </summary>
|
|
[Required]
|
|
public long Balance { get; set; }
|
|
|
|
/// <summary>
|
|
/// Beschreibung des Wallets
|
|
/// </summary>
|
|
[MaxLength(255)]
|
|
public string Description { get; set; }
|
|
|
|
|
|
#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 "Wallets";
|
|
}
|
|
|
|
public AuditableOptions Options()
|
|
{
|
|
return AuditableOptions.Create | AuditableOptions.Edit | AuditableOptions.Delete;
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
|
|
|
|
}
|