2021-12-06 02:49:27 +03:00
|
|
|
|
using System;
|
2021-12-06 19:08:31 +03:00
|
|
|
|
using MapTo;
|
2021-12-06 02:49:27 +03:00
|
|
|
|
using MessagePack;
|
|
|
|
|
|
|
|
|
|
namespace BlueWest.Data
|
|
|
|
|
{
|
|
|
|
|
public enum FinanceSymbol
|
|
|
|
|
{
|
|
|
|
|
BTC_EUR,
|
|
|
|
|
BTC_BUSD,
|
|
|
|
|
BTC_USD,
|
|
|
|
|
BTC_USDT,
|
|
|
|
|
LTC_EUR,
|
|
|
|
|
LTC_BUSD,
|
|
|
|
|
LTC_USDT
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public enum FinanceTransactionType
|
|
|
|
|
{
|
|
|
|
|
Buy,
|
|
|
|
|
Sell
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[MessagePackObject]
|
2021-12-10 03:04:48 +03:00
|
|
|
|
[MapFrom(typeof(FinanceTransactionInsertDto))]
|
2021-12-06 19:27:46 +03:00
|
|
|
|
public partial struct FinanceTransaction
|
2021-12-06 02:49:27 +03:00
|
|
|
|
{
|
|
|
|
|
[Key(1)] public int Id { get; set; }
|
|
|
|
|
[Key(2)] public int UserId { get; set; }
|
|
|
|
|
[Key(3)] public FinanceTransactionType FinanceTransactionType { get; }
|
|
|
|
|
[Key(4)] public FinanceSymbol FinanceSymbol { get; }
|
|
|
|
|
[Key(5)] public double Amount { get; } // To Buy
|
|
|
|
|
[Key(6)] public double Quantity { get; } // Bought
|
|
|
|
|
[Key(7)] public double Fee { get; }
|
|
|
|
|
[Key(8)] public DateTime DateTime { get; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|