mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 22:44:29 +01:00
Refactor labels (#4179)
* Create new tables * wip * wip * Refactor LegacyLabel * Remove LabelFactory * Add migration * wip * wip * Add pull-payment attachment to tx * Address kukks points
This commit is contained in:
@@ -15,9 +15,9 @@ namespace BTCPayServer.Models.WalletViewModels
|
||||
public string Link { get; set; }
|
||||
public bool Positive { get; set; }
|
||||
public string Balance { get; set; }
|
||||
public HashSet<ColoredLabel> Labels { get; set; } = new HashSet<ColoredLabel>();
|
||||
public HashSet<TransactionTagModel> Tags { get; set; } = new HashSet<TransactionTagModel>();
|
||||
}
|
||||
public HashSet<ColoredLabel> Labels { get; set; } = new HashSet<ColoredLabel>();
|
||||
public HashSet<(string Text, string Color, string TextColor)> Labels { get; set; } = new HashSet<(string Text, string Color, string TextColor)>();
|
||||
public List<TransactionViewModel> Transactions { get; set; } = new List<TransactionViewModel>();
|
||||
public override int CurrentPageCount => Transactions.Count;
|
||||
public string CryptoCode { get; set; }
|
||||
|
||||
40
BTCPayServer/Models/WalletViewModels/TransactionTagModel.cs
Normal file
40
BTCPayServer/Models/WalletViewModels/TransactionTagModel.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
|
||||
namespace BTCPayServer.Models.WalletViewModels
|
||||
{
|
||||
public class TransactionTagModel
|
||||
{
|
||||
public string Text { get; internal set; }
|
||||
public string Color { get; internal set; }
|
||||
public string TextColor { get; internal set; }
|
||||
public string Link { get; internal set; }
|
||||
public string Tooltip { get; internal set; } = String.Empty;
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
TransactionTagModel item = obj as TransactionTagModel;
|
||||
if (item == null)
|
||||
return false;
|
||||
return Text.Equals(item.Text, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
public static bool operator ==(TransactionTagModel a, TransactionTagModel b)
|
||||
{
|
||||
if (System.Object.ReferenceEquals(a, b))
|
||||
return true;
|
||||
if (((object)a == null) || ((object)b == null))
|
||||
return false;
|
||||
return a.Text == b.Text;
|
||||
}
|
||||
|
||||
public static bool operator !=(TransactionTagModel a, TransactionTagModel b)
|
||||
{
|
||||
return !(a == b);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Text.GetHashCode(StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -73,7 +73,7 @@ namespace BTCPayServer.Models.WalletViewModels
|
||||
|
||||
public class InputSelectionOption
|
||||
{
|
||||
public IEnumerable<ColoredLabel> Labels { get; set; }
|
||||
public IEnumerable<TransactionTagModel> Labels { get; set; }
|
||||
public string Comment { get; set; }
|
||||
public decimal Amount { get; set; }
|
||||
public string Outpoint { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user