From 682e2db3a3242bbad9bf6d63e5a3bd818095b4c9 Mon Sep 17 00:00:00 2001 From: kjh2064 Date: Mon, 29 Jun 2026 17:14:07 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20CRM=20=EB=8B=A4=EC=9D=B4=EC=96=BC?= =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=9D=98=20ClientId=20=EB=B0=94=EC=9D=B8?= =?UTF-8?q?=EB=94=A9=EC=9D=84=20Nullable=20int=3F=20=EB=A1=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=ED=95=98=EA=B3=A0=20CompanyName=20null=20=EB=8C=80?= =?UTF-8?q?=EB=B9=84=20Fallback=20=EC=9D=B4=EB=A6=84=EC=9D=84=20Name?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EB=A7=A4=ED=95=91=ED=95=98=EC=97=AC=20Mud?= =?UTF-8?q?Select=20=EC=B4=88=EA=B8=B0=20=EB=A0=8C=EB=8D=94=EB=A7=81=20Cir?= =?UTF-8?q?cuit=20=ED=81=AC=EB=9E=98=EC=8B=9C=20=EC=9B=90=EC=B2=9C=20?= =?UTF-8?q?=EC=B0=A8=EB=8B=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Admin/Pages/Contracts.razor | 11 ++++++----- .../Admin/Pages/TaxFilingSchedules.razor | 12 +++++++----- .../Components/Admin/Pages/TaxProfiles.razor | 18 +++++++----------- tests/e2e/helpers/admin-auth.ts | 3 +++ 4 files changed, 23 insertions(+), 21 deletions(-) diff --git a/TaxBaik.Web/Components/Admin/Pages/Contracts.razor b/TaxBaik.Web/Components/Admin/Pages/Contracts.razor index 4b70578..a31ec56 100644 --- a/TaxBaik.Web/Components/Admin/Pages/Contracts.razor +++ b/TaxBaik.Web/Components/Admin/Pages/Contracts.razor @@ -107,10 +107,10 @@ - + @foreach (var client in clients) { - @client.CompanyName + @(string.IsNullOrEmpty(client.CompanyName) ? client.Name : client.CompanyName) } @@ -180,7 +180,7 @@ { contractForm = new ContractForm { - ClientId = clients.FirstOrDefault()?.Id ?? 0, + ClientId = clients.FirstOrDefault()?.Id, StartDate = DateTime.Today }; isDialogOpen = true; @@ -200,8 +200,9 @@ try { + if (contractForm.ClientId == null) return; var newId = await ContractClient.CreateAsync( - contractForm.ClientId, + contractForm.ClientId.Value, contractForm.ContractNumber, contractForm.ServiceType, contractForm.StartDate ?? DateTime.Now, @@ -254,7 +255,7 @@ private class ContractForm { - public int ClientId { get; set; } + public int? ClientId { get; set; } public string ContractNumber { get; set; } = ""; public string ServiceType { get; set; } = ""; public DateTime? StartDate { get; set; } diff --git a/TaxBaik.Web/Components/Admin/Pages/TaxFilingSchedules.razor b/TaxBaik.Web/Components/Admin/Pages/TaxFilingSchedules.razor index 14ce07b..51e45ca 100644 --- a/TaxBaik.Web/Components/Admin/Pages/TaxFilingSchedules.razor +++ b/TaxBaik.Web/Components/Admin/Pages/TaxFilingSchedules.razor @@ -117,16 +117,17 @@ - + Class="mb-4" + RequiredError="고객을 선택하세요."> @foreach (var client in clients) { - @client.CompanyName + @(string.IsNullOrEmpty(client.CompanyName) ? client.Name : client.CompanyName) } @@ -197,7 +198,7 @@ { FilingYear = DateTime.Now.Year, DueDate = DateTime.Today, - ClientId = clients.FirstOrDefault()?.Id ?? 0 + ClientId = clients.FirstOrDefault()?.Id }; isDialogOpen = true; } @@ -216,8 +217,9 @@ try { + if (scheduleForm.ClientId == null) return; var newId = await TaxFilingClient.CreateAsync( - scheduleForm.ClientId, + scheduleForm.ClientId.Value, scheduleForm.FilingType, scheduleForm.DueDate ?? DateTime.Today, scheduleForm.FilingYear); diff --git a/TaxBaik.Web/Components/Admin/Pages/TaxProfiles.razor b/TaxBaik.Web/Components/Admin/Pages/TaxProfiles.razor index 4b29aaa..4098001 100644 --- a/TaxBaik.Web/Components/Admin/Pages/TaxProfiles.razor +++ b/TaxBaik.Web/Components/Admin/Pages/TaxProfiles.razor @@ -84,10 +84,10 @@ else - + @foreach (var client in clients) { - @client.CompanyName + @(string.IsNullOrEmpty(client.CompanyName) ? client.Name : client.CompanyName) } @@ -166,7 +166,7 @@ else editingProfile = null; profileForm = new TaxProfileForm { - ClientId = clients.FirstOrDefault()?.Id ?? 0, + ClientId = clients.FirstOrDefault()?.Id, TaxRiskLevel = "normal", NextFilingDueDate = DateTime.Today.AddMonths(1) }; @@ -202,15 +202,11 @@ else try { - if (isEditMode) + if (isEditMode && editingProfile != null) { - await TaxProfileClient.UpdateAsync( - editingProfile!.Id, - profileForm.BusinessType, - null, - profileForm.NextFilingDueDate, - profileForm.TaxRiskLevel); - Snackbar.Add("세무 프로필이 업데이트되었습니다.", Severity.Success); + await TaxProfileClient.UpdateAsync(editingProfile.Id, profileForm.BusinessType, + null, profileForm.NextFilingDueDate, profileForm.TaxRiskLevel); + Snackbar.Add("세무 프로필이 수정되었습니다.", Severity.Success); } else { diff --git a/tests/e2e/helpers/admin-auth.ts b/tests/e2e/helpers/admin-auth.ts index 7dd29b4..8a27d90 100644 --- a/tests/e2e/helpers/admin-auth.ts +++ b/tests/e2e/helpers/admin-auth.ts @@ -62,6 +62,9 @@ export async function navigateInBlazor(page: Page, targetUrl: string) { // Wait until Blazor Server completes connection and hides the loading spinner overlay await page.locator('#blazor-loading').waitFor({ state: 'hidden', timeout: 15000 }).catch(() => {}); + // Give the SPA router a brief window to unmount the previous page and mount the loading spinner + await page.waitForTimeout(500); + // Also wait for MudBlazor's dynamic loading spinners to disappear (ensuring the grid is interactive) const spinner = page.locator('.mud-progress-circular, .mud-progress-linear-bar'); try {