[Verify+Complaints] Facility document review + facility complaints; card location line
CI/CD / CI · dotnet build (push) Successful in 1m27s
CI/CD / Deploy · hamkadr (push) Successful in 1m13s

Card: move location to its own line above the date in the shift card (job card already did). Verification workflow: employers upload documents (license/permit) on a new Employer/Verify page; uploading marks the facility Pending. Admins see pending facilities with their documents on Admin/Facilities, can download each doc, and approve (تأیید شد) or reject with a reason. Documents stored as bytea in the DB (survives deploys via the existing volume); served only to the owner or an admin via /facility-doc/{id}. Facility model gains Verification status enum + note + requested-at; IsVerified kept in sync. Complaints: registered users/visitors can file a شکایت about a facility from shift/job detail pages (targets ReportTargetType.Facility, surfaces in Admin/Reports as مرکز). Migration backfills existing verified facilities to Verified.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-04 16:26:15 +03:30
parent 962196d5cb
commit 1f34fd126f
16 changed files with 1632 additions and 24 deletions
@@ -15,25 +15,27 @@
<h1>تأیید مراکز درمانی</h1>
<p class="muted">
<a asp-page="/Admin/Index">← صف آگهی‌ها</a>
· @JalaliDate.ToPersianDigits(Model.Pending.Count.ToString()) مرکز در انتظار تأیید
· @JalaliDate.ToPersianDigits(Model.Awaiting.Count.ToString()) مرکز منتظر بررسی
</p>
</div>
</div>
<div class="container section">
<h2 style="font-size:20px;">در انتظار تأیید</h2>
@if (Model.Pending.Count == 0)
@if (Model.Msg is not null) { <div class="alert alert-success">@Model.Msg</div> }
<h2 style="font-size:20px;">منتظر بررسی (مدارک ارسال‌شده)</h2>
@if (Model.Awaiting.Count == 0)
{
<div class="card empty-state">مرکزی در انتظار تأیید نیست.</div>
<div class="card empty-state">مرکزی منتظر بررسی نیست.</div>
}
else
{
foreach (var f in Model.Pending)
foreach (var f in Model.Awaiting)
{
<div class="card card-pad" style="margin-bottom:10px;">
<div class="row" style="display:flex; justify-content:space-between; align-items:center; gap:10px;">
<div class="row" style="display:flex; justify-content:space-between; align-items:flex-start; gap:10px;">
<div>
<strong>@f.Name</strong> — @TypeLabel(f.Type)
<strong>@f.Name</strong> — @TypeLabel(f.Type) <span class="badge badge-type">در حال بررسی</span>
<div class="muted" style="font-size:13px;">
📍 @f.City?.Name@(f.District is not null ? "، " + f.District.Name : "")
@if (f.OwnerUser is not null) { <text> · مالک: <span dir="ltr">@JalaliDate.ToPersianDigits(f.OwnerUser.Phone)</span></text> }
@@ -41,8 +43,32 @@
</div>
@if (!string.IsNullOrEmpty(f.Address)) { <div class="muted" style="font-size:13px;">@f.Address</div> }
</div>
</div>
<div style="margin:10px 0;">
<strong style="font-size:13px;">مدارک (@JalaliDate.ToPersianDigits(f.Documents.Count.ToString())):</strong>
@if (f.Documents.Count == 0)
{
<span class="muted" style="font-size:13px;"> — مدرکی بارگذاری نشده.</span>
}
else
{
<div style="display:flex; flex-wrap:wrap; gap:8px; margin-top:6px;">
@foreach (var d in f.Documents)
{
<a class="btn btn-outline" style="padding:6px 12px; font-size:13px;" href="/facility-doc/@d.Id" target="_blank">📎 @d.FileName</a>
}
</div>
}
</div>
<div style="display:flex; gap:8px; flex-wrap:wrap; align-items:flex-end;">
<form method="post">
<button asp-page-handler="Verify" asp-route-id="@f.Id" class="btn btn-accent" style="white-space:nowrap;">✓ تأیید</button>
<button asp-page-handler="Verify" asp-route-id="@f.Id" class="btn btn-accent" style="white-space:nowrap;">✓ تأیید شد</button>
</form>
<form method="post" style="display:flex; gap:6px; flex:1; min-width:220px;">
<input type="text" name="note" placeholder="دلیل رد (اختیاری)" style="flex:1;" />
<button asp-page-handler="Reject" asp-route-id="@f.Id" class="btn btn-outline" style="white-space:nowrap; color:var(--danger); border-color:var(--danger);">رد</button>
</form>
</div>
</div>
@@ -71,4 +97,24 @@
</div>
}
}
@if (Model.Others.Count > 0)
{
<h2 style="font-size:20px; margin-top:30px;">سایر مراکز (بدون درخواست تأیید)</h2>
foreach (var f in Model.Others)
{
<div class="card card-pad" style="margin-bottom:10px;">
<div class="row" style="display:flex; justify-content:space-between; align-items:center; gap:10px;">
<div>
<strong>@f.Name</strong> — @TypeLabel(f.Type)
@if (f.Verification == JobsMedical.Web.Models.VerificationStatus.Rejected) { <span class="badge badge-gender">رد شده</span> }
<div class="muted" style="font-size:13px;">📍 @f.City?.Name@(f.District is not null ? "، " + f.District.Name : "")</div>
</div>
<form method="post">
<button asp-page-handler="Verify" asp-route-id="@f.Id" class="btn btn-accent" style="white-space:nowrap;">✓ تأیید مستقیم</button>
</form>
</div>
</div>
}
}
</div>