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,83 @@
@using PowderCoating.Core.Entities
@using PowderCoating.Core.Enums
@model NotificationLog
@{
ViewData["Title"] = "Notification Details";
var sc = Model.Status == NotificationStatus.Sent ? "success"
: Model.Status == NotificationStatus.Failed ? "danger" : "secondary";
}
<div class="container-fluid py-3" style="max-width:800px">
<div class="d-flex align-items-center gap-3 mb-3">
<a asp-action="Index" class="btn btn-outline-secondary">
<i class="bi bi-arrow-left me-1"></i>Back
</a>
<h4 class="mb-0"><i class="bi bi-bell me-2 text-primary"></i>Notification Details</h4>
<span class="badge bg-@sc">@Model.Status</span>
</div>
<div class="row g-3">
<div class="col-md-6">
<div class="card shadow-sm">
<div class="card-header fw-semibold py-2">Metadata</div>
<div class="card-body">
<dl class="row small mb-0">
<dt class="col-5 text-muted">Company</dt>
<dd class="col-7">@(ViewBag.CompanyName ?? (Model.CompanyId > 0 ? $"#{Model.CompanyId}" : "—"))</dd>
<dt class="col-5 text-muted">Type</dt>
<dd class="col-7">@Model.NotificationType</dd>
<dt class="col-5 text-muted">Channel</dt>
<dd class="col-7">@Model.Channel</dd>
<dt class="col-5 text-muted">Status</dt>
<dd class="col-7"><span class="badge bg-@sc">@Model.Status</span></dd>
<dt class="col-5 text-muted">Sent At</dt>
<dd class="col-7">@Model.SentAt.ToString("MM/dd/yyyy HH:mm:ss") UTC</dd>
<dt class="col-5 text-muted">Recipient</dt>
<dd class="col-7">@Model.RecipientName<br><span class="text-muted">@Model.Recipient</span></dd>
@if (Model.CustomerId > 0)
{
<dt class="col-5 text-muted">Customer ID</dt>
<dd class="col-7">#@Model.CustomerId</dd>
}
@if (Model.JobId > 0)
{
<dt class="col-5 text-muted">Job ID</dt>
<dd class="col-7">#@Model.JobId</dd>
}
@if (Model.InvoiceId > 0)
{
<dt class="col-5 text-muted">Invoice ID</dt>
<dd class="col-7">#@Model.InvoiceId</dd>
}
</dl>
</div>
</div>
</div>
@if (!string.IsNullOrEmpty(Model.ErrorMessage))
{
<div class="col-md-6">
<div class="card shadow-sm border-danger">
<div class="card-header fw-semibold py-2 text-danger">Error</div>
<div class="card-body">
<pre class="small mb-0 text-danger">@Model.ErrorMessage</pre>
</div>
</div>
</div>
}
</div>
@if (!string.IsNullOrEmpty(Model.Subject))
{
<div class="card shadow-sm mt-3">
<div class="card-header fw-semibold py-2">Subject</div>
<div class="card-body small">@Model.Subject</div>
</div>
}
<div class="card shadow-sm mt-3">
<div class="card-header fw-semibold py-2">Message Body</div>
<div class="card-body">
<pre class="small mb-0" style="white-space:pre-wrap">@Model.Message</pre>
</div>
</div>
</div>