littleshop/LittleShop/Areas/Admin/Views/Orders/Index.cshtml
sysadmin a281bb2896 Implement complete e-commerce functionality with shipping and order management
Features Added:
- Standard e-commerce properties (Price, Weight, shipping fields)
- Order management with Create/Edit views and shipping information
- ShippingRates system for weight-based shipping calculations
- Comprehensive test coverage with JWT authentication tests
- Sample data seeder with 5 orders demonstrating full workflow
- Photo upload functionality for products
- Multi-cryptocurrency payment support (BTC, XMR, USDT, etc.)

Database Changes:
- Added ShippingRates table
- Added shipping fields to Orders (Name, Address, City, PostCode, Country)
- Renamed properties to standard names (BasePrice to Price, ProductWeight to Weight)
- Added UpdatedAt timestamps to models

UI Improvements:
- Added Create/Edit views for Orders
- Added ShippingRates management UI
- Updated navigation menu with Shipping option
- Enhanced Order Details view with shipping information

Sample Data:
- 3 Categories (Electronics, Clothing, Books)
- 5 Products with various prices
- 5 Shipping rates (Royal Mail options)
- 5 Orders in different statuses (Pending to Delivered)
- 3 Crypto payments demonstrating payment flow

Security:
- All API endpoints secured with JWT authentication
- No public endpoints - client apps must authenticate
- Privacy-focused design with minimal data collection

Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-20 17:37:24 +01:00

78 lines
3.2 KiB
Plaintext

@model IEnumerable<LittleShop.DTOs.OrderDto>
@{
ViewData["Title"] = "Orders";
}
<div class="row mb-4">
<div class="col">
<h1><i class="fas fa-shopping-cart"></i> Orders</h1>
</div>
<div class="col-auto">
<a href="@Url.Action("Create")" class="btn btn-primary">
<i class="fas fa-plus"></i> Create Order
</a>
</div>
</div>
<div class="card">
<div class="card-body">
@if (Model.Any())
{
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>Order ID</th>
<th>Customer</th>
<th>Shipping To</th>
<th>Status</th>
<th>Total</th>
<th>Created</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
@foreach (var order in Model)
{
<tr>
<td><code>@order.Id.ToString().Substring(0, 8)...</code></td>
<td>@order.ShippingName</td>
<td>@order.ShippingCity, @order.ShippingCountry</td>
<td>
@{
var badgeClass = order.Status switch
{
LittleShop.Enums.OrderStatus.PendingPayment => "bg-warning",
LittleShop.Enums.OrderStatus.PaymentReceived => "bg-success",
LittleShop.Enums.OrderStatus.Processing => "bg-info",
LittleShop.Enums.OrderStatus.Shipped => "bg-primary",
LittleShop.Enums.OrderStatus.Delivered => "bg-success",
LittleShop.Enums.OrderStatus.Cancelled => "bg-danger",
_ => "bg-secondary"
};
}
<span class="badge @badgeClass">@order.Status</span>
</td>
<td><strong>£@order.TotalAmount</strong></td>
<td>@order.CreatedAt.ToString("MMM dd, yyyy HH:mm")</td>
<td>
<a href="@Url.Action("Details", new { id = order.Id })" class="btn btn-sm btn-outline-primary">
<i class="fas fa-eye"></i> View
</a>
</td>
</tr>
}
</tbody>
</table>
</div>
}
else
{
<div class="text-center py-4">
<i class="fas fa-shopping-cart fa-3x text-muted mb-3"></i>
<p class="text-muted">No orders found yet.</p>
</div>
}
</div>
</div>