Restore all zeroed views + add bulk gift certificate creation

The HTML entity sweep script had a bug where it wrote empty files for any
view that contained no target Unicode characters, zeroing out 215 view files.
All views restored from the pre-sweep commit (cefdf3e).

Bulk gift certificate feature:
- BulkCreateGiftCertificateDto with Quantity (1-500), Amount, Reason, Expiry, Notes
- GenerateBulkGiftCertificatePdfAsync on IPdfService / PdfService: one Letter page
  per cert, reusing the same purple/gold branded ComposeGiftCertificateContent helper
- GiftCertificatesController: BulkCreate GET/POST, BulkResult GET, BulkDownloadPdf POST
- Views: BulkCreate.cshtml (form with live total preview), BulkResult.cshtml (table +
  Download All PDF button that POSTs cert IDs to avoid URL length limits)
- gift-certificate-bulk.js: live preview + spinner/disable on submit
- Index.cshtml: Bulk Create button added alongside New Certificate

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-14 20:09:22 -04:00
parent 3eda91f170
commit 4ec55e7290
240 changed files with 73116 additions and 0 deletions
@@ -0,0 +1,108 @@
@model PowderCoating.Application.DTOs.Equipment.EquipmentDto
@{
ViewData["Title"] = "Delete Equipment";
ViewData["PageIcon"] = "bi-tools";
}
<div class="row justify-content-center">
<div class="col-lg-8">
<div class="d-flex justify-content-end align-items-center mb-4">
<a asp-action="Details" asp-route-id="@Model.Id" class="btn btn-outline-secondary">
<i class="bi bi-arrow-left me-2"></i>Back to Details
</a>
</div>
<!-- Warning Banner -->
<div class="alert alert-danger alert-permanent d-flex align-items-start mb-4">
<i class="bi bi-exclamation-triangle me-3" style="font-size: 1.5rem;"></i>
<div>
<strong>Warning: This action cannot be undone!</strong>
<p class="mb-0 mt-1">This equipment record will be marked as deleted. All associated maintenance records will be preserved but the equipment will no longer appear in the active list.</p>
</div>
</div>
<div class="card border-0 shadow-sm">
<div class="card-body p-4">
<!-- Equipment Summary -->
<div class="mb-4">
<h5 class="border-bottom pb-2 mb-3">Equipment Information</h5>
<div class="row g-3">
<div class="col-md-6">
<label class="text-muted small mb-1">Equipment Name</label>
<p class="fw-semibold mb-0">@Model.EquipmentName</p>
</div>
<div class="col-md-6">
<label class="text-muted small mb-1">Equipment Number</label>
<p class="mb-0">@(Model.EquipmentNumber ?? "Not assigned")</p>
</div>
<div class="col-md-6">
<label class="text-muted small mb-1">Type</label>
<p class="mb-0">@Model.EquipmentType</p>
</div>
<div class="col-md-6">
<label class="text-muted small mb-1">Location</label>
<p class="mb-0">@(Model.Location ?? "—")</p>
</div>
<div class="col-md-6">
<label class="text-muted small mb-1">Status</label>
<p class="mb-0">
@{
var statusClass = Model.Status switch
{
"Operational" => "success",
"NeedsMaintenance" => "warning",
"UnderMaintenance" => "info",
"OutOfService" => "danger",
_ => "secondary"
};
}
<span class="badge bg-@statusClass bg-opacity-10 text-@statusClass">
@Model.StatusDisplay
</span>
</p>
</div>
<div class="col-md-6">
<label class="text-muted small mb-1">Purchase Price</label>
<p class="mb-0">@Model.PurchasePrice.ToString("C")</p>
</div>
</div>
</div>
@if (!string.IsNullOrEmpty(Model.Manufacturer) || !string.IsNullOrEmpty(Model.Model))
{
<div class="mb-4">
<h5 class="border-bottom pb-2 mb-3">Manufacturer Information</h5>
<div class="row g-3">
<div class="col-md-4">
<label class="text-muted small mb-1">Manufacturer</label>
<p class="mb-0">@(Model.Manufacturer ?? "—")</p>
</div>
<div class="col-md-4">
<label class="text-muted small mb-1">Model</label>
<p class="mb-0">@(Model.Model ?? "—")</p>
</div>
<div class="col-md-4">
<label class="text-muted small mb-1">Serial Number</label>
<p class="mb-0">@(Model.SerialNumber ?? "—")</p>
</div>
</div>
</div>
}
<!-- Delete Confirmation Form -->
<form asp-action="Delete" method="post" class="mt-4">
<input type="hidden" asp-for="Id" />
<div class="d-flex gap-2 justify-content-end pt-3 border-top">
<a asp-action="Details" asp-route-id="@Model.Id" class="btn btn-outline-secondary px-4">
<i class="bi bi-x-circle me-2"></i>Cancel
</a>
<button type="submit" class="btn btn-danger px-4">
<i class="bi bi-trash me-2"></i>Delete Equipment
</button>
</div>
</form>
</div>
</div>
</div>
</div>