MapTo/test/TestConsoleApp/Data/FinanceTransaction.cs

58 lines
1.3 KiB
C#
Raw Normal View History

2021-12-08 21:20:51 +03:00
using System;
using MapTo;
namespace BlueWest.Data
{
public enum FinanceSymbol
{
BTC_EUR,
BTC_BUSD,
BTC_USD,
BTC_USDT,
LTC_EUR,
LTC_BUSD,
LTC_USDT
2021-12-12 03:10:13 +03:00
2021-12-08 21:20:51 +03:00
}
public enum FinanceTransactionType
{
Buy,
Sell
}
2021-12-11 14:51:54 +03:00
[MapFrom(typeof(FinanceTransactionInsertDto))]
2021-12-08 21:20:51 +03:00
public partial struct FinanceTransaction
{
2021-12-12 02:54:21 +03:00
public readonly int Id;
public readonly int UserId;
public readonly FinanceTransactionType FinanceTransactionType;
public readonly FinanceSymbol FinanceSymbol;
public readonly double Amount; // To Buy
public readonly double Quantity; // Bought
public readonly double Fee;
public readonly DateTime DateTime;
2021-12-08 21:20:51 +03:00
public FinanceTransaction(int id, int userId, FinanceTransactionType financeTransactionType,
FinanceSymbol financeSymbol, double amount, double quantity, double fee, DateTime dateTime)
{
Id = id;
UserId = userId;
FinanceTransactionType = financeTransactionType;
FinanceSymbol = financeSymbol;
Amount = amount;
Quantity = quantity;
Fee = fee;
DateTime = dateTime;
}
}
}