Files
taxbaik/TaxBaik.Web.Client/Components/Admin/Pages/TaxFilings/TaxFilingList.razor
T
kjh2064 e5981769b9
TaxBaik CI/CD / build-and-deploy (push) Successful in 2m11s
fix: per-page WASM render mode, Contact checkbox binding, Telegram inquiry channel
- Admin: replace the global @rendermode on <Routes>/<Router> with per-page
  render mode. Login.razor now prerenders (form visible before WASM loads);
  every other [Authorize] page stays prerender: false to avoid the
  AuthorizeRouteView blank-render regression from earlier attempts. Adds a
  "준비 중" -> "로그인" splash tied to WASM boot completion, and lets the
  authenticated-shell loading overlay stay up until AdminShell actually renders.
- Contact.cshtml: fix the "Agree" checkbox missing value="true" - a checked
  box sent the browser-default "on", which bool model binding can't parse,
  so ModelState.IsValid silently went false and OnPostAsync returned a blank
  form with no visible error on every submission. Validation summary widened
  from ModelOnly to All so this class of failure isn't silent again.
- TelegramInquiryNotificationService: read Telegram:InquiryChatId (falling
  back to ChatId) instead of only ChatId, matching the channel routing
  CLAUDE.md documents and deploy.yml already provisions as separate secrets.
- Reconcile CLAUDE.md's self-contradicting Phase 8 prerender notes (Phase 9),
  rewrite validate_admin_render.sh for the per-page design, and add a
  SmartAdmin 5.5 design reference section to DOUZONE_UX_GUIDE.md for future
  admin screens (existing screens unchanged, tracked as WBS P4-03).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-03 10:15:27 +09:00

155 lines
5.5 KiB
Plaintext

@page "/admin/tax-filings"
@rendermode @(new InteractiveWebAssemblyRenderMode(prerender: false))
@attribute [Authorize]
@using TaxBaik.Web.Services
@using TaxBaik.Domain.Entities
@using TaxBaik.WasmClient.Components.Admin.Shared
@inject ITaxFilingBrowserClient FilingClient
@inject IClientBrowserClient ClientClient
@inject ISnackbar Snackbar
<PageTitle>신고 일정 관리</PageTitle>
<section class="admin-page-hero">
<div>
<MudText Typo="Typo.caption" Class="admin-eyebrow">Tax Schedule</MudText>
<MudText Typo="Typo.h4" Class="admin-page-title">신고 일정</MudText>
<MudText Typo="Typo.body2" Class="admin-page-subtitle">고객별 세금 신고 마감일을 관리하고 완료 처리합니다.</MudText>
</div>
<MudButton Variant="Variant.Filled" Color="Color.Primary"
OnClick="@(() => showAddForm = !showAddForm)"
StartIcon="@Icons.Material.Filled.Add">
일정 추가
</MudButton>
</section>
@if (showAddForm)
{
<MudPaper Class="pa-4 mb-4" Elevation="1">
<MudText Typo="Typo.h6" Class="mb-3">새 신고 일정</MudText>
<MudGrid Spacing="2">
<MudItem xs="12" sm="6" md="4">
<MudAutocomplete T="Domain.Entities.Client" @bind-Value="selectedClient"
Label="고객 검색 *"
SearchFunc="SearchClients"
ToStringFunc="@(c => c == null ? "" : $"{c.Name} {c.CompanyName ?? ""}")"
Variant="Variant.Outlined" />
</MudItem>
<MudItem xs="12" sm="6" md="4">
<CommonCodeSelect @bind-Value="newFilingType" Group="FILING_TYPE" Label="신고 유형 *" />
</MudItem>
<MudItem xs="12" sm="6" md="4">
<MudDatePicker @bind-Date="newDueDate" Label="신고 기한 *" DateFormat="yyyy-MM-dd" />
</MudItem>
<MudItem xs="12">
<MudTextField T="string" @bind-Value="newMemo" Label="메모" Variant="Variant.Outlined" />
</MudItem>
</MudGrid>
<MudStack Row="true" Class="mt-3" Spacing="2">
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="AddFiling">저장</MudButton>
<MudButton Variant="Variant.Outlined" OnClick="@(() => showAddForm = false)">취소</MudButton>
</MudStack>
</MudPaper>
}
<MudPaper Class="admin-surface" Elevation="0">
<MudTabs Rounded="true" Elevation="0" Class="admin-tabs">
<MudTabPanel Text="신고 예정">
<FilingTable Filings="@pending" OnStatusChange="Reload" />
</MudTabPanel>
<MudTabPanel Text="신고 완료">
<FilingTable Filings="@filed" OnStatusChange="Reload" />
</MudTabPanel>
<MudTabPanel Text="기한 초과">
<FilingTable Filings="@overdue" OnStatusChange="Reload" />
</MudTabPanel>
</MudTabs>
</MudPaper>
@code {
private List<Domain.Entities.TaxFiling> pending = [];
private List<Domain.Entities.TaxFiling> filed = [];
private List<Domain.Entities.TaxFiling> overdue = [];
private bool showAddForm;
private Domain.Entities.Client? selectedClient;
private string newFilingType = "";
private DateTime? newDueDate = DateTime.Today.AddDays(30);
private string newMemo = "";
protected override async Task OnInitializedAsync() => await Reload();
protected override async Task OnParametersSetAsync()
{
}
private async Task Reload()
{
try
{
var all = (await FilingClient.GetUpcomingAsync(365)).ToList();
pending = all.Where(x => x.Status == "pending").ToList();
filed = all.Where(x => x.Status == "filed").ToList();
overdue = all.Where(x => x.Status == "overdue").ToList();
}
catch (Exception ex)
{
Snackbar.Add($"오류: {ex.Message}", Severity.Error);
}
}
private async Task<IEnumerable<Client>> SearchClients(string value)
{
try
{
var (items, _) = await ClientClient.GetPagedAsync(1, 100, search: value);
return items;
}
catch
{
return [];
}
}
private static string GetClientDisplayName(Client client)
=> !string.IsNullOrWhiteSpace(client.CompanyName)
? client.CompanyName
: !string.IsNullOrWhiteSpace(client.Name)
? client.Name
: $"Client #{client.Id}";
private async Task AddFiling()
{
try
{
if (selectedClient == null)
{
Snackbar.Add("고객을 선택하세요.", Severity.Warning);
return;
}
var filing = new TaxFiling
{
ClientId = selectedClient.Id,
FilingType = newFilingType,
DueDate = newDueDate?.ToUniversalTime() ?? DateTime.UtcNow,
Status = "pending",
Memo = string.IsNullOrWhiteSpace(newMemo) ? null : newMemo
};
var result = await FilingClient.CreateAsync(filing);
if (result != null)
{
showAddForm = false;
Snackbar.Add("신고 일정이 추가되었습니다.", Severity.Success);
await Reload();
}
else
{
Snackbar.Add("추가 실패", Severity.Error);
}
}
catch (Exception ex)
{
Snackbar.Add($"오류: {ex.Message}", Severity.Error);
}
}
}