Skip to content

Commit

Permalink
add kyc request url to broker order details page
Browse files Browse the repository at this point in the history
  • Loading branch information
djpnewton committed Sep 15, 2020
1 parent 8b85a78 commit 502429a
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 100 deletions.
6 changes: 6 additions & 0 deletions Controllers/ReportController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,18 @@ public IActionResult BrokerOrder(string token)
if (bof != null)
fiatTx = _walletProvider.GetFiat(brokerOrder.AssetReceive).GetTx(bof.DepositCode);
}
// get user kyc request
string kycRequestUrl = null;
var kycRequest = _context.KycRequests.Where(r => r.ApplicationUserId == brokerOrder.ApplicationUserId).OrderByDescending(r => r.Date).FirstOrDefault();
if (kycRequest != null)
kycRequestUrl = $"{_kycSettings.KycServerUrl}/request/{kycRequest.Token}";
var model = new BrokerOrderViewModel
{
User = user,
Order = brokerOrder,
ChainWithdrawal = pendingSpend,
FiatWithdrawal = fiatTx,
KycRequestUrl = kycRequestUrl,
AssetSettings = _settings.Assets
};
return View(model);
Expand Down
1 change: 1 addition & 0 deletions Models/ReportViewModels/BrokerViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class BrokerOrderViewModel : BaseViewModel
public BrokerOrder Order { set; get; }
public WalletPendingSpend ChainWithdrawal { get; set; }
public FiatWalletTx FiatWithdrawal { get; set; }
public string KycRequestUrl { get; set; }
public Dictionary<string, AssetSettings> AssetSettings { get; set; }
}
}
224 changes: 124 additions & 100 deletions Views/Report/BrokerOrder.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -55,117 +55,141 @@
</table>
</div>
</div>
@if (Model.ChainWithdrawal != null)
@if (Model.KycRequestUrl != null)
{
<div class="panel panel-default">
<div class="panel-heading">
Chain Withdrawal
<div class="panel panel-default">
<div class="panel-heading">
KYC
</div>
<div class="panel-body">
<table class="table table-condensed table-responsive table-hover">
<tr>
<th>
Kyc Request Url
</th>
</tr>
<tbody>
<tr>
<td>
@Model.KycRequestUrl
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="panel-body">
<table class="table table-condensed table-responsive table-hover">
<tr>
<th>
Spend Code
</th>
<th>
State
</th>
<th>
Error
</th>
<th>
Error Message
</th>
<th>
Amount
</th>
<th>
TxIds
</th>
</tr>
<tbody>
}
@if (Model.ChainWithdrawal != null)
{
<div class="panel panel-default">
<div class="panel-heading">
Chain Withdrawal
</div>
<div class="panel-body">
<table class="table table-condensed table-responsive table-hover">
<tr>
<td>
@Model.ChainWithdrawal.SpendCode
</td>
<td>
@Model.ChainWithdrawal.State
</td>
<td>
@Model.ChainWithdrawal.Error
</td>
<td>
@Model.ChainWithdrawal.ErrorMessage
</td>
<td>
@Model.ChainWithdrawal.Amount
</td>
<td>
@Model.ChainWithdrawal.TxIds
</td>
<th>
Spend Code
</th>
<th>
State
</th>
<th>
Error
</th>
<th>
Error Message
</th>
<th>
Amount
</th>
<th>
TxIds
</th>
</tr>
</tbody>
</table>
<tbody>
<tr>
<td>
@Model.ChainWithdrawal.SpendCode
</td>
<td>
@Model.ChainWithdrawal.State
</td>
<td>
@Model.ChainWithdrawal.Error
</td>
<td>
@Model.ChainWithdrawal.ErrorMessage
</td>
<td>
@Model.ChainWithdrawal.Amount
</td>
<td>
@Model.ChainWithdrawal.TxIds
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
}
@if (Model.FiatWithdrawal != null)
{
<div class="panel panel-default">
<div class="panel-heading">
Fiat Withdrawal
</div>
<div class="panel-body">
<table class="table table-condensed table-responsive table-hover">
<tr>
<th>
Deposit Code
</th>
<th>
Complete
</th>
<th>
Amount
</th>
<th>
Bank Name
</th>
<th>
Account Name
</th>
<th>
Account Number
</th>
</tr>
<tbody>
<div class="panel panel-default">
<div class="panel-heading">
Fiat Withdrawal
</div>
<div class="panel-body">
<table class="table table-condensed table-responsive table-hover">
<tr>
<td>
@Model.FiatWithdrawal.DepositCode
</td>
<td>
@(Model.FiatWithdrawal.BankTx != null)
</td>
<td>
@Model.FiatWithdrawal.Amount
</td>
<td>
@Model.FiatWithdrawal.BankName
</td>
<td>
@Model.FiatWithdrawal.AccountName
</td>
<td>
@Model.FiatWithdrawal.AccountNumber
</td>
<th>
Deposit Code
</th>
<th>
Complete
</th>
<th>
Amount
</th>
<th>
Bank Name
</th>
<th>
Account Name
</th>
<th>
Account Number
</th>
</tr>
</tbody>
</table>
<tbody>
<tr>
<td>
@Model.FiatWithdrawal.DepositCode
</td>
<td>
@(Model.FiatWithdrawal.BankTx != null)
</td>
<td>
@Model.FiatWithdrawal.Amount
</td>
<td>
@Model.FiatWithdrawal.BankName
</td>
<td>
@Model.FiatWithdrawal.AccountName
</td>
<td>
@Model.FiatWithdrawal.AccountNumber
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
}
</div>
</div>
</div>

@section Scripts {
@await Html.PartialAsync("_PadDecimalsScriptsPartial")
}
@section Scripts {
@await Html.PartialAsync("_PadDecimalsScriptsPartial")
}

0 comments on commit 502429a

Please sign in to comment.