Skip to content

Commit 804c875

Browse files
Revert merchant list table to original columns and update test assertions
Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
1 parent c6e541f commit 804c875

2 files changed

Lines changed: 22 additions & 12 deletions

File tree

EstateManagementUI.BlazorIntegrationTests/Common/BlazorUiHelpers.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,8 @@ await Retry.For(async () =>
375375
if (cellText == merchantDetails.MerchantName)
376376
{
377377
cellText.ShouldBe(merchantDetails.MerchantName);
378-
var townText = await cells[4].TextContentAsync();
379-
townText.ShouldBe(merchantDetails.Town);
378+
var settlementScheduleText = await cells[4].TextContentAsync();
379+
settlementScheduleText.ShouldBe(merchantDetails.SettlementSchedule);
380380

381381
foundRowCount++;
382382
break;

EstateManagementUI.BlazorServer/Components/Pages/Merchants/Index.razor

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
<thead>
3232
<tr>
3333
<th>Merchant Name</th>
34+
<th>Reference</th>
35+
<th>Balance</th>
36+
<th>Available Balance</th>
3437
<th>Settlement Schedule</th>
35-
<th>Contact Name</th>
36-
<th>Address Line 1</th>
37-
<th>Town</th>
3838
<th class="text-right">Actions</th>
3939
</tr>
4040
</thead>
@@ -52,14 +52,14 @@
5252
</div>
5353
</div>
5454
</td>
55+
<td class="font-mono text-sm">@merchant.MerchantReference</td>
56+
<td class="font-semibold text-green-600">@(merchant.Balance?.ToString("C") ?? "N/A")</td>
57+
<td class="font-semibold">@(merchant.AvailableBalance?.ToString("C") ?? "N/A")</td>
5558
<td>
5659
<span class="px-3 py-1 bg-blue-100 text-blue-800 rounded-full text-sm font-medium">
5760
@(merchant.SettlementSchedule ?? "Not Set")
5861
</span>
5962
</td>
60-
<td>@(merchant.Contact?.ContactName ?? "N/A")</td>
61-
<td>@(merchant.Address?.AddressLine1 ?? "N/A")</td>
62-
<td>@(merchant.Address?.Town ?? "N/A")</td>
6363
<td class="text-right">
6464
<div class="flex items-center justify-end space-x-2">
6565
<button class="text-blue-600 hover:text-blue-800 p-2" @onclick:stopPropagation="true" @onclick="() => ViewMerchant(merchant.MerchantId)" title="View">
@@ -81,10 +81,20 @@
8181
</table>
8282
</div>
8383

84-
<!-- Summary Card -->
85-
<div class="bg-white rounded-lg shadow-md p-6">
86-
<p class="text-sm text-gray-600 mb-1">Total Merchants</p>
87-
<p class="text-3xl font-bold text-gray-900">@merchants.Count</p>
84+
<!-- Summary Cards -->
85+
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
86+
<div class="bg-white rounded-lg shadow-md p-6">
87+
<p class="text-sm text-gray-600 mb-1">Total Merchants</p>
88+
<p class="text-3xl font-bold text-gray-900">@merchants.Count</p>
89+
</div>
90+
<div class="bg-white rounded-lg shadow-md p-6">
91+
<p class="text-sm text-gray-600 mb-1">Total Balance</p>
92+
<p class="text-3xl font-bold text-green-600">@merchants.Sum(m => m.Balance ?? 0).ToString("C")</p>
93+
</div>
94+
<div class="bg-white rounded-lg shadow-md p-6">
95+
<p class="text-sm text-gray-600 mb-1">Available Balance</p>
96+
<p class="text-3xl font-bold text-blue-600">@merchants.Sum(m => m.AvailableBalance ?? 0).ToString("C")</p>
97+
</div>
8898
</div>
8999
}
90100
else

0 commit comments

Comments
 (0)