2021-12-06 02:49:27 +03:00
|
|
|
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using BlueWest.Collections;
|
|
|
|
|
using MapTo;
|
|
|
|
|
using MessagePack;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
|
|
|
|
namespace BlueWest.Data
|
|
|
|
|
{
|
|
|
|
|
[MessagePackObject]
|
|
|
|
|
[MapFrom(typeof(UserUpdateDto))]
|
2021-12-08 04:43:29 +03:00
|
|
|
|
public partial struct User
|
2021-12-06 02:49:27 +03:00
|
|
|
|
{
|
2021-12-08 04:43:29 +03:00
|
|
|
|
[Key(1)]public int Id { get; }
|
|
|
|
|
[Key(2)]public string Name { get; set; }
|
|
|
|
|
[Key(3)]public string Address { get; set; }
|
2021-12-06 02:49:27 +03:00
|
|
|
|
|
2021-12-08 04:43:29 +03:00
|
|
|
|
[Key(4)]public string BTCAddress { get; set; }
|
|
|
|
|
[Key(5)]public string LTCAddress { get; set; }
|
2021-12-06 02:49:27 +03:00
|
|
|
|
|
2021-12-08 04:43:29 +03:00
|
|
|
|
[Key(6)]public double BTCAmount { get; set; }
|
|
|
|
|
[Key(7)]public double LTCAmount { get; set; }
|
2021-12-06 02:49:27 +03:00
|
|
|
|
|
2021-12-08 04:43:29 +03:00
|
|
|
|
[Key(8)] public List<FinanceTransaction> FinanceTransactions { get; set; }
|
2021-12-06 02:49:27 +03:00
|
|
|
|
|
|
|
|
|
public User(int id, string name, string address, string btcAddress, string ltcAddress, double btcAmount, double ltcAmount, List<FinanceTransaction> financeTransactions)
|
|
|
|
|
{
|
|
|
|
|
Id = id;
|
|
|
|
|
Name = name;
|
|
|
|
|
Address = address;
|
|
|
|
|
BTCAddress = btcAddress;
|
|
|
|
|
LTCAddress = ltcAddress;
|
|
|
|
|
BTCAmount = btcAmount;
|
|
|
|
|
LTCAmount = ltcAmount;
|
|
|
|
|
FinanceTransactions = financeTransactions;
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-08 02:57:27 +03:00
|
|
|
|
public void AddTransaction(FinanceTransaction financeTransaction)
|
|
|
|
|
{
|
|
|
|
|
FinanceTransactions.Add(financeTransaction);
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-06 02:49:27 +03:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|