Files
bank-backend/src/IO.Swagger/Models/db/Transaction.cs

89 lines
2.6 KiB
C#

using System;
using System.ComponentModel.DataAnnotations;
namespace IO.Swagger.Models.db
{
/// <summary>
/// The basic unit of a transaction
/// </summary>
public class Transaction
{
/// <summary>
/// Gets or sets the transaction identifier.
/// </summary>
/// <value>
/// The transaction identifier.
/// </value>
public int TransactionId { get; set; }
/// <summary>
/// Gets or sets the user identifier of the wallet the money came from.
/// </summary>
/// <value>
/// From user identifier.
/// </value>
public int FromUserId { get; set; }
/// <summary>
/// Gets or sets the user that the money came from.
/// </summary>
/// <value>
/// From user.
/// </value>
public User FromUser { get; set; }
/// <summary>
/// Gets or sets the user identifier of the wallet the money went to.
/// </summary>
/// <value>
/// From user identifier.
/// </value>
public int ToUserId { get; set; }
/// <summary>
/// Gets or sets the user that the money went to.
/// </summary>
/// <value>
/// From user.
/// </value>
public User ToUser { get; set; }
/// <summary>
/// Gets or sets the amount exchanged in the transaction.
/// </summary>
/// <value>
/// The amount.
/// </value>
[Range(0.01, float.MaxValue)]
public float Amount { get; set; }
/// <summary>
/// Gets or sets the memo of the transaction.
/// </summary>
/// <value>
/// The memo.
/// </value>
[Required]
[StringLength(32, MinimumLength = 2)]
public string Memo { get; set; }
/// <summary>
/// Gets or sets the currency the transaction amount was issued in.
/// </summary>
/// <value>
/// The currency.
/// </value>
public Currency Currency { get; set; }
/// <summary>
/// Gets or sets the currency identifier the transaction amount was issued in.
/// </summary>
/// <value>
/// The currency identifier.
/// </value>
public int CurrencyId { get; set; }
/// <summary>
/// Gets or sets the time the transaction occured.
/// </summary>
/// <value>
/// The transaction time.
/// </value>
public DateTime TransactionTime { get; set; } = DateTime.UtcNow;
}
}