feat: CRM Phase 1-2 완성 + 시즌 시뮬레이터 + 개인정보처리방침/이용약관
- WBS-CRM-02: 상담 이력 (consultations 테이블 V008, ClientDetail.razor) - WBS-CRM-03: 문의→고객 전환 (V009 client_id FK, InquiryDetail 고객등록 버튼) - WBS-CRM-04: 신고 일정 캘린더 (tax_filings 테이블 V010, TaxFilingList.razor) - WBS-CRM-05: 문의 상태 5단계 확장 (V011, InquiryStatus enum, InquiryList 탭) - WBS-MKT-04: 시즌 시뮬레이터 어드민 페이지 (SeasonSimulator.razor) - WBS-UX-04: 개인정보처리방침 /taxbaik/privacy, 이용약관 /taxbaik/terms - Dashboard.razor 마감 임박 신고 위젯 추가 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -44,11 +44,13 @@
|
||||
<MudNavLink Href="/taxbaik/admin/dashboard" Match="NavLinkMatch.All" Icon="@Icons.Material.Filled.Dashboard">대시보드</MudNavLink>
|
||||
<MudNavGroup Title="고객 관리" Icon="@Icons.Material.Filled.PeopleAlt" Expanded="true">
|
||||
<MudNavLink Href="/taxbaik/admin/clients" Icon="@Icons.Material.Filled.ContactPage">고객 카드</MudNavLink>
|
||||
<MudNavLink Href="/taxbaik/admin/tax-filings" Icon="@Icons.Material.Filled.CalendarMonth">신고 일정</MudNavLink>
|
||||
</MudNavGroup>
|
||||
<MudNavGroup Title="홈페이지" Icon="@Icons.Material.Filled.Home" Expanded="false">
|
||||
<MudNavLink Href="/taxbaik/admin/announcements" Icon="@Icons.Material.Filled.Campaign">공지사항</MudNavLink>
|
||||
<MudNavLink Href="/taxbaik/admin/faqs" Icon="@Icons.Material.Filled.QuestionAnswer">FAQ 관리</MudNavLink>
|
||||
<MudNavLink Href="/taxbaik/admin/blog" Icon="@Icons.Material.Filled.Article">블로그 관리</MudNavLink>
|
||||
<MudNavLink Href="/taxbaik/admin/season-simulator" Icon="@Icons.Material.Filled.Preview">시즌 시뮬레이터</MudNavLink>
|
||||
</MudNavGroup>
|
||||
<MudNavLink Href="/taxbaik/admin/inquiries" Icon="@Icons.Material.Filled.Forum">문의 관리</MudNavLink>
|
||||
<MudNavLink Href="/taxbaik/admin/settings" Icon="@Icons.Material.Filled.Tune">설정</MudNavLink>
|
||||
|
||||
@@ -0,0 +1,236 @@
|
||||
@page "/admin/clients/{ClientId:int}"
|
||||
@attribute [Authorize]
|
||||
@using TaxBaik.Application.Services
|
||||
@inject ClientService ClientService
|
||||
@inject ConsultationService ConsultationService
|
||||
@inject NavigationManager Navigation
|
||||
@inject ISnackbar Snackbar
|
||||
|
||||
<PageTitle>고객 상세</PageTitle>
|
||||
|
||||
@if (client == null)
|
||||
{
|
||||
<MudText>고객을 찾을 수 없습니다.</MudText>
|
||||
return;
|
||||
}
|
||||
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Class="mb-4" Spacing="2">
|
||||
<MudButton Variant="Variant.Outlined" Color="Color.Primary"
|
||||
StartIcon="@Icons.Material.Filled.ArrowBack"
|
||||
@onclick="@(() => Navigation.NavigateTo("/taxbaik/admin/clients"))">
|
||||
목록으로
|
||||
</MudButton>
|
||||
<MudButton Variant="Variant.Outlined" Color="Color.Warning"
|
||||
StartIcon="@Icons.Material.Filled.Edit"
|
||||
Href="@($"/taxbaik/admin/clients/{ClientId}/edit")">
|
||||
수정
|
||||
</MudButton>
|
||||
</MudStack>
|
||||
|
||||
<MudGrid>
|
||||
<MudItem xs="12" md="5">
|
||||
<MudPaper Class="pa-4" Elevation="1">
|
||||
<MudText Typo="Typo.h6" Class="mb-3">고객 정보</MudText>
|
||||
<MudGrid Spacing="2">
|
||||
<MudItem xs="6">
|
||||
<MudText Typo="Typo.subtitle2" Color="Color.Secondary">이름</MudText>
|
||||
<MudText>@client.Name</MudText>
|
||||
</MudItem>
|
||||
<MudItem xs="6">
|
||||
<MudText Typo="Typo.subtitle2" Color="Color.Secondary">상호</MudText>
|
||||
<MudText>@(client.CompanyName ?? "-")</MudText>
|
||||
</MudItem>
|
||||
<MudItem xs="6">
|
||||
<MudText Typo="Typo.subtitle2" Color="Color.Secondary">연락처</MudText>
|
||||
<MudText>@(client.Phone ?? "-")</MudText>
|
||||
</MudItem>
|
||||
<MudItem xs="6">
|
||||
<MudText Typo="Typo.subtitle2" Color="Color.Secondary">이메일</MudText>
|
||||
<MudText>@(client.Email ?? "-")</MudText>
|
||||
</MudItem>
|
||||
<MudItem xs="6">
|
||||
<MudText Typo="Typo.subtitle2" Color="Color.Secondary">서비스</MudText>
|
||||
<MudText>@(client.ServiceType ?? "-")</MudText>
|
||||
</MudItem>
|
||||
<MudItem xs="6">
|
||||
<MudText Typo="Typo.subtitle2" Color="Color.Secondary">사업자 유형</MudText>
|
||||
<MudText>@(client.TaxType ?? "-")</MudText>
|
||||
</MudItem>
|
||||
<MudItem xs="6">
|
||||
<MudText Typo="Typo.subtitle2" Color="Color.Secondary">유입 경로</MudText>
|
||||
<MudText>@(client.Source ?? "-")</MudText>
|
||||
</MudItem>
|
||||
<MudItem xs="6">
|
||||
<MudText Typo="Typo.subtitle2" Color="Color.Secondary">등록일</MudText>
|
||||
<MudText>@client.CreatedAt.ToLocalTime().ToString("yyyy-MM-dd")</MudText>
|
||||
</MudItem>
|
||||
@if (!string.IsNullOrWhiteSpace(client.Memo))
|
||||
{
|
||||
<MudItem xs="12">
|
||||
<MudText Typo="Typo.subtitle2" Color="Color.Secondary">메모</MudText>
|
||||
<MudText Style="white-space: pre-wrap;">@client.Memo</MudText>
|
||||
</MudItem>
|
||||
}
|
||||
</MudGrid>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
|
||||
<MudItem xs="12" md="7">
|
||||
<MudPaper Class="pa-4" Elevation="1">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Justify="Justify.SpaceBetween" Class="mb-3">
|
||||
<MudText Typo="Typo.h6">상담 이력</MudText>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary"
|
||||
Size="Size.Small"
|
||||
OnClick="OpenAddConsultation">
|
||||
+ 상담 추가
|
||||
</MudButton>
|
||||
</MudStack>
|
||||
|
||||
@if (showAddForm)
|
||||
{
|
||||
<MudPaper Class="pa-3 mb-3" Outlined="true">
|
||||
<MudGrid Spacing="2">
|
||||
<MudItem xs="12" sm="6">
|
||||
<MudDatePicker @bind-Date="newDate" Label="상담일" DateFormat="yyyy-MM-dd" />
|
||||
</MudItem>
|
||||
<MudItem xs="12" sm="6">
|
||||
<MudSelect T="string" @bind-Value="newServiceType" Label="서비스 분야">
|
||||
@foreach (var t in ClientService.ServiceTypes)
|
||||
{
|
||||
<MudSelectItem Value="@t">@t</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
</MudItem>
|
||||
<MudItem xs="12">
|
||||
<MudTextField T="string" @bind-Value="newSummary" Label="상담 내용 *"
|
||||
Lines="3" Variant="Variant.Outlined" Required="true" />
|
||||
</MudItem>
|
||||
<MudItem xs="12" sm="6">
|
||||
<MudSelect T="string" @bind-Value="newResult" Label="결과">
|
||||
<MudSelectItem Value="@("")">-</MudSelectItem>
|
||||
@foreach (var r in ConsultationService.Results)
|
||||
{
|
||||
<MudSelectItem Value="@r">@r</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
</MudItem>
|
||||
<MudItem xs="12" sm="6">
|
||||
<MudNumericField T="decimal?" @bind-Value="newFee" Label="수임료 (원)"
|
||||
Format="N0" />
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
<MudStack Row="true" Class="mt-2" Spacing="2">
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="AddConsultation">저장</MudButton>
|
||||
<MudButton Variant="Variant.Outlined" OnClick="@(() => showAddForm = false)">취소</MudButton>
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
}
|
||||
|
||||
@if (consultations.Count == 0)
|
||||
{
|
||||
<MudText Color="Color.Secondary">상담 이력이 없습니다.</MudText>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudList T="string" Dense="true">
|
||||
@foreach (var c in consultations)
|
||||
{
|
||||
<MudListItem>
|
||||
<MudPaper Class="pa-3" Outlined="true" Style="width:100%">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Start" Justify="Justify.SpaceBetween">
|
||||
<div>
|
||||
<MudText Typo="Typo.caption" Color="Color.Secondary">
|
||||
@c.ConsultationDate.ToString("yyyy-MM-dd")
|
||||
@if (!string.IsNullOrEmpty(c.ServiceType)) { <text> · @c.ServiceType</text> }
|
||||
</MudText>
|
||||
<MudText Style="white-space: pre-wrap;" Class="mt-1">@c.Summary</MudText>
|
||||
@if (!string.IsNullOrEmpty(c.Result))
|
||||
{
|
||||
<MudChip T="string" Size="Size.Small" Color="Color.Info" Class="mt-1">@c.Result</MudChip>
|
||||
}
|
||||
@if (c.Fee.HasValue)
|
||||
{
|
||||
<MudText Typo="Typo.caption" Color="Color.Secondary" Class="mt-1">
|
||||
수임료: @c.Fee.Value.ToString("N0")원
|
||||
</MudText>
|
||||
}
|
||||
</div>
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Delete"
|
||||
Size="Size.Small" Color="Color.Error"
|
||||
OnClick="@(() => DeleteConsultation(c.Id))" />
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
</MudListItem>
|
||||
}
|
||||
</MudList>
|
||||
}
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public int ClientId { get; set; }
|
||||
|
||||
private Domain.Entities.Client? client;
|
||||
private List<Domain.Entities.Consultation> consultations = [];
|
||||
|
||||
private bool showAddForm;
|
||||
private DateTime? newDate = DateTime.Today;
|
||||
private string newServiceType = "";
|
||||
private string newSummary = "";
|
||||
private string newResult = "";
|
||||
private decimal? newFee;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await LoadAll();
|
||||
}
|
||||
|
||||
private async Task LoadAll()
|
||||
{
|
||||
client = await ClientService.GetByIdAsync(ClientId);
|
||||
consultations = (await ConsultationService.GetByClientIdAsync(ClientId)).ToList();
|
||||
}
|
||||
|
||||
private void OpenAddConsultation()
|
||||
{
|
||||
showAddForm = true;
|
||||
newDate = DateTime.Today;
|
||||
newServiceType = "";
|
||||
newSummary = "";
|
||||
newResult = "";
|
||||
newFee = null;
|
||||
}
|
||||
|
||||
private async Task AddConsultation()
|
||||
{
|
||||
try
|
||||
{
|
||||
var c = new Domain.Entities.Consultation
|
||||
{
|
||||
ClientId = ClientId,
|
||||
ConsultationDate = newDate?.ToUniversalTime() ?? DateTime.UtcNow,
|
||||
ServiceType = string.IsNullOrWhiteSpace(newServiceType) ? null : newServiceType,
|
||||
Summary = newSummary,
|
||||
Result = string.IsNullOrWhiteSpace(newResult) ? null : newResult,
|
||||
Fee = newFee
|
||||
};
|
||||
await ConsultationService.CreateAsync(c);
|
||||
showAddForm = false;
|
||||
consultations = (await ConsultationService.GetByClientIdAsync(ClientId)).ToList();
|
||||
Snackbar.Add("상담이 추가되었습니다.", Severity.Success);
|
||||
}
|
||||
catch (ValidationException ex)
|
||||
{
|
||||
Snackbar.Add(ex.Message, Severity.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task DeleteConsultation(int id)
|
||||
{
|
||||
await ConsultationService.DeleteAsync(id);
|
||||
consultations = (await ConsultationService.GetByClientIdAsync(ClientId)).ToList();
|
||||
Snackbar.Add("삭제되었습니다.", Severity.Info);
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
@attribute [Authorize]
|
||||
@using TaxBaik.Application.Services
|
||||
@inject AdminDashboardService DashboardService
|
||||
@inject TaxFilingService FilingService
|
||||
|
||||
<PageTitle>대시보드</PageTitle>
|
||||
|
||||
@@ -50,6 +51,50 @@
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
|
||||
@if (upcomingFilings.Count > 0)
|
||||
{
|
||||
<MudPaper Class="admin-surface mt-4" Elevation="0">
|
||||
<div class="admin-section-header">
|
||||
<div>
|
||||
<MudText Typo="Typo.h6">이번 달 마감 임박 신고</MudText>
|
||||
<MudText Typo="Typo.body2">30일 이내 신고 예정 건</MudText>
|
||||
</div>
|
||||
<MudButton Variant="Variant.Outlined" Color="Color.Primary" Href="/taxbaik/admin/tax-filings">전체 일정 보기</MudButton>
|
||||
</div>
|
||||
<MudSimpleTable Striped="true" Dense="true" Class="admin-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>고객</th>
|
||||
<th>신고 유형</th>
|
||||
<th>기한</th>
|
||||
<th>D-day</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var f in upcomingFilings)
|
||||
{
|
||||
var dday = (f.DueDate.Date - DateTime.Today).Days;
|
||||
<tr>
|
||||
<td>@f.ClientName</td>
|
||||
<td>@f.FilingType</td>
|
||||
<td>@f.DueDate.ToString("yyyy-MM-dd")</td>
|
||||
<td>
|
||||
@if (dday <= 7)
|
||||
{
|
||||
<MudChip T="string" Size="Size.Small" Color="Color.Error">D-@dday</MudChip>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>D-@dday</span>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</MudSimpleTable>
|
||||
</MudPaper>
|
||||
}
|
||||
|
||||
<MudPaper Class="admin-surface mt-4" Elevation="0">
|
||||
<div class="admin-section-header">
|
||||
<div>
|
||||
@@ -76,8 +121,7 @@
|
||||
<td>@inquiry.Phone</td>
|
||||
<td>@inquiry.ServiceType</td>
|
||||
<td>
|
||||
<MudChip Size="Size.Small"
|
||||
Color="@(inquiry.Status == "new" ? Color.Warning : inquiry.Status == "contacted" ? Color.Info : Color.Success)">
|
||||
<MudChip T="string" Size="Size.Small" Color="@StatusColor(inquiry.Status)">
|
||||
@GetStatusLabel(inquiry.Status)
|
||||
</MudChip>
|
||||
</td>
|
||||
@@ -90,17 +134,26 @@
|
||||
|
||||
@code {
|
||||
private AdminDashboardSummary summary = new(0, 0, 0, 0, []);
|
||||
private List<Domain.Entities.TaxFiling> upcomingFilings = [];
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
summary = await DashboardService.GetSummaryAsync();
|
||||
}
|
||||
var summaryTask = DashboardService.GetSummaryAsync();
|
||||
var filingsTask = FilingService.GetUpcomingAsync(30);
|
||||
await Task.WhenAll(summaryTask, filingsTask);
|
||||
summary = await summaryTask;
|
||||
upcomingFilings = (await filingsTask).ToList();
|
||||
}
|
||||
|
||||
private static string GetStatusLabel(string status) => status switch
|
||||
private static string GetStatusLabel(string status) => InquiryStatusMapper.Labels.GetValueOrDefault(status, status);
|
||||
|
||||
private static Color StatusColor(string status) => status switch
|
||||
{
|
||||
"new" => "신규",
|
||||
"contacted" => "연락함",
|
||||
"completed" => "완료",
|
||||
_ => status
|
||||
"new" => Color.Warning,
|
||||
"consulting" => Color.Info,
|
||||
"contracted" => Color.Success,
|
||||
"rejected" => Color.Error,
|
||||
"closed" => Color.Dark,
|
||||
_ => Color.Default
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
@attribute [Authorize]
|
||||
@using TaxBaik.Application.Services
|
||||
@inject InquiryService InquiryService
|
||||
@inject ClientService ClientService
|
||||
@inject NavigationManager Navigation
|
||||
@inject ISnackbar Snackbar
|
||||
|
||||
@@ -13,58 +14,91 @@
|
||||
Color="Color.Primary"
|
||||
StartIcon="@Icons.Material.Filled.ArrowBack"
|
||||
@onclick="@(() => Navigation.NavigateTo("/taxbaik/admin/inquiries"))">
|
||||
문의 목록으로 돌아가기
|
||||
문의 목록으로
|
||||
</MudButton>
|
||||
|
||||
<MudPaper Class="pa-4 mt-4" Elevation="1">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Justify="Justify.SpaceBetween" Class="mb-4">
|
||||
<MudText Typo="Typo.h5">문의 상세</MudText>
|
||||
<MudButton Variant="Variant.Filled"
|
||||
Color="Color.Primary"
|
||||
StartIcon="@Icons.Material.Filled.List"
|
||||
Href="/taxbaik/admin/inquiries">
|
||||
다른 문의도 보기
|
||||
</MudButton>
|
||||
</MudStack>
|
||||
<MudGrid Class="mt-4">
|
||||
<MudItem xs="12" md="8">
|
||||
<MudPaper Class="pa-4" Elevation="1">
|
||||
<MudText Typo="Typo.h6" Class="mb-3">문의 정보</MudText>
|
||||
<MudGrid>
|
||||
<MudItem xs="12" sm="6">
|
||||
<MudText Typo="Typo.subtitle2" Color="Color.Secondary">이름</MudText>
|
||||
<MudText>@inquiry.Name</MudText>
|
||||
</MudItem>
|
||||
<MudItem xs="12" sm="6">
|
||||
<MudText Typo="Typo.subtitle2" Color="Color.Secondary">연락처</MudText>
|
||||
<MudText>@inquiry.Phone</MudText>
|
||||
</MudItem>
|
||||
<MudItem xs="12" sm="6">
|
||||
<MudText Typo="Typo.subtitle2" Color="Color.Secondary">이메일</MudText>
|
||||
<MudText>@(inquiry.Email ?? "-")</MudText>
|
||||
</MudItem>
|
||||
<MudItem xs="12" sm="6">
|
||||
<MudText Typo="Typo.subtitle2" Color="Color.Secondary">분야</MudText>
|
||||
<MudText>@inquiry.ServiceType</MudText>
|
||||
</MudItem>
|
||||
<MudItem xs="12">
|
||||
<MudText Typo="Typo.subtitle2" Color="Color.Secondary">문의 내용</MudText>
|
||||
<MudPaper Class="pa-3 mt-1" Outlined="true">
|
||||
<MudText Style="white-space: pre-wrap;">@inquiry.Message</MudText>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
<MudItem xs="12">
|
||||
<MudText Typo="Typo.subtitle2" Color="Color.Secondary">접수일시</MudText>
|
||||
<MudText>@inquiry.CreatedAt.ToLocalTime().ToString("yyyy-MM-dd HH:mm")</MudText>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
</MudPaper>
|
||||
|
||||
<MudGrid>
|
||||
<MudItem xs="12" md="6">
|
||||
<MudText Typo="Typo.subtitle1">이름</MudText>
|
||||
<MudText>@inquiry.Name</MudText>
|
||||
</MudItem>
|
||||
<MudItem xs="12" md="6">
|
||||
<MudText Typo="Typo.subtitle1">연락처</MudText>
|
||||
<MudText>@inquiry.Phone</MudText>
|
||||
</MudItem>
|
||||
<MudItem xs="12" md="6">
|
||||
<MudText Typo="Typo.subtitle1">이메일</MudText>
|
||||
<MudText>@inquiry.Email</MudText>
|
||||
</MudItem>
|
||||
<MudItem xs="12" md="6">
|
||||
<MudText Typo="Typo.subtitle1">분야</MudText>
|
||||
<MudText>@inquiry.ServiceType</MudText>
|
||||
</MudItem>
|
||||
<MudItem xs="12">
|
||||
<MudText Typo="Typo.subtitle1">메시지</MudText>
|
||||
<MudPaper Class="pa-3 mt-2" Outlined="true">
|
||||
<MudText Style="white-space: pre-wrap;">@inquiry.Message</MudText>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
<MudItem xs="12">
|
||||
<MudText Typo="Typo.subtitle1">상태</MudText>
|
||||
<MudSelect T="string" Value="inquiry.Status" ValueChanged="@((string status) => OnStatusChanged(status))" Label="상태 변경">
|
||||
<MudSelectItem Value="@("new")">신규</MudSelectItem>
|
||||
<MudSelectItem Value="@("contacted")">연락함</MudSelectItem>
|
||||
<MudSelectItem Value="@("completed")">완료</MudSelectItem>
|
||||
</MudSelect>
|
||||
<MudStack Row="true" Class="mt-3" Spacing="2">
|
||||
<MudButton Variant="Variant.Outlined" Color="Color.Warning" OnClick="@(() => OnStatusChanged("new"))">신규</MudButton>
|
||||
<MudButton Variant="Variant.Outlined" Color="Color.Info" OnClick="@(() => OnStatusChanged("contacted"))">연락함</MudButton>
|
||||
<MudButton Variant="Variant.Outlined" Color="Color.Success" OnClick="@(() => OnStatusChanged("completed"))">완료</MudButton>
|
||||
<MudPaper Class="pa-4 mt-4" Elevation="1">
|
||||
<MudText Typo="Typo.h6" Class="mb-3">담당자 메모</MudText>
|
||||
<MudTextField T="string" @bind-Value="adminMemo" Label="내부 메모 (고객에게 미노출)"
|
||||
Lines="4" Variant="Variant.Outlined" />
|
||||
<MudButton Class="mt-2" Variant="Variant.Filled" Color="Color.Primary"
|
||||
OnClick="SaveMemo">메모 저장</MudButton>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
|
||||
<MudItem xs="12" md="4">
|
||||
<MudPaper Class="pa-4" Elevation="1">
|
||||
<MudText Typo="Typo.h6" Class="mb-3">처리 상태</MudText>
|
||||
<MudStack Spacing="2">
|
||||
@foreach (var (key, label) in InquiryStatusMapper.Labels)
|
||||
{
|
||||
<MudButton Variant="@(inquiry.Status == key ? Variant.Filled : Variant.Outlined)"
|
||||
Color="@StatusColor(key)"
|
||||
FullWidth="true"
|
||||
OnClick="@(() => OnStatusChanged(key))">
|
||||
@label
|
||||
</MudButton>
|
||||
}
|
||||
</MudStack>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
</MudPaper>
|
||||
</MudPaper>
|
||||
|
||||
@if (inquiry.ClientId == null)
|
||||
{
|
||||
<MudPaper Class="pa-4 mt-4" Elevation="1">
|
||||
<MudText Typo="Typo.h6" Class="mb-3">고객 카드 생성</MudText>
|
||||
<MudText Typo="Typo.body2" Class="mb-3">이 문의를 고객 카드로 등록합니다.</MudText>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Success" FullWidth="true"
|
||||
OnClick="ConvertToClient">
|
||||
고객으로 등록
|
||||
</MudButton>
|
||||
</MudPaper>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudPaper Class="pa-4 mt-4" Elevation="1">
|
||||
<MudText Typo="Typo.h6" Class="mb-3">연결된 고객</MudText>
|
||||
<MudButton Variant="Variant.Outlined" Color="Color.Primary" FullWidth="true"
|
||||
Href="@($"/taxbaik/admin/clients/{inquiry.ClientId}")">
|
||||
고객 카드 보기
|
||||
</MudButton>
|
||||
</MudPaper>
|
||||
}
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -76,17 +110,17 @@ else
|
||||
public int InquiryId { get; set; }
|
||||
|
||||
private Domain.Entities.Inquiry? inquiry;
|
||||
private string adminMemo = "";
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
inquiry = await InquiryService.GetByIdAsync(InquiryId);
|
||||
adminMemo = inquiry?.AdminMemo ?? "";
|
||||
}
|
||||
|
||||
private async Task OnStatusChanged(string status)
|
||||
{
|
||||
if (inquiry == null)
|
||||
return;
|
||||
|
||||
if (inquiry == null) return;
|
||||
try
|
||||
{
|
||||
await InquiryService.UpdateStatusAsync(inquiry.Id, status, "관리자");
|
||||
@@ -98,4 +132,40 @@ else
|
||||
Snackbar.Add(ex.Message, Severity.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task SaveMemo()
|
||||
{
|
||||
if (inquiry == null) return;
|
||||
await InquiryService.UpdateAdminMemoAsync(inquiry.Id, adminMemo);
|
||||
inquiry.AdminMemo = adminMemo;
|
||||
Snackbar.Add("메모가 저장되었습니다.", Severity.Success);
|
||||
}
|
||||
|
||||
private async Task ConvertToClient()
|
||||
{
|
||||
if (inquiry == null) return;
|
||||
try
|
||||
{
|
||||
var clientId = await ClientService.CreateFromInquiryAsync(inquiry.Name, inquiry.Phone, inquiry.ServiceType);
|
||||
await InquiryService.LinkClientAsync(inquiry.Id, clientId);
|
||||
await InquiryService.UpdateStatusAsync(inquiry.Id, "consulting", "관리자");
|
||||
inquiry.ClientId = clientId;
|
||||
inquiry.Status = "consulting";
|
||||
Snackbar.Add("고객 카드가 생성되었습니다.", Severity.Success);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Snackbar.Add($"오류: {ex.Message}", Severity.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private Color StatusColor(string status) => status switch
|
||||
{
|
||||
"new" => Color.Default,
|
||||
"consulting" => Color.Info,
|
||||
"contracted" => Color.Success,
|
||||
"rejected" => Color.Error,
|
||||
"closed" => Color.Dark,
|
||||
_ => Color.Default
|
||||
};
|
||||
}
|
||||
|
||||
@@ -21,11 +21,17 @@
|
||||
<MudTabPanel Text="신규">
|
||||
<InquiryTable Status="new" />
|
||||
</MudTabPanel>
|
||||
<MudTabPanel Text="연락함">
|
||||
<InquiryTable Status="contacted" />
|
||||
<MudTabPanel Text="상담중">
|
||||
<InquiryTable Status="consulting" />
|
||||
</MudTabPanel>
|
||||
<MudTabPanel Text="완료">
|
||||
<InquiryTable Status="completed" />
|
||||
<MudTabPanel Text="계약완료">
|
||||
<InquiryTable Status="contracted" />
|
||||
</MudTabPanel>
|
||||
<MudTabPanel Text="거절">
|
||||
<InquiryTable Status="rejected" />
|
||||
</MudTabPanel>
|
||||
<MudTabPanel Text="종결">
|
||||
<InquiryTable Status="closed" />
|
||||
</MudTabPanel>
|
||||
</MudTabs>
|
||||
</MudPaper>
|
||||
|
||||
@@ -0,0 +1,211 @@
|
||||
@page "/admin/season-simulator"
|
||||
@attribute [Authorize]
|
||||
@using TaxBaik.Application.Seasonal
|
||||
@using TaxBaik.Application.Services
|
||||
|
||||
<PageTitle>시즌 시뮬레이터</PageTitle>
|
||||
|
||||
<section class="admin-page-hero">
|
||||
<div>
|
||||
<MudText Typo="Typo.caption" Class="admin-eyebrow">Season Preview</MudText>
|
||||
<MudText Typo="Typo.h4" Class="admin-page-title">시즌 시뮬레이터</MudText>
|
||||
<MudText Typo="Typo.body2" Class="admin-page-subtitle">날짜를 선택해 홈페이지 시즌 화면이 어떻게 보이는지 미리 확인합니다.</MudText>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<MudGrid>
|
||||
<MudItem xs="12" md="4">
|
||||
<MudPaper Class="pa-4" Elevation="1">
|
||||
<MudText Typo="Typo.h6" Class="mb-3">시뮬레이션 날짜</MudText>
|
||||
<MudDatePicker @bind-Date="simulationDate" Label="날짜 선택" DateFormat="yyyy-MM-dd" PickerVariant="PickerVariant.Static" />
|
||||
<MudDivider Class="my-3" />
|
||||
<MudText Typo="Typo.subtitle2" Class="mb-2">연간 세무 캘린더</MudText>
|
||||
@foreach (var season in TaxSeasonCalendar.Seasons)
|
||||
{
|
||||
<MudButton Variant="Variant.Outlined" Size="Size.Small" FullWidth="true"
|
||||
Class="mb-1" Color="Color.Primary"
|
||||
OnClick="@(() => JumpToSeason(season))">
|
||||
@season.StartMonth/@season.StartDay — @season.Name
|
||||
</MudButton>
|
||||
}
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
|
||||
<MudItem xs="12" md="8">
|
||||
<MudPaper Class="pa-4" Elevation="1">
|
||||
<MudText Typo="Typo.h6" Class="mb-1">
|
||||
@(simulationDate?.ToString("yyyy년 MM월 dd일") ?? "날짜를 선택하세요") 홈페이지 미리보기
|
||||
</MudText>
|
||||
@if (activeSeason != null)
|
||||
{
|
||||
<MudChip T="string" Color="Color.Warning" Size="Size.Small" Class="mb-3">
|
||||
@activeSeason.Name 시즌 활성
|
||||
</MudChip>
|
||||
<MudDivider Class="mb-4" />
|
||||
<!-- Hero 섹션 미리보기 -->
|
||||
<div style="background: linear-gradient(135deg, #1a365d 0%, #2a4365 100%); border-radius: 12px; padding: 2rem; color: white; margin-bottom: 1.5rem;">
|
||||
@if (activeSeason.DaysUntilDeadline <= 7 && activeSeason.DaysUntilDeadline >= 0)
|
||||
{
|
||||
<div style="background: #f59e0b; color: #1a202c; display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 700; margin-bottom: 1rem;">
|
||||
D-@activeSeason.DaysUntilDeadline 마감 임박
|
||||
</div>
|
||||
}
|
||||
<div style="font-size: 1.8rem; font-weight: 800; white-space: pre-line; margin-bottom: 0.5rem; line-height: 1.3;">
|
||||
@activeSeason.HeroHeadline
|
||||
</div>
|
||||
<div style="font-size: 0.95rem; color: rgba(255,255,255,0.8); margin-bottom: 1.5rem;">
|
||||
@activeSeason.HeroSubtext
|
||||
</div>
|
||||
<div style="display: flex; gap: 0.75rem; flex-wrap: wrap;">
|
||||
<div style="background: #e53e3e; color: white; padding: 10px 20px; border-radius: 8px; font-weight: 700; font-size: 0.95rem;">
|
||||
@activeSeason.CtaText
|
||||
</div>
|
||||
<div style="background: transparent; border: 2px solid rgba(255,255,255,0.5); color: white; padding: 10px 20px; border-radius: 8px; font-size: 0.95rem;">
|
||||
서비스 안내
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<MudGrid Spacing="2">
|
||||
<MudItem xs="6">
|
||||
<MudText Typo="Typo.subtitle2" Color="Color.Secondary">활성 시즌 키</MudText>
|
||||
<MudText><code>@activeSeason.Key</code></MudText>
|
||||
</MudItem>
|
||||
<MudItem xs="6">
|
||||
<MudText Typo="Typo.subtitle2" Color="Color.Secondary">마감까지</MudText>
|
||||
<MudText>
|
||||
@if (activeSeason.DaysUntilDeadline >= 0)
|
||||
{
|
||||
<MudChip T="string" Size="Size.Small"
|
||||
Color="@(activeSeason.DaysUntilDeadline <= 7 ? Color.Error : Color.Warning)">
|
||||
D-@activeSeason.DaysUntilDeadline
|
||||
</MudChip>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>마감 후 @(-activeSeason.DaysUntilDeadline)일</span>
|
||||
}
|
||||
</MudText>
|
||||
</MudItem>
|
||||
<MudItem xs="6">
|
||||
<MudText Typo="Typo.subtitle2" Color="Color.Secondary">포커스 서비스</MudText>
|
||||
<MudText>@activeSeason.FocusService</MudText>
|
||||
</MudItem>
|
||||
<MudItem xs="6">
|
||||
<MudText Typo="Typo.subtitle2" Color="Color.Secondary">블로그 카테고리</MudText>
|
||||
<MudText>@activeSeason.RelatedCategorySlug</MudText>
|
||||
</MudItem>
|
||||
<MudItem xs="12">
|
||||
<MudText Typo="Typo.subtitle2" Color="Color.Secondary">긴박감 배지 문구</MudText>
|
||||
<MudText><code>@activeSeason.UrgencyBadge</code></MudText>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudAlert Severity="Severity.Info">
|
||||
선택한 날짜(@(simulationDate?.ToString("MM월 dd일") ?? "-"))는 시즌 비활성 기간입니다.
|
||||
홈페이지는 기본 Hero를 표시합니다.
|
||||
</MudAlert>
|
||||
<div style="background: linear-gradient(135deg, #1a365d 0%, #2a4365 100%); border-radius: 12px; padding: 2rem; color: white; margin-top: 1.5rem;">
|
||||
<div style="font-size: 1.8rem; font-weight: 800; margin-bottom: 0.5rem;">
|
||||
사업자 세금, 부동산,<br/>가족자산까지
|
||||
</div>
|
||||
<div style="font-size: 0.95rem; color: rgba(255,255,255,0.8); margin-bottom: 1.5rem;">
|
||||
세무사·부동산중개사·보험설계사 자격 보유 | 온라인 맞춤 상담
|
||||
</div>
|
||||
<div style="background: #e53e3e; color: white; display: inline-block; padding: 10px 20px; border-radius: 8px; font-weight: 700;">
|
||||
무료 상담 신청
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</MudPaper>
|
||||
|
||||
<MudPaper Class="pa-4 mt-4" Elevation="1">
|
||||
<MudText Typo="Typo.h6" Class="mb-3">연간 시즌 타임라인</MudText>
|
||||
<MudSimpleTable Dense="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>기간</th>
|
||||
<th>시즌</th>
|
||||
<th>블로그 카테고리</th>
|
||||
<th>상태</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var s in TaxSeasonCalendar.Seasons)
|
||||
{
|
||||
var isActive = activeSeason?.Key == s.Key;
|
||||
<tr style="@(isActive ? "background: rgba(66,153,225,0.1);" : "")">
|
||||
<td style="white-space: nowrap;">
|
||||
@s.StartMonth/@s.StartDay ~ @s.EndMonth/@s.EndDay
|
||||
</td>
|
||||
<td>@s.Name</td>
|
||||
<td><code style="font-size:0.8rem;">@s.RelatedCategorySlug</code></td>
|
||||
<td>
|
||||
@if (isActive)
|
||||
{
|
||||
<MudChip T="string" Size="Size.Small" Color="Color.Success">활성</MudChip>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span style="color: #a0aec0; font-size: 0.85rem;">비활성</span>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</MudSimpleTable>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
|
||||
@code {
|
||||
private DateTime? simulationDate = DateTime.Today;
|
||||
private CurrentSeasonDto? activeSeason;
|
||||
|
||||
protected override void OnInitialized() => ComputeSeason();
|
||||
|
||||
private void ComputeSeason()
|
||||
{
|
||||
if (simulationDate == null) { activeSeason = null; return; }
|
||||
var date = simulationDate.Value;
|
||||
var season = TaxSeasonCalendar.Seasons.FirstOrDefault(s =>
|
||||
{
|
||||
var start = new DateTime(date.Year, s.StartMonth, s.StartDay);
|
||||
var endYear = (s.EndMonth < s.StartMonth) ? date.Year + 1 : date.Year;
|
||||
var end = new DateTime(endYear, s.EndMonth, s.EndDay);
|
||||
return date >= start && date <= end;
|
||||
});
|
||||
|
||||
if (season == null) { activeSeason = null; return; }
|
||||
|
||||
var endYearCalc = (season.EndMonth < season.StartMonth) ? date.Year + 1 : date.Year;
|
||||
var deadline = new DateTime(endYearCalc, season.EndMonth, season.EndDay);
|
||||
var ddays = (deadline.Date - date.Date).Days;
|
||||
|
||||
var badge = ddays <= 7 && ddays >= 0
|
||||
? season.UrgencyBadge.Replace("{n}", ddays.ToString())
|
||||
: season.UrgencyBadge;
|
||||
|
||||
activeSeason = new CurrentSeasonDto
|
||||
{
|
||||
Key = season.Key,
|
||||
Name = season.Name,
|
||||
HeroHeadline = season.HeroHeadline,
|
||||
HeroSubtext = season.HeroSubtext,
|
||||
UrgencyBadge = badge,
|
||||
FocusService = season.FocusService,
|
||||
RelatedCategorySlug = season.RelatedCategorySlug,
|
||||
CtaText = season.CtaText,
|
||||
DaysUntilDeadline = ddays,
|
||||
Deadline = deadline
|
||||
};
|
||||
}
|
||||
|
||||
private void JumpToSeason(TaxSeason season)
|
||||
{
|
||||
simulationDate = new DateTime(DateTime.Today.Year, season.StartMonth, season.StartDay);
|
||||
ComputeSeason();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
@using TaxBaik.Application.Services
|
||||
@inject TaxFilingService FilingService
|
||||
@inject ISnackbar Snackbar
|
||||
|
||||
@if (Filings == null || Filings.Count == 0)
|
||||
{
|
||||
<MudText Class="pa-4" Color="Color.Secondary">항목이 없습니다.</MudText>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudTable Items="Filings" Hover="true" Dense="true" Class="mt-2">
|
||||
<HeaderContent>
|
||||
<MudTh>고객</MudTh>
|
||||
<MudTh>신고 유형</MudTh>
|
||||
<MudTh>기한</MudTh>
|
||||
<MudTh>D-day</MudTh>
|
||||
<MudTh>메모</MudTh>
|
||||
<MudTh>처리</MudTh>
|
||||
</HeaderContent>
|
||||
<RowTemplate>
|
||||
<MudTd>@context.ClientName</MudTd>
|
||||
<MudTd>@context.FilingType</MudTd>
|
||||
<MudTd>@context.DueDate.ToString("yyyy-MM-dd")</MudTd>
|
||||
<MudTd>
|
||||
@{
|
||||
var dday = (context.DueDate.Date - DateTime.Today).Days;
|
||||
}
|
||||
@if (dday < 0)
|
||||
{
|
||||
<MudChip T="string" Size="Size.Small" Color="Color.Error">D+@(-dday)</MudChip>
|
||||
}
|
||||
else if (dday <= 7)
|
||||
{
|
||||
<MudChip T="string" Size="Size.Small" Color="Color.Warning">D-@dday</MudChip>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudText Typo="Typo.body2">D-@dday</MudText>
|
||||
}
|
||||
</MudTd>
|
||||
<MudTd>@(context.Memo ?? "")</MudTd>
|
||||
<MudTd>
|
||||
@if (context.Status == "pending")
|
||||
{
|
||||
<MudButton Size="Size.Small" Variant="Variant.Filled" Color="Color.Success"
|
||||
OnClick="@(() => MarkFiled(context))">완료</MudButton>
|
||||
}
|
||||
else if (context.Status == "filed")
|
||||
{
|
||||
<MudChip T="string" Size="Size.Small" Color="Color.Success">완료</MudChip>
|
||||
}
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Delete" Size="Size.Small" Color="Color.Error"
|
||||
OnClick="@(() => DeleteFiling(context.Id))" />
|
||||
</MudTd>
|
||||
</RowTemplate>
|
||||
</MudTable>
|
||||
}
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public List<Domain.Entities.TaxFiling>? Filings { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public EventCallback OnStatusChange { get; set; }
|
||||
|
||||
private async Task MarkFiled(Domain.Entities.TaxFiling filing)
|
||||
{
|
||||
filing.Status = "filed";
|
||||
await FilingService.UpdateAsync(filing);
|
||||
Snackbar.Add("신고 완료 처리되었습니다.", Severity.Success);
|
||||
await OnStatusChange.InvokeAsync();
|
||||
}
|
||||
|
||||
private async Task DeleteFiling(int id)
|
||||
{
|
||||
await FilingService.DeleteAsync(id);
|
||||
Snackbar.Add("삭제되었습니다.", Severity.Info);
|
||||
await OnStatusChange.InvokeAsync();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
@page "/admin/tax-filings"
|
||||
@attribute [Authorize]
|
||||
@using TaxBaik.Application.Services
|
||||
@inject TaxFilingService FilingService
|
||||
@inject ClientService ClientService
|
||||
@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">
|
||||
<MudSelect T="string" @bind-Value="newFilingType" Label="신고 유형 *" Variant="Variant.Outlined">
|
||||
@foreach (var t in TaxFilingService.FilingTypes)
|
||||
{
|
||||
<MudSelectItem Value="@t">@t</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
</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();
|
||||
|
||||
private async Task Reload()
|
||||
{
|
||||
var all = (await FilingService.GetUpcomingAsync(365)).ToList();
|
||||
// Also get filed ones by fetching all
|
||||
pending = all.Where(x => x.Status == "pending").ToList();
|
||||
filed = all.Where(x => x.Status == "filed").ToList();
|
||||
overdue = all.Where(x => x.Status == "overdue").ToList();
|
||||
}
|
||||
|
||||
private async Task<IEnumerable<Domain.Entities.Client>> SearchClients(string value)
|
||||
{
|
||||
var (items, _) = await ClientService.GetPagedAsync(1, 20, search: value);
|
||||
return items;
|
||||
}
|
||||
|
||||
private async Task AddFiling()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (selectedClient == null)
|
||||
{
|
||||
Snackbar.Add("고객을 선택하세요.", Severity.Warning);
|
||||
return;
|
||||
}
|
||||
var filing = new Domain.Entities.TaxFiling
|
||||
{
|
||||
ClientId = selectedClient.Id,
|
||||
FilingType = newFilingType,
|
||||
DueDate = newDueDate?.ToUniversalTime() ?? DateTime.UtcNow,
|
||||
Status = "pending",
|
||||
Memo = string.IsNullOrWhiteSpace(newMemo) ? null : newMemo
|
||||
};
|
||||
await FilingService.CreateAsync(filing);
|
||||
showAddForm = false;
|
||||
Snackbar.Add("신고 일정이 추가되었습니다.", Severity.Success);
|
||||
await Reload();
|
||||
}
|
||||
catch (ValidationException ex)
|
||||
{
|
||||
Snackbar.Add(ex.Message, Severity.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user