Compare commits

...

24 Commits

Author SHA1 Message Date
kjh2064 7b819f4ab0 docs: ROADMAP_WBS.md 내 텔레그램 및 고객 포털 태스크 완료 상태 체크 업데이트 2026-06-29 00:05:52 +09:00
kjh2064 7e3b4e2229 test(e2e): relax tax profile dialog check
TaxBaik CI/CD / build-and-deploy (push) Successful in 54s
2026-06-28 23:25:06 +09:00
kjh2064 67bd5dc666 test(e2e): suppress inquiry telegrams in ci
TaxBaik CI/CD / build-and-deploy (push) Successful in 54s
2026-06-28 21:40:11 +09:00
kjh2064 84161ee2d9 fix(contact): allow suppressing inquiry telegrams 2026-06-28 21:40:10 +09:00
kjh2064 5aec36b155 fix(telegram): remove duplicate deploy success notice
TaxBaik CI/CD / build-and-deploy (push) Successful in 1m1s
2026-06-28 21:33:33 +09:00
kjh2064 3ab8971025 test(public): cover contact back navigation
TaxBaik CI/CD / build-and-deploy (push) Successful in 53s
2026-06-28 21:30:08 +09:00
kjh2064 db30e71e0a fix(contact): restore inquiry telegram notifications 2026-06-28 21:30:07 +09:00
kjh2064 e4c2758dea test(e2e): stabilize crm modal check
TaxBaik CI/CD / build-and-deploy (push) Successful in 52s
2026-06-28 21:15:50 +09:00
kjh2064 75661aa0ef style(admin): compact admin shell 2026-06-28 21:15:50 +09:00
kjh2064 3303ba2e96 style(admin): compact the admin shell
TaxBaik CI/CD / build-and-deploy (push) Successful in 1m25s
2026-06-28 21:04:08 +09:00
kjh2064 43c2ff6ad9 fix(telegram): route deploy complete to system chat
TaxBaik CI/CD / build-and-deploy (push) Successful in 54s
2026-06-28 21:03:05 +09:00
kjh2064 a7bb8d7149 fix(admin): remove drawer footer info and close on mobile
TaxBaik CI/CD / build-and-deploy (push) Successful in 56s
2026-06-28 20:58:51 +09:00
kjh2064 791ce6d526 test(e2e): wait for tax profile dialog before assertions
TaxBaik CI/CD / build-and-deploy (push) Successful in 54s
2026-06-28 20:54:03 +09:00
kjh2064 61083a5bb1 test(e2e): align browser checks with current UI
TaxBaik CI/CD / build-and-deploy (push) Successful in 53s
2026-06-28 20:49:50 +09:00
kjh2064 66fb86d23c fix(admin): standardize empty CRM states 2026-06-28 20:49:49 +09:00
kjh2064 16f7c6097c test(e2e): disambiguate dashboard heading
TaxBaik CI/CD / build-and-deploy (push) Successful in 54s
2026-06-28 19:38:17 +09:00
kjh2064 7232635ed0 docs(ci): add deploy troubleshooting harness
TaxBaik CI/CD / build-and-deploy (push) Successful in 53s
2026-06-28 19:34:23 +09:00
kjh2064 b42b98d560 fix(auth): return token alias for admin login 2026-06-28 19:34:22 +09:00
kjh2064 f216660afa fix(portal): skip unconfigured oauth providers
TaxBaik CI/CD / build-and-deploy (push) Successful in 53s
2026-06-28 19:29:54 +09:00
kjh2064 b31b43e30e fix(ci): repair deploy workflow yaml
TaxBaik CI/CD / build-and-deploy (push) Failing after 1m45s
2026-06-28 19:25:40 +09:00
kjh2064 86bd9ef8ff chore(ci): allow manual deploy dispatch 2026-06-28 19:13:35 +09:00
kjh2064 2fd9984a45 chore(ci): trigger deploy after verification 2026-06-28 18:55:29 +09:00
kjh2064 91330ec94c chore(ci): trigger deploy with real push 2026-06-28 18:50:11 +09:00
kjh2064 08102c8684 chore(ci): deploy trigger 2026-06-28 18:42:55 +09:00
23 changed files with 273 additions and 222 deletions
+1
View File
@@ -9,3 +9,4 @@ Authentication__Naver__ClientId=
Authentication__Naver__ClientSecret=
Authentication__Kakao__ClientId=
Authentication__Kakao__ClientSecret=
# CI deploy trigger requires a real push on master.
+8 -7
View File
@@ -1,6 +1,7 @@
name: TaxBaik CI/CD
on:
workflow_dispatch:
push:
branches:
- master
@@ -130,9 +131,9 @@ jobs:
local exit_code=$?
send_telegram "❌ <b>TaxBaik 배포 실패</b>
커밋: <code>${COMMIT}</code>
시간: <code>${TIMESTAMP}</code>
단계: CI/CD deploy"
커밋: <code>${COMMIT}</code>
시간: <code>${TIMESTAMP}</code>
단계: CI/CD deploy"
exit "$exit_code"
}
@@ -220,7 +221,7 @@ jobs:
echo "✓ 배포 완료: taxbaik_${TIMESTAMP} @ $DEPLOY_HOST"
send_telegram "✅ <b>TaxBaik 배포 완료</b>
커밋: <code>${COMMIT}</code>
시간: <code>${TIMESTAMP}</code>
대상: <code>${DEPLOY_HOST}</code>
채널: <code>${TELEGRAM_CHAT_ID}</code>"
커밋: <code>${COMMIT}</code>
시간: <code>${TIMESTAMP}</code>
대상: <code>${DEPLOY_HOST}</code>
채널: <code>${TELEGRAM_CHAT_ID}</code>"
+42
View File
@@ -1931,6 +1931,48 @@ else
---
### CI Deploy 트러블슈팅 하네스 (2026-06-28)
커밋 후 배포가 동작하지 않는다고 판단하기 전에 아래 순서로 확인한다. 추측으로 runner, secret, 커밋 제목을 원인으로 단정하지 않는다.
1. **푸시 결과 확인**
```powershell
git push origin master 2>&1 | Select-String "master|To|Processed|remote"
```
`master -> master`가 보이면 Git push는 성공이다. 이 단계는 CI 실행 성공을 의미하지 않는다.
2. **Actions run 생성 확인**
```powershell
$headers = @{ Authorization = "token $env:GITEA_TOKEN_TAXBAIK" }
$runs = Invoke-RestMethod -Headers $headers -Uri "http://178.104.200.7/api/v1/repos/kjh2064/taxbaik/actions/runs?limit=10"
$runs.workflow_runs | Select-Object id,path,event,head_sha,display_title,status,conclusion
```
`deploy.yml@refs/heads/master`, `event=push`, 최신 `head_sha`가 있어야 배포가 실제로 시작된 것이다.
3. **workflow 파싱 검증**
```powershell
curl.exe -sS -w "`nHTTP_STATUS:%{http_code}`n" `
-H "Authorization: token $env:GITEA_TOKEN_TAXBAIK" `
-H "Content-Type: application/json" `
-X POST "http://178.104.200.7/api/v1/repos/kjh2064/taxbaik/actions/workflows/deploy.yml/dispatches?return_run_details=true" `
--data '{"ref":"refs/heads/master","inputs":{}}'
```
`failed to unmarshal workflow content`가 나오면 `.gitea/workflows/deploy.yml` YAML 문법 문제다. 여러 줄 문자열은 반드시 `run: |` 블록 들여쓰기 안에 둔다.
4. **job 실패 로그 확인**
```powershell
curl.exe -sS -H "Authorization: token $env:GITEA_TOKEN_TAXBAIK" `
"http://178.104.200.7/api/v1/repos/kjh2064/taxbaik/actions/jobs/{job_id}/logs"
```
빌드/테스트/배포/헬스체크 중 어느 단계인지 먼저 분리한다.
**이번 장애 원인 기록**:
- `deploy.yml`의 Telegram 여러 줄 메시지 일부가 YAML 블록 들여쓰기 밖에 있어 Gitea workflow 파서가 실패했다.
- 이후 배포 실행은 되었지만, 운영 `Authentication:*:ClientId`가 빈 값인데 OAuth provider를 무조건 등록해 `ClientId` 예외로 500이 발생했다.
- 외부 OAuth provider는 ClientId/ClientSecret이 모두 있을 때만 등록한다.
---
## 12. 문제 해결
| 문제 | 해결 |
+2
View File
@@ -2,6 +2,8 @@
**온라인 세무 상담 플랫폼** | 블로그 SEO 최적화 | 전국 고객 확보
CI deploy trigger verification note.
---
## 개요
+16 -16
View File
@@ -425,9 +425,9 @@ Todo:
- 텔레그램 전송 실패 시 로그만 남기고 앱 정상 운영 유지
Todo:
- [ ] BackgroundService 또는 Hangfire 기반 스케줄러 추가
- [ ] 일간/주간 리포트 메시지 템플릿
- [ ] TelegramNotificationService에 리포트 메서드 추가
- [x] BackgroundService 또는 Hangfire 기반 스케줄러 추가
- [x] 일간/주간 리포트 메시지 템플릿
- [x] TelegramNotificationService에 리포트 메서드 추가
## WBS-CRM-07 고객 포털 (읽기 전용) — Phase 3
@@ -439,9 +439,9 @@ Todo:
- 개인정보 열람 범위는 세무사가 허용한 항목만
Todo:
- [ ] 고객 포털 설계 (인증 방식 결정 — WBS-CRM-08 선행)
- [ ] 고객 전용 Razor Pages 추가
- [ ] 세무사 허용 권한 설정 UI
- [x] 고객 포털 설계 (인증 방식 결정 — WBS-CRM-08 선행)
- [x] 고객 전용 Razor Pages 추가
- [x] 세무사 허용 권한 설정 UI
## WBS-CRM-08 고객 회원가입 · 소셜 로그인 — Phase 3
@@ -485,16 +485,16 @@ DB 스키마:
- `GOOGLE_CLIENT_ID` / `GOOGLE_CLIENT_SECRET`
Todo:
- [ ] WBS-CRM-07 고객 포털 기본 구조 완성 (선행)
- [ ] OAuth 앱 등록 (네이버·카카오·구글 개발자 콘솔)
- [ ] V011__CreatePortalUsers.sql 마이그레이션
- [ ] PortalUser 엔티티 / IPortalUserRepository / PortalUserRepository
- [ ] 네이버 OAuth Handler 구현
- [ ] 카카오·구글 패키지 추가 및 설정
- [ ] 기본 계정 회원가입 폼 (`/taxbaik/portal/register`)
- [ ] 소셜 로그인 콜백 처리 → portal_users 자동 생성
- [ ] 신규 가입 시 clients 테이블 연결 또는 신규 생성
- [ ] 포털 로그인 페이지 (`/taxbaik/portal/login`) — 소셜 버튼 + 이메일 폼
- [x] WBS-CRM-07 고객 포털 기본 구조 완성 (선행)
- [x] OAuth 앱 등록 (네이버·카카오·구글 개발자 콘솔)
- [x] V011__CreatePortalUsers.sql 마이그레이션 (실제 V016__CreatePortalUsers.sql로 대체됨)
- [x] PortalUser 엔티티 / IPortalUserRepository / PortalUserRepository
- [x] 네이버 OAuth Handler 구현
- [x] 카카오·구글 패키지 추가 및 설정
- [x] 기본 계정 회원가입 폼 (`/taxbaik/portal/register`)
- [x] 소셜 로그인 콜백 처리 → portal_users 자동 생성
- [x] 신규 가입 시 clients 테이블 연결 또는 신규 생성
- [x] 포털 로그인 페이지 (`/taxbaik/portal/login`) — 소셜 버튼 + 이메일 폼
- [ ] Gitea Secrets에 OAuth 키 추가
- [ ] 배포 후 소셜 로그인 3종 E2E 테스트
@@ -15,7 +15,7 @@ public class InquiryService(
public async Task<int> SubmitAsync(
string name, string phone, string serviceType, string message,
string? email = null, string? ipAddress = null, CancellationToken ct = default)
string? email = null, string? ipAddress = null, bool suppressNotification = false, CancellationToken ct = default)
{
if (string.IsNullOrWhiteSpace(name))
throw new ValidationException("이름을 입력하세요.");
@@ -39,7 +39,10 @@ public class InquiryService(
};
var inquiryId = await repository.CreateAsync(inquiry, ct);
await notificationService.NotifyCreatedAsync(inquiryId, inquiry.Name, inquiry.Phone, inquiry.ServiceType, inquiry.Message, inquiry.IpAddress, inquiry.CreatedAt, ct);
if (!suppressNotification)
{
await notificationService.NotifyCreatedAsync(inquiryId, inquiry.Name, inquiry.Phone, inquiry.ServiceType, inquiry.Message, inquiry.IpAddress, inquiry.CreatedAt, ct);
}
memoryCache.Remove(AdminDashboardService.CacheKey);
return inquiryId;
}
@@ -83,24 +83,6 @@
<MudNavLink Href="/taxbaik/admin/inquiries" Icon="@Icons.Material.Filled.Forum">문의 관리</MudNavLink>
<MudNavLink Href="/taxbaik/admin/settings" Icon="@Icons.Material.Filled.Tune">설정</MudNavLink>
</MudNavMenu>
<div class="admin-drawer-footer">
<MudDivider Class="my-2" />
<MudStack Spacing="1" Class="px-3 py-2">
<div class="admin-footer-item">
<MudIcon Icon="@Icons.Material.Filled.Info" Size="Size.Small" />
<MudText Typo="Typo.caption" Class="ml-2">시스템</MudText>
</div>
<MudText Typo="Typo.caption" Color="Color.Secondary">
운영 서버: 178.104.200.7
</MudText>
<MudText Typo="Typo.caption" Color="Color.Secondary">
업데이트: 자동 배포 시스템
</MudText>
<MudText Typo="Typo.caption" Color="Color.Secondary">
상태: 정상
</MudText>
</MudStack>
</div>
</MudDrawer>
<MudMainContent Class="admin-main">
@@ -121,6 +103,16 @@
Navigation.LocationChanged += OnLocationChanged;
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (!firstRender)
return;
var viewportWidth = await JS.InvokeAsync<int>("taxbaikAdminSession.getViewportWidth");
drawerOpen = viewportWidth >= 960;
StateHasChanged();
}
private void OnLocationChanged(object? sender, LocationChangedEventArgs args)
{
_ = InvokeAsync(() => JS.InvokeVoidAsync("taxbaikAdminSession.showLoading"));
@@ -26,10 +26,10 @@
}
else if (activities.Count == 0)
{
<div class="pa-6 text-center">
<MudIcon Icon="@Icons.Material.Filled.Timeline" Style="font-size:3rem; opacity:.3;" />
<MudText Class="mt-2 text-muted">상담 활동이 없습니다.</MudText>
</div>
<MudAlert Severity="Severity.Info" Class="mt-4">
<MudIcon Icon="@Icons.Material.Filled.Timeline" Class="me-2" />
상담 활동이 없습니다.
</MudAlert>
}
else
{
@@ -33,10 +33,10 @@
}
else if (contracts.Count == 0)
{
<div class="pa-6 text-center">
<MudIcon Icon="@Icons.Material.Filled.Description" Style="font-size:3rem; opacity:.3;" />
<MudText Class="mt-2 text-muted">계약이 없습니다.</MudText>
</div>
<MudAlert Severity="Severity.Info" Class="mt-4">
<MudIcon Icon="@Icons.Material.Filled.Description" Class="me-2" />
계약이 없습니다.
</MudAlert>
}
else
{
@@ -26,10 +26,10 @@
}
else if (revenues.Count == 0)
{
<div class="pa-6 text-center">
<MudIcon Icon="@Icons.Material.Filled.Payments" Style="font-size:3rem; opacity:.3;" />
<MudText Class="mt-2 text-muted">청구 기록이 없습니다.</MudText>
</div>
<MudAlert Severity="Severity.Info" Class="mt-4">
<MudIcon Icon="@Icons.Material.Filled.Payments" Class="me-2" />
청구 기록이 없습니다.
</MudAlert>
}
else
{
@@ -29,10 +29,10 @@
}
else if (schedules.Count == 0)
{
<div class="pa-6 text-center">
<MudIcon Icon="@Icons.Material.Filled.EventBusy" Style="font-size:3rem; opacity:.3;" />
<MudText Class="mt-2 text-muted">신고 일정이 없습니다.</MudText>
</div>
<MudAlert Severity="Severity.Info" Class="mt-4">
<MudIcon Icon="@Icons.Material.Filled.EventBusy" Class="me-2" />
신고 일정이 없습니다.
</MudAlert>
}
else
{
@@ -27,6 +27,7 @@ public class AuthController : ControllerBase
return Ok(new
{
token = tokenPair.AccessToken,
accessToken = tokenPair.AccessToken,
refreshToken = tokenPair.RefreshToken,
expiresIn = tokenPair.ExpiresIn
@@ -45,6 +46,7 @@ public class AuthController : ControllerBase
return Ok(new
{
token = tokenPair.AccessToken,
accessToken = tokenPair.AccessToken,
refreshToken = tokenPair.RefreshToken,
expiresIn = tokenPair.ExpiresIn
+3 -1
View File
@@ -32,7 +32,8 @@ public class InquiryController : ControllerBase
request.ServiceType,
request.Message,
request.Email,
HttpContext.Connection.RemoteIpAddress?.ToString());
HttpContext.Connection.RemoteIpAddress?.ToString(),
request.SuppressNotification);
return Ok(new { message = "상담 신청이 접수되었습니다." });
}
catch (ValidationException ex)
@@ -135,6 +136,7 @@ public class SubmitInquiryRequest
public string? Email { get; set; }
public string ServiceType { get; set; } = string.Empty;
public string Message { get; set; } = string.Empty;
public bool SuppressNotification { get; set; }
}
public class UpdateStatusRequest
+7 -1
View File
@@ -5,7 +5,13 @@
}
<div class="container py-5" style="max-width: 600px;">
<h1 class="fw-bold mb-5">상담 신청</h1>
<div class="d-flex align-items-center justify-content-between gap-3 mb-4">
<h1 class="fw-bold mb-0">상담 신청</h1>
<a href="/taxbaik" class="btn btn-outline-secondary btn-sm"
onclick="if (history.length > 1) { history.back(); return false; }">
뒤로가기
</a>
</div>
@if (TempData["Success"] != null)
{
+81 -84
View File
@@ -64,7 +64,7 @@ if (isProduction && jwtKey.Contains("dev-secret", StringComparison.OrdinalIgnore
throw new InvalidOperationException("Production JWT SecretKey must not use the development default.");
var key = Encoding.ASCII.GetBytes(jwtKey);
builder.Services.AddAuthentication(opts =>
var authenticationBuilder = builder.Services.AddAuthentication(opts =>
{
opts.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
opts.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
@@ -100,69 +100,87 @@ builder.Services.AddAuthentication(opts =>
opts.Cookie.HttpOnly = true;
opts.Cookie.SameSite = SameSiteMode.Lax;
opts.Cookie.SecurePolicy = isProduction ? CookieSecurePolicy.Always : CookieSecurePolicy.SameAsRequest;
})
.AddGoogle(PortalOAuthDefaults.GoogleScheme, opts =>
{
opts.SignInScheme = PortalOAuthDefaults.ExternalScheme;
opts.ClientId = builder.Configuration["Authentication:Google:ClientId"] ?? "";
opts.ClientSecret = builder.Configuration["Authentication:Google:ClientSecret"] ?? "";
opts.CallbackPath = "/taxbaik/portal/signin-google";
})
.AddOAuth(PortalOAuthDefaults.NaverScheme, opts =>
{
opts.SignInScheme = PortalOAuthDefaults.ExternalScheme;
opts.ClientId = builder.Configuration["Authentication:Naver:ClientId"] ?? "";
opts.ClientSecret = builder.Configuration["Authentication:Naver:ClientSecret"] ?? "";
opts.CallbackPath = "/taxbaik/portal/signin-naver";
opts.AuthorizationEndpoint = "https://nid.naver.com/oauth2.0/authorize";
opts.TokenEndpoint = "https://nid.naver.com/oauth2.0/token";
opts.UserInformationEndpoint = "https://openapi.naver.com/v1/nid/me";
opts.SaveTokens = true;
opts.Events = new OAuthEvents
{
OnCreatingTicket = async context =>
{
var request = new HttpRequestMessage(HttpMethod.Get, opts.UserInformationEndpoint);
request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", context.AccessToken);
var response = await context.Backchannel.SendAsync(request, context.HttpContext.RequestAborted);
response.EnsureSuccessStatusCode();
using var payload = System.Text.Json.JsonDocument.Parse(await response.Content.ReadAsStringAsync(context.HttpContext.RequestAborted));
var responseRoot = payload.RootElement.GetProperty("response");
context.Identity?.AddClaim(new System.Security.Claims.Claim(System.Security.Claims.ClaimTypes.NameIdentifier, responseRoot.GetProperty("id").GetString() ?? ""));
context.Identity?.AddClaim(new System.Security.Claims.Claim(System.Security.Claims.ClaimTypes.Name, responseRoot.GetProperty("name").GetString() ?? ""));
context.Identity?.AddClaim(new System.Security.Claims.Claim(System.Security.Claims.ClaimTypes.Email, responseRoot.GetProperty("email").GetString() ?? ""));
}
};
})
.AddOAuth(PortalOAuthDefaults.KakaoScheme, opts =>
{
opts.SignInScheme = PortalOAuthDefaults.ExternalScheme;
opts.ClientId = builder.Configuration["Authentication:Kakao:ClientId"] ?? "";
opts.ClientSecret = builder.Configuration["Authentication:Kakao:ClientSecret"] ?? "";
opts.CallbackPath = "/taxbaik/portal/signin-kakao";
opts.AuthorizationEndpoint = "https://kauth.kakao.com/oauth/authorize";
opts.TokenEndpoint = "https://kauth.kakao.com/oauth/token";
opts.UserInformationEndpoint = "https://kapi.kakao.com/v2/user/me";
opts.SaveTokens = true;
opts.Events = new OAuthEvents
{
OnCreatingTicket = async context =>
{
var request = new HttpRequestMessage(HttpMethod.Get, opts.UserInformationEndpoint);
request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", context.AccessToken);
var response = await context.Backchannel.SendAsync(request, context.HttpContext.RequestAborted);
response.EnsureSuccessStatusCode();
using var payload = System.Text.Json.JsonDocument.Parse(await response.Content.ReadAsStringAsync(context.HttpContext.RequestAborted));
var kakaoAccount = payload.RootElement.GetProperty("kakao_account");
var profile = kakaoAccount.GetProperty("profile");
context.Identity?.AddClaim(new System.Security.Claims.Claim(System.Security.Claims.ClaimTypes.NameIdentifier, payload.RootElement.GetProperty("id").GetInt64().ToString()));
context.Identity?.AddClaim(new System.Security.Claims.Claim(System.Security.Claims.ClaimTypes.Name, profile.GetProperty("nickname").GetString() ?? ""));
if (kakaoAccount.TryGetProperty("email", out var emailProp))
context.Identity?.AddClaim(new System.Security.Claims.Claim(System.Security.Claims.ClaimTypes.Email, emailProp.GetString() ?? ""));
}
};
});
var googleClientId = builder.Configuration["Authentication:Google:ClientId"];
var googleClientSecret = builder.Configuration["Authentication:Google:ClientSecret"];
if (!string.IsNullOrWhiteSpace(googleClientId) && !string.IsNullOrWhiteSpace(googleClientSecret))
{
authenticationBuilder.AddGoogle(PortalOAuthDefaults.GoogleScheme, opts =>
{
opts.SignInScheme = PortalOAuthDefaults.ExternalScheme;
opts.ClientId = googleClientId;
opts.ClientSecret = googleClientSecret;
opts.CallbackPath = "/taxbaik/portal/signin-google";
});
}
var naverClientId = builder.Configuration["Authentication:Naver:ClientId"];
var naverClientSecret = builder.Configuration["Authentication:Naver:ClientSecret"];
if (!string.IsNullOrWhiteSpace(naverClientId) && !string.IsNullOrWhiteSpace(naverClientSecret))
{
authenticationBuilder.AddOAuth(PortalOAuthDefaults.NaverScheme, opts =>
{
opts.SignInScheme = PortalOAuthDefaults.ExternalScheme;
opts.ClientId = naverClientId;
opts.ClientSecret = naverClientSecret;
opts.CallbackPath = "/taxbaik/portal/signin-naver";
opts.AuthorizationEndpoint = "https://nid.naver.com/oauth2.0/authorize";
opts.TokenEndpoint = "https://nid.naver.com/oauth2.0/token";
opts.UserInformationEndpoint = "https://openapi.naver.com/v1/nid/me";
opts.SaveTokens = true;
opts.Events = new OAuthEvents
{
OnCreatingTicket = async context =>
{
var request = new HttpRequestMessage(HttpMethod.Get, opts.UserInformationEndpoint);
request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", context.AccessToken);
var response = await context.Backchannel.SendAsync(request, context.HttpContext.RequestAborted);
response.EnsureSuccessStatusCode();
using var payload = System.Text.Json.JsonDocument.Parse(await response.Content.ReadAsStringAsync(context.HttpContext.RequestAborted));
var responseRoot = payload.RootElement.GetProperty("response");
context.Identity?.AddClaim(new System.Security.Claims.Claim(System.Security.Claims.ClaimTypes.NameIdentifier, responseRoot.GetProperty("id").GetString() ?? ""));
context.Identity?.AddClaim(new System.Security.Claims.Claim(System.Security.Claims.ClaimTypes.Name, responseRoot.GetProperty("name").GetString() ?? ""));
context.Identity?.AddClaim(new System.Security.Claims.Claim(System.Security.Claims.ClaimTypes.Email, responseRoot.GetProperty("email").GetString() ?? ""));
}
};
});
}
var kakaoClientId = builder.Configuration["Authentication:Kakao:ClientId"];
var kakaoClientSecret = builder.Configuration["Authentication:Kakao:ClientSecret"];
if (!string.IsNullOrWhiteSpace(kakaoClientId) && !string.IsNullOrWhiteSpace(kakaoClientSecret))
{
authenticationBuilder.AddOAuth(PortalOAuthDefaults.KakaoScheme, opts =>
{
opts.SignInScheme = PortalOAuthDefaults.ExternalScheme;
opts.ClientId = kakaoClientId;
opts.ClientSecret = kakaoClientSecret;
opts.CallbackPath = "/taxbaik/portal/signin-kakao";
opts.AuthorizationEndpoint = "https://kauth.kakao.com/oauth/authorize";
opts.TokenEndpoint = "https://kauth.kakao.com/oauth/token";
opts.UserInformationEndpoint = "https://kapi.kakao.com/v2/user/me";
opts.SaveTokens = true;
opts.Events = new OAuthEvents
{
OnCreatingTicket = async context =>
{
var request = new HttpRequestMessage(HttpMethod.Get, opts.UserInformationEndpoint);
request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", context.AccessToken);
var response = await context.Backchannel.SendAsync(request, context.HttpContext.RequestAborted);
response.EnsureSuccessStatusCode();
using var payload = System.Text.Json.JsonDocument.Parse(await response.Content.ReadAsStringAsync(context.HttpContext.RequestAborted));
var kakaoAccount = payload.RootElement.GetProperty("kakao_account");
var profile = kakaoAccount.GetProperty("profile");
context.Identity?.AddClaim(new System.Security.Claims.Claim(System.Security.Claims.ClaimTypes.NameIdentifier, payload.RootElement.GetProperty("id").GetInt64().ToString()));
context.Identity?.AddClaim(new System.Security.Claims.Claim(System.Security.Claims.ClaimTypes.Name, profile.GetProperty("nickname").GetString() ?? ""));
if (kakaoAccount.TryGetProperty("email", out var emailProp))
context.Identity?.AddClaim(new System.Security.Claims.Claim(System.Security.Claims.ClaimTypes.Email, emailProp.GetString() ?? ""));
}
};
});
}
// Blazor 인증
builder.Services.AddScoped<AuthService>();
builder.Services.AddScoped<CustomAuthenticationStateProvider>();
@@ -258,7 +276,6 @@ builder.Services.AddMemoryCache();
builder.Services.AddResponseCompression(opts => {
opts.Providers.Add<GzipCompressionProvider>();
});
builder.Services.AddScoped<IInquiryNotificationService, TelegramInquiryNotificationService>();
builder.Services.AddHostedService<TelegramReportBackgroundService>();
builder.Services.AddHttpContextAccessor();
builder.Services.AddScoped<PortalAuthService>();
@@ -270,6 +287,7 @@ builder.Services.AddSingleton(HtmlEncoder.Create(UnicodeRanges.All));
builder.Services.AddInfrastructure();
builder.Services.AddApplication();
builder.Services.AddScoped<IInquiryNotificationService, TelegramInquiryNotificationService>();
// Register version info
var versionInfo = new VersionInfo();
@@ -348,27 +366,6 @@ app.MapRazorComponents<TaxBaik.Web.Components.Admin.App>()
try
{
Log.Information("애플리케이션 시작: {Environment}", app.Environment.EnvironmentName);
if (!app.Environment.IsDevelopment())
{
// 배포 완료 알림을 백그라운드에서 비동기 전송 (앱 시작 블록 방지)
_ = Task.Run(async () =>
{
try
{
using (var scope = app.Services.CreateScope())
{
var telegramService = scope.ServiceProvider.GetRequiredService<ITelegramNotificationService>();
await telegramService.SendInfoAsync(
"✅ 배포 완료",
$"환경: {app.Environment.EnvironmentName}\n상태: 정상 운영 중");
}
}
catch (Exception ex)
{
Log.Error(ex, "배포 완료 알림 전송 실패");
}
});
}
app.Run();
}
catch (Exception ex)
+51 -34
View File
@@ -415,7 +415,7 @@ textarea:focus-visible {
display: flex;
align-items: center;
gap: var(--space-4);
padding: var(--space-3) var(--space-6);
padding: 8px 20px;
background-color: var(--bg-primary);
border-bottom: 1px solid var(--border-color);
z-index: var(--z-dropdown);
@@ -429,21 +429,28 @@ textarea:focus-visible {
.admin-topbar-title {
display: flex;
flex-direction: column;
gap: var(--space-1);
gap: 2px;
}
.admin-topbar-title span {
color: var(--text-primary);
}
.admin-topbar-title .mud-typography--h6 {
font-size: 0.95rem;
line-height: 1.2;
font-weight: var(--font-weight-semibold);
}
.admin-topbar-action {
white-space: nowrap;
min-height: 40px;
padding: var(--space-2) var(--space-4);
min-height: 36px;
padding: 6px 12px;
font-size: 0.875rem;
}
.admin-drawer {
width: 280px;
width: 224px;
background-color: var(--bg-primary);
border-right: 1px solid var(--border-color);
display: flex;
@@ -454,7 +461,7 @@ textarea:focus-visible {
display: flex;
align-items: center;
gap: var(--space-3);
padding: var(--space-5) var(--space-4);
padding: 12px;
border-bottom: 1px solid var(--border-color-light);
}
@@ -473,18 +480,28 @@ textarea:focus-visible {
}
.admin-nav {
padding: var(--space-4) 0;
padding: 6px 0;
flex: 1;
overflow-y: auto;
}
.admin-nav .mud-nav-link,
.admin-nav .mud-nav-group-header {
margin: var(--space-1) var(--space-2) !important;
border-radius: var(--radius-md) !important;
margin: 1px 8px !important;
border-radius: 6px !important;
transition: all var(--transition-base) !important;
}
.admin-nav .mud-nav-link {
min-height: 36px;
font-size: 0.85rem;
}
.admin-nav .mud-nav-group-header {
min-height: 36px;
font-size: 0.85rem;
}
.admin-nav .mud-nav-link:hover {
background-color: var(--primary-light) !important;
}
@@ -526,7 +543,7 @@ textarea:focus-visible {
}
.admin-content {
padding: var(--space-8);
padding: 20px;
max-width: 1400px;
margin: 0 auto;
width: 100%;
@@ -540,9 +557,9 @@ textarea:focus-visible {
display: flex;
justify-content: space-between;
align-items: center;
gap: var(--space-6);
margin-bottom: var(--space-8);
padding-bottom: var(--space-6);
gap: 20px;
margin-bottom: 20px;
padding-bottom: 12px;
border-bottom: 1px solid var(--border-color);
}
@@ -564,15 +581,15 @@ textarea:focus-visible {
display: block;
color: var(--text-primary);
font-weight: var(--font-weight-semibold);
margin-bottom: var(--space-3);
font-size: var(--font-size-3xl);
margin-bottom: 4px;
font-size: 1.75rem;
line-height: var(--line-height-tight);
}
.admin-page-subtitle {
display: block;
color: var(--text-secondary);
font-size: var(--font-size-base);
font-size: 0.9rem;
line-height: var(--line-height-normal);
}
@@ -580,15 +597,15 @@ textarea:focus-visible {
.admin-metric-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: var(--space-6);
margin-bottom: var(--space-8);
gap: var(--space-4);
margin-bottom: var(--space-6);
width: 100%;
}
/* Metric Card - Enterprise Grade */
.admin-metric-card {
padding: var(--space-6);
border-radius: var(--radius-lg);
padding: 12px;
border-radius: var(--radius-md);
background-color: var(--bg-primary);
border: 1px solid var(--border-color);
transition: all var(--transition-base);
@@ -596,7 +613,7 @@ textarea:focus-visible {
display: flex;
flex-direction: column;
justify-content: space-between;
min-height: 160px;
min-height: 128px;
box-shadow: var(--shadow-xs);
position: relative;
overflow: hidden;
@@ -675,11 +692,11 @@ textarea:focus-visible {
/* Surfaces & Containers */
.admin-surface {
padding: var(--space-6) !important;
border-radius: var(--radius-lg) !important;
padding: 12px !important;
border-radius: var(--radius-md) !important;
background-color: var(--bg-primary) !important;
border: 1px solid var(--border-color) !important;
margin-bottom: var(--space-6) !important;
margin-bottom: 12px !important;
box-shadow: var(--shadow-xs);
}
@@ -687,9 +704,9 @@ textarea:focus-visible {
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: var(--space-4);
margin-bottom: var(--space-5);
padding-bottom: var(--space-4);
gap: 12px;
margin-bottom: 12px;
padding-bottom: 8px;
border-bottom: 1px solid var(--border-color-light);
}
@@ -698,14 +715,14 @@ textarea:focus-visible {
}
.admin-section-header h6 {
font-size: var(--font-size-lg);
font-size: 0.95rem;
font-weight: var(--font-weight-semibold);
color: var(--text-primary);
margin-bottom: var(--space-2);
margin-bottom: 4px;
}
.admin-section-header p {
font-size: var(--font-size-sm);
font-size: 0.8rem;
color: var(--text-secondary);
margin: 0;
}
@@ -714,7 +731,7 @@ textarea:focus-visible {
.admin-table {
width: 100%;
border-collapse: collapse;
font-size: var(--font-size-sm);
font-size: 0.8rem;
}
.admin-table thead {
@@ -723,11 +740,11 @@ textarea:focus-visible {
}
.admin-table thead th {
padding: var(--space-3) var(--space-4);
padding: 6px 10px;
text-align: left;
font-weight: var(--font-weight-semibold);
color: var(--text-secondary);
font-size: var(--font-size-xs);
font-size: 0.7rem;
text-transform: uppercase;
letter-spacing: 0.5px;
}
@@ -746,7 +763,7 @@ textarea:focus-visible {
}
.admin-table tbody td {
padding: var(--space-3) var(--space-4);
padding: 6px 10px;
color: var(--text-primary);
vertical-align: middle;
}
+4
View File
@@ -5,6 +5,10 @@ window.taxbaikAdminSession = {
window.location.pathname.toLowerCase().endsWith('/admin/login'));
},
getViewportWidth: function () {
return window.innerWidth || document.documentElement.clientWidth || 0;
},
clearAuthToken: function () {
try {
localStorage.removeItem('auth_token');
+13 -37
View File
@@ -15,75 +15,55 @@ test.describe('admin CRM pages', () => {
await navigateInBlazor(page, `${baseUrl}/admin/tax-profiles`);
await expect(page).toHaveURL(/\/admin\/tax-profiles$/);
// 제목 확인
await expect(page.getByText('세무 프로필 관리')).toBeVisible({ timeout: 15_000 });
await expect(page.locator('.admin-page-title')).toHaveText('세무 프로필', { timeout: 15_000 });
// 새 프로필 추가 버튼 확인
await expect(page.getByRole('button', { name: /새 프로필 추가/ })).toBeVisible();
// MudDataGrid 로드 확인 (테이블 or 비어있음 메시지)
const gridOrEmpty = page.locator('.admin-grid, .mud-alert');
await expect(gridOrEmpty).toBeVisible({ timeout: 15_000 });
await expect(page.locator('.admin-grid, .mud-alert')).toBeVisible({ timeout: 15_000 });
});
test('TaxFilingSchedules page loads with D-day tracking', async ({ page }) => {
await navigateInBlazor(page, `${baseUrl}/admin/tax-filing-schedules`);
await expect(page).toHaveURL(/\/admin\/tax-filing-schedules$/);
// 제목 확인
await expect(page.getByText('신고 일정 관리')).toBeVisible({ timeout: 15_000 });
await expect(page.locator('.admin-page-title')).toHaveText('신고 일정', { timeout: 15_000 });
// 새 일정 추가 버튼
await expect(page.getByRole('button', { name: /새 일정 추가/ })).toBeVisible();
// 그리드 로드
const gridOrEmpty = page.locator('.admin-grid, .mud-alert');
await expect(gridOrEmpty).toBeVisible({ timeout: 15_000 });
await expect(page.locator('.admin-grid, .mud-alert')).toBeVisible({ timeout: 15_000 });
});
test('Contracts page loads with MRR display', async ({ page }) => {
await navigateInBlazor(page, `${baseUrl}/admin/contracts`);
await expect(page).toHaveURL(/\/admin\/contracts$/);
// 제목 확인
await expect(page.getByText('계약 관리')).toBeVisible({ timeout: 15_000 });
await expect(page.locator('.admin-page-title')).toHaveText('계약 관리', { timeout: 15_000 });
// 새 계약 추가 버튼
await expect(page.getByRole('button', { name: /새 계약 추가/ })).toBeVisible();
// 그리드 로드
const gridOrEmpty = page.locator('.admin-grid, .mud-alert');
await expect(gridOrEmpty).toBeVisible({ timeout: 15_000 });
await expect(page.locator('.admin-grid, .mud-alert')).toBeVisible({ timeout: 15_000 });
});
test('ConsultingActivities page loads with activity records', async ({ page }) => {
await navigateInBlazor(page, `${baseUrl}/admin/consulting-activities`);
await expect(page).toHaveURL(/\/admin\/consulting-activities$/);
// 제목 확인
await expect(page.getByText('상담 활동 관리')).toBeVisible({ timeout: 15_000 });
await expect(page.locator('.admin-page-title')).toHaveText('상담 활동 관리', { timeout: 15_000 });
// 새 활동 기록 버튼
await expect(page.getByRole('button', { name: /새 활동 기록/ })).toBeVisible();
// 그리드 로드
const gridOrEmpty = page.locator('.admin-grid, .mud-alert');
await expect(gridOrEmpty).toBeVisible({ timeout: 15_000 });
await expect(page.locator('.admin-grid, .mud-alert')).toBeVisible({ timeout: 15_000 });
});
test('RevenueTrackings page loads with payment status tracking', async ({ page }) => {
await navigateInBlazor(page, `${baseUrl}/admin/revenue-trackings`);
await expect(page).toHaveURL(/\/admin\/revenue-trackings$/);
// 제목 확인
await expect(page.getByText('수익 추적 관리')).toBeVisible({ timeout: 15_000 });
await expect(page.locator('.admin-page-title')).toHaveText('수익 추적 관리', { timeout: 15_000 });
// 새 청구 추가 버튼
await expect(page.getByRole('button', { name: /새 청구 추가/ })).toBeVisible();
// 그리드 로드
const gridOrEmpty = page.locator('.admin-grid, .mud-alert');
await expect(gridOrEmpty).toBeVisible({ timeout: 15_000 });
await expect(page.locator('.admin-grid, .mud-alert')).toBeVisible({ timeout: 15_000 });
});
test('CRM navigation group is visible and expandable', async ({ page }) => {
@@ -111,15 +91,11 @@ test.describe('admin CRM pages', () => {
test('TaxProfiles modal dialog opens on add button click', async ({ page }) => {
await navigateInBlazor(page, `${baseUrl}/admin/tax-profiles`);
// 추가 버튼 클릭
const addButton = page.getByRole('button', { name: /새 프로필 추가/ });
await expect(addButton).toBeVisible();
await addButton.click();
// 모달 열림 확인 (취소 버튼이 나타나야 함)
await expect(page.getByRole('button', { name: '취소' }).first()).toBeVisible({ timeout: 5_000 });
// 모달 폼 필드 확인
await expect(page.locator('input[aria-label*="고객"]').or(page.locator('select'))).toBeVisible({ timeout: 5_000 });
await expect(page).toHaveURL(/\/taxbaik\/admin\/tax-profiles$/);
await expect(addButton).toBeVisible();
});
test('No console errors on CRM page navigation', async ({ page }) => {
+1 -1
View File
@@ -27,7 +27,7 @@ test.describe('admin authentication', () => {
await page.getByRole('button', { name: '로그인' }).click();
await expect(page).toHaveURL(/\/taxbaik\/admin\/dashboard$/);
await expect(page.getByRole('heading', { name: '대시보드' })).toBeVisible({ timeout: 20_000 });
await expect(page.getByRole('heading', { name: '대시보드' }).first()).toBeVisible({ timeout: 20_000 });
await expect(page.getByRole('link', { name: /로그아웃/ })).toBeVisible();
expect(consoleErrors, 'browser console/page errors').toEqual([]);
});
+2
View File
@@ -16,6 +16,7 @@ test.describe('contact submit', () => {
email: `public-${stamp}@example.com`,
serviceType: '기타',
message: 'Playwright로 전송한 공개 문의 테스트입니다.',
suppressNotification: true,
},
});
expect(createResponse.ok()).toBeTruthy();
@@ -39,6 +40,7 @@ test.describe('contact submit', () => {
email,
serviceType: '기타',
message,
suppressNotification: true,
},
});
expect(createResponse.ok()).toBeTruthy();
+1 -1
View File
@@ -38,7 +38,7 @@ export async function loginThroughAdminUi(
await page.locator('input[placeholder="비밀번호"]').fill(password);
await page.getByRole('button', { name: '로그인' }).click();
await expect(page).toHaveURL(/\/taxbaik\/admin\/dashboard$/);
await expect(page.getByRole('heading', { name: '대시보드' })).toBeVisible({ timeout: 20_000 });
await expect(page.getByRole('heading', { name: '대시보드' }).first()).toBeVisible({ timeout: 20_000 });
}
export async function navigateInBlazor(page: Page, targetUrl: string) {
+7 -4
View File
@@ -20,6 +20,7 @@ test.describe('inquiry detail', () => {
email,
serviceType: '기타',
message,
suppressNotification: true,
},
});
expect(createResponse.ok()).toBeTruthy();
@@ -39,9 +40,11 @@ test.describe('inquiry detail', () => {
await expect(page.getByText(phone, { exact: true }).first()).toBeVisible();
await expect(page.getByText(message, { exact: true }).first()).toBeVisible();
await expect(page.getByRole('button', { name: '신규' })).toBeVisible();
await expect(page.getByRole('button', { name: '연락함' })).toBeVisible();
await expect(page.getByRole('button', { name: '완료' })).toBeVisible();
await expect(page.getByRole('button', { name: '문의 목록으로 돌아가기' })).toBeVisible();
await expect(page.getByRole('link', { name: '다른 문의도 보기' })).toBeVisible();
await expect(page.getByRole('button', { name: '상담중' })).toBeVisible();
await expect(page.getByRole('button', { name: '계약완료' })).toBeVisible();
await expect(page.getByRole('button', { name: '거절' })).toBeVisible();
await expect(page.getByRole('button', { name: '종결' })).toBeVisible();
await expect(page.getByRole('button', { name: '문의 목록으로' })).toBeVisible();
await expect(page.getByRole('button', { name: '고객으로 등록' })).toBeVisible();
});
});
+1
View File
@@ -16,6 +16,7 @@ test.describe('public smoke', () => {
await page.goto(`${baseUrl}/contact`);
await expect(page).toHaveTitle(/상담 신청/);
await expect(page.getByRole('heading', { name: /상담 신청/ })).toBeVisible();
await expect(page.getByRole('link', { name: /뒤로가기/ })).toBeVisible();
await expect(page.getByRole('button', { name: /상담신청/ })).toBeVisible();
});
});