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