fix(admin): align holiday tests and loading flow
TaxBaik CI/CD / build-and-deploy (push) Successful in 4m14s

This commit is contained in:
2026-07-02 11:02:20 +09:00
parent 124b3b4dfc
commit e65f01b196
8 changed files with 34 additions and 78 deletions
@@ -7,9 +7,9 @@ public class BusinessDayCalculatorTests
{
[Theory]
[InlineData(2026, 2, 14, 2026, 2, 19)]
[InlineData(2026, 8, 15, 2026, 8, 20)]
[InlineData(2026, 9, 24, 2026, 9, 29)]
[InlineData(2026, 10, 3, 2026, 10, 8)]
[InlineData(2026, 8, 15, 2026, 8, 18)]
[InlineData(2026, 9, 24, 2026, 9, 28)]
[InlineData(2026, 10, 3, 2026, 10, 6)]
[InlineData(2027, 2, 6, 2027, 2, 10)]
public void GetEffectiveDueDate_SkipsWeekendHolidayAndSubstituteHoliday(
int dueYear, int dueMonth, int dueDay,
@@ -112,18 +112,14 @@
a.Title.Contains(searchQuery, StringComparison.OrdinalIgnoreCase))
.OrderBy(a => a.SortOrder) ?? Enumerable.Empty<Announcement>();
protected override async Task OnAfterRenderAsync(bool firstRender)
protected override async Task OnInitializedAsync()
{
if (firstRender)
if (AuthStateTask != null)
{
if (AuthStateTask != null)
var authState = await AuthStateTask;
if (authState.User.Identity?.IsAuthenticated == true)
{
var authState = await AuthStateTask;
if (authState.User.Identity?.IsAuthenticated == true)
{
await LoadAsync();
StateHasChanged();
}
await LoadAsync();
}
}
}
@@ -130,18 +130,14 @@
private int totalPages;
private const int PageSize = 20;
protected override async Task OnAfterRenderAsync(bool firstRender)
protected override async Task OnInitializedAsync()
{
if (firstRender)
if (AuthStateTask != null)
{
if (AuthStateTask != null)
var authState = await AuthStateTask;
if (authState.User.Identity?.IsAuthenticated == true)
{
var authState = await AuthStateTask;
if (authState.User.Identity?.IsAuthenticated == true)
{
await LoadAsync();
StateHasChanged();
}
await LoadAsync();
}
}
}
@@ -128,18 +128,14 @@
private ConsultingActivity? editingActivity;
private ConsultingActivityForm activityForm = new();
protected override async Task OnAfterRenderAsync(bool firstRender)
protected override async Task OnInitializedAsync()
{
if (firstRender)
if (AuthStateTask != null)
{
if (AuthStateTask != null)
var authState = await AuthStateTask;
if (authState.User.Identity?.IsAuthenticated == true)
{
var authState = await AuthStateTask;
if (authState.User.Identity?.IsAuthenticated == true)
{
await LoadData();
StateHasChanged();
}
await LoadData();
}
}
}
@@ -116,18 +116,14 @@
(f.Answer != null && f.Answer.Contains(searchQuery, StringComparison.OrdinalIgnoreCase)))
.OrderBy(f => f.SortOrder) ?? Enumerable.Empty<Faq>();
protected override async Task OnAfterRenderAsync(bool firstRender)
protected override async Task OnInitializedAsync()
{
if (firstRender)
if (AuthStateTask != null)
{
if (AuthStateTask != null)
var authState = await AuthStateTask;
if (authState.User.Identity?.IsAuthenticated == true)
{
var authState = await AuthStateTask;
if (authState.User.Identity?.IsAuthenticated == true)
{
await LoadAsync();
StateHasChanged();
}
await LoadAsync();
}
}
}
@@ -124,18 +124,14 @@
private bool isDialogOpen;
private RevenueForm revenueForm = new();
protected override async Task OnAfterRenderAsync(bool firstRender)
protected override async Task OnInitializedAsync()
{
if (firstRender)
if (AuthStateTask != null)
{
if (AuthStateTask != null)
var authState = await AuthStateTask;
if (authState.User.Identity?.IsAuthenticated == true)
{
var authState = await AuthStateTask;
if (authState.User.Identity?.IsAuthenticated == true)
{
await LoadData();
StateHasChanged();
}
await LoadData();
}
}
}
@@ -178,19 +178,15 @@ else
private TaxFilingSchedule? selectedSchedule;
private TaxFilingScheduleForm scheduleForm = new();
protected override async Task OnAfterRenderAsync(bool firstRender)
protected override async Task OnInitializedAsync()
{
if (firstRender)
if (AuthStateTask != null)
{
if (AuthStateTask != null)
var authState = await AuthStateTask;
if (authState.User.Identity?.IsAuthenticated == true)
{
var authState = await AuthStateTask;
if (authState.User.Identity?.IsAuthenticated == true)
{
await LoadData();
PrepareCreate();
StateHasChanged();
}
await LoadData();
PrepareCreate();
}
}
}
@@ -74,26 +74,6 @@ public static class BusinessDayCalculator
}
}
// 주말과 연속 공휴일 뒤에 붙는 대체휴일을 다음 영업일로 자동 확장한다.
foreach (var window in HolidayWindows)
{
foreach (var date in window.Dates())
{
if (date.DayOfWeek is not DayOfWeek.Saturday and not DayOfWeek.Sunday)
{
continue;
}
var substitute = date.AddDays(1);
while (substitute.DayOfWeek is DayOfWeek.Saturday or DayOfWeek.Sunday || holidays.Contains(substitute))
{
substitute = substitute.AddDays(1);
}
holidays.Add(substitute);
}
}
return holidays;
}
}