This commit is contained in:
2026-07-15 18:33:33 +09:00
parent 6b1583103f
commit f533082537
201 changed files with 19776 additions and 563 deletions
@@ -0,0 +1,67 @@
---
status: stable
page_id: A08_Support
related_pages: ["[[A08_Support/A08_frontend]]", "[[A06_Login/A06_backend]]", "[[db_schema/logs_monitoring]]"]
last_updated: 2026-07-12
---
# A08_Support — Backend
기술지원 문의 접수 API. `support_requests` 테이블 저장 + 관리자 알림 메일.
## 파일 구조
| 파일 | 위치 | 역할 |
|---|---|---|
| `A08_Support_Router.py` | `A08_Support/A08_Support_Router.py:1-68` | 문의 접수 API (prefix `/api/a08`) |
| `A08_Support_Schema.py` | `A08_Support/A08_Support_Schema.py:1-13` | 문의 요청 검증 Pydantic 모델 |
## API 엔드포인트
| 엔드포인트 | 위치 | 역할 |
|---|---|---|
| `POST /api/a08/support` | `A08_Support/A08_Support_Router.py:27` | 문의 접수. DB 저장 + ADMIN_EMAIL로 알림 메일 |
## 내부 헬퍼
| 함수 | 위치 | 역할 |
|---|---|---|
| `_get_company_name(company_id)` | `A08_Support/A08_Support_Router.py:16` | company_id로 회사명 조회 (없으면 None) |
## 요청 스키마 (Pydantic)
| 모델 | 위치 | 필드 |
|---|---|---|
| `SupportRequestPayload` | `A08_Support/A08_Support_Schema.py:6` | name(1~255), email(EmailStr), phone?(≤30), subject(1~255), message(1~5000) |
## 접수 로직
1. `get_optional_session()`으로 로그인 여부 확인 (비로그인 허용)
2. 로그인 상태면 세션의 `company_id``_get_company_name()`으로 회사명 조회, 비로그인이면 None
3. `support_requests` INSERT (아래 컬럼)
4. ADMIN_EMAIL 설정 시 관리자에게 문의 알림 메일 발송
## DB 저장 컬럼 (실 코드 INSERT 기준)
`support_requests`에 INSERT하는 컬럼:
`company_id, company_name, user_name, user_email, user_phone, subject, message`
→ 테이블 정의 → [[db_schema/logs_monitoring]]
## 특징
- **비로그인도 문의 가능** (`get_optional_session`): 세션 없으면 회사 정보만 None으로 저장
- 로그인 상태면 회사 정보 자동 연결
## 의존성 (공통 유틸)
- [[common_util]] — `common_util_auth`(`get_optional_session`), `common_util_email`(`send_email_background`), `common_util_email_templates`(`support_request_email`)
- `config_system``ADMIN_EMAIL`
- DB → [[db_schema/logs_monitoring]]
## ⚠️ DB 스키마 불일치 (확인 필요)
[[db_schema/logs_monitoring]]의 `support_requests` 컬럼은 계획서 기준
(`user_id, title, priority, status`)인데, 실 코드 INSERT는
`company_id, company_name, user_name, user_email, user_phone, subject, message`.
컬럼명이 다름 — 실 DB 스키마 대조 필요 (규칙6: 실 코드 우선). logs_monitoring 갱신 대상.
@@ -0,0 +1,76 @@
---
status: stable
page_id: A08_Support
related_pages: ["[[A08_Support/A08_backend]]", "[[a00_app_shell_framework]]", "[[ui_templates]]"]
last_updated: 2026-07-12
---
# A08_Support — Frontend
기술지원 문의 폼. 이름·이메일·연락처·제목·문의내용(textarea) 입력 후 제출.
## 파일 구조
| 파일 | 위치 | 역할 |
|---|---|---|
| `A08_Support_UI_Page.ts` | `A08_Support/A08_Support_UI_Page.ts:1-217` | 문의 폼 렌더링 + 제출 로직 |
| `A08_Support_UI_Style.css` | `A08_Support/A08_Support_UI_Style.css:1-64` | 스타일 (theme.css 변수만 사용) |
## 컴포넌트 / 함수
| 함수 | 위치 | 역할 |
|---|---|---|
| `renderA08Support(root)` | `A08_Support/A08_Support_UI_Page.ts:69` | 카드+폼 조립, 세션 정보 자동 채움 |
| `onA08_Support_Submit_Click(event)` | `A08_Support/A08_Support_UI_Page.ts:133` | 제출 핸들러(검증→fetch POST) |
| `createTextAreaField(label, placeholder)` | `A08_Support/A08_Support_UI_Page.ts:32` | 여러 줄 textarea 필드(에러 슬롯 포함) 생성 |
## 제출 로직
1. 필수값 검사(name/email/subject/message), 이메일 형식 검사
2. `fetch("/api/a08/support", POST)` 직접 호출 (별도 Api_Fetch 파일 없음)
3. 성공: 폼 리셋 + 성공 메시지(`A08_Support_Success`) 표시
4. 실패: nameField에 오류 메시지 표시
## 세션 자동 채움
- 렌더 후 백그라운드에서 `fetchSessionUser()`([[A06_Login/A06_frontend]]) 호출
- 로그인 상태면 name/email 필드 자동 입력 (렌더링 지연 없음)
## 로컬라이제이션
모든 텍스트는 [[ui_templates]]에서 로드. 하드코딩 금지.
| UI 요소 | 로케일 키 |
|---|---|
| 제목/부제 | `A08_Support_Title`, `A08_Support_Subtitle` |
| 필드 | `A08_Support_Field_Name`, `_Email`, `_Phone`, `_Subject`, `_Message` (+각 Placeholder) |
| 제출 | `A08_Support_Submit` |
| 성공 | `A08_Support_Success` |
| 오류 | `A08_Support_Error_Required`, `A08_Support_Error_Email` |
## 스타일 (CSS)
- `.a08-support__card` — 카드 (max-width: 520px)
- `.a08-support__success` — 성공 메시지(success 색, mist-violet 배경), 기본 hidden
- `.a08-support__form` — flex 열 (gap: spacing-16)
- `.a08-support__textarea` — resize vertical, min-height 120px
- `.a08-support__submit` — 전체 너비 버튼
## 이벤트 핸들러
| 함수 | 위치 | 동작 |
|---|---|---|
| `onA08_Support_Submit_Click()` | `A08_Support/A08_Support_UI_Page.ts:133` | 문의 검증·제출 |
## 의존성
- `config_frontend.ts` — (직접 `/api/a08/support` 상대경로 fetch)
- `common_util_validate``isBlank`, `isValidEmail`
- [[A06_Login/A06_frontend]] — `fetchSessionUser` (세션 자동 채움)
- [[ui_templates]] — `createButton`, `createInputField` (textarea는 자체 구현)
- 백엔드 API → [[A08_Support/A08_backend]]
## 참고
- 문의 폼은 로그인/비로그인 모두 사용 가능 (세션 있으면 name/email 자동 입력)
- textarea는 공통 컴포넌트에 없어 `createTextAreaField`로 자체 구현 (`.ui-field`/`.ui-input` 스타일 상속)