From 3da0f4eedc25d9511dccba26fb2e70b3ea8469ae Mon Sep 17 00:00:00 2001 From: John Colvin Date: Thu, 9 Jun 2022 00:05:05 -0400 Subject: [PATCH] ui: Indicate price discrep w/ subtler visual than qty discrep --- .../ReconcileReportMatchType.cs | 12 +++++ .../ReconcileReport/ReconcileReportRowVM.cs | 12 +++++ .../ReconcileReport/ReconcileReportView.xaml | 48 +++++++++++++++++-- 3 files changed, 67 insertions(+), 5 deletions(-) create mode 100644 src/client/spark/Modules/Trading/ReconcileReport/ReconcileReportMatchType.cs diff --git a/src/client/spark/Modules/Trading/ReconcileReport/ReconcileReportMatchType.cs b/src/client/spark/Modules/Trading/ReconcileReport/ReconcileReportMatchType.cs new file mode 100644 index 000000000..1b35dc2b6 --- /dev/null +++ b/src/client/spark/Modules/Trading/ReconcileReport/ReconcileReportMatchType.cs @@ -0,0 +1,12 @@ +#nullable enable + +namespace Spark.Trading { + using System; + + [Flags] + enum ReconcileReportMatchType { + None = 0, + Quantity = 1, + Price = 1 << 1 + } +} diff --git a/src/client/spark/Modules/Trading/ReconcileReport/ReconcileReportRowVM.cs b/src/client/spark/Modules/Trading/ReconcileReport/ReconcileReportRowVM.cs index f69b2e725..6303801f4 100644 --- a/src/client/spark/Modules/Trading/ReconcileReport/ReconcileReportRowVM.cs +++ b/src/client/spark/Modules/Trading/ReconcileReport/ReconcileReportRowVM.cs @@ -55,6 +55,18 @@ namespace Spark.Trading { public double exchange_quantity => _data.exch_quantity(); public double price => _data.sys_price(); public double exchange_price => _data.exch_price(); + public ReconcileReportMatchType match_type { + get { + var mt = ReconcileReportMatchType.None; + if (quantity.epsilon_equals(exchange_quantity)) { + mt |= ReconcileReportMatchType.Quantity; + } + if (price.epsilon_equals(exchange_price)) { + mt |= ReconcileReportMatchType.Price; + } + return mt; + } + } public bts.api.domain.TickDisplaySettingsImmutable quantity_display { get => _quantity_display; diff --git a/src/client/spark/Modules/Trading/ReconcileReport/ReconcileReportView.xaml b/src/client/spark/Modules/Trading/ReconcileReport/ReconcileReportView.xaml index 2ebb1c63d..1e759a06c 100644 --- a/src/client/spark/Modules/Trading/ReconcileReport/ReconcileReportView.xaml +++ b/src/client/spark/Modules/Trading/ReconcileReport/ReconcileReportView.xaml @@ -19,8 +19,10 @@ - - + + + + @@ -102,8 +104,42 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -159,6 +196,7 @@