littleshop/LittleShop/Areas/Admin/Views/Orders/Create.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

106 lines
4.9 KiB
Plaintext

@model LittleShop.DTOs.CreateOrderDto
@{
ViewData["Title"] = "Create Order";
}
<div class="row mb-4">
<div class="col">
<h1><i class="fas fa-plus"></i> Create Order</h1>
</div>
</div>
<div class="row">
<div class="col-md-8">
<div class="card">
<div class="card-header">
<h5><i class="fas fa-user"></i> Customer Information</h5>
</div>
<div class="card-body">
<form method="post" asp-area="Admin" asp-controller="Orders" asp-action="Create">
@Html.AntiForgeryToken()
@if (ViewData.ModelState[""] != null && ViewData.ModelState[""].Errors.Count > 0)
{
<div class="alert alert-danger" role="alert">
@foreach (var error in ViewData.ModelState[""].Errors)
{
<div>@error.ErrorMessage</div>
}
</div>
}
<div class="mb-3">
<label for="IdentityReference" class="form-label">Customer Reference</label>
<input name="IdentityReference" id="IdentityReference" class="form-control" required
placeholder="Customer ID or reference" />
<small class="text-muted">Anonymous identifier for the customer</small>
</div>
<h6 class="mt-4 mb-3">Shipping Information</h6>
<div class="mb-3">
<label for="ShippingName" class="form-label">Recipient Name</label>
<input name="ShippingName" id="ShippingName" class="form-control" required />
</div>
<div class="mb-3">
<label for="ShippingAddress" class="form-label">Shipping Address</label>
<textarea name="ShippingAddress" id="ShippingAddress" class="form-control" rows="2" required></textarea>
</div>
<div class="row">
<div class="col-md-6">
<div class="mb-3">
<label for="ShippingCity" class="form-label">City</label>
<input name="ShippingCity" id="ShippingCity" class="form-control" required />
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
<label for="ShippingPostCode" class="form-label">Post Code</label>
<input name="ShippingPostCode" id="ShippingPostCode" class="form-control" required />
</div>
</div>
</div>
<div class="mb-3">
<label for="ShippingCountry" class="form-label">Country</label>
<input name="ShippingCountry" id="ShippingCountry" class="form-control" value="United Kingdom" required />
</div>
<div class="mb-3">
<label for="Notes" class="form-label">Order Notes (Optional)</label>
<textarea name="Notes" id="Notes" class="form-control" rows="3"></textarea>
</div>
<div class="d-flex justify-content-between">
<a href="@Url.Action("Index")" class="btn btn-secondary">
<i class="fas fa-arrow-left"></i> Back to Orders
</a>
<button type="submit" class="btn btn-primary">
<i class="fas fa-save"></i> Create Order
</button>
</div>
</form>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card">
<div class="card-header">
<h5><i class="fas fa-info-circle"></i> Order Information</h5>
</div>
<div class="card-body">
<p>Create a new order manually for phone or email orders.</p>
<ul class="list-unstyled">
<li><strong>Customer Reference:</strong> Anonymous identifier</li>
<li><strong>Shipping Details:</strong> Required for delivery</li>
<li><strong>Payment:</strong> Add after order creation</li>
<li><strong>Products:</strong> Add items after creation</li>
</ul>
<small class="text-muted">Orders created here will appear in the orders list with PendingPayment status.</small>
</div>
</div>
</div>
</div>