Files
sam-docs/dev/changes/20260122_tax_simulation_api.md
권혁성 db63fcff85 refactor: [docs] 팀별 폴더 구조 재편 (공유/개발/프론트/기획)
- 개발팀 전용 폴더 dev/ 생성 (standards, guides, quickstart, changes, deploys, data, history, dev_plans 이동)
- 프론트엔드 전용 폴더 frontend/ 생성 (api/ → frontend/api-specs/)
- 기획팀 폴더 requests/ 생성
- plans/ → dev/dev_plans/ 이름 변경
- README.md 신규 (사람용 안내), INDEX.md 재작성 (Claude Code용)
- resources.md 신규 (노션 링크용, assets/brochure 이관 예정)
- CURRENT_WORKS.md 삭제, TODO.md → dev/ 이동
- 전체 참조 경로 업데이트

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 16:46:03 +09:00

104 lines
3.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 변경 내용 요약
**날짜:** 2026-01-22
**작업자:** Claude Code
**계획 문서:** docs/dev_plans/card-management-section-plan.md
**Phase:** 1.3 세금 시뮬레이션 API 개발
## 📋 변경 개요
CEO 대시보드 카드/가지급금 관리 섹션(cm2)의 세금 시뮬레이션 API 엔드포인트 신규 추가.
가지급금으로 인한 법인세 및 소득세 추가 부담을 시뮬레이션하여 세금 비교 분석 데이터 제공.
## 📁 수정된 파일
- `api/app/Services/LoanService.php` - taxSimulation() 메서드 추가
- `api/app/Http/Controllers/Api/V1/LoanController.php` - taxSimulation() 액션 추가
- `api/routes/api.php` - /tax-simulation 라우트 등록
- `api/app/Swagger/v1/LoanApi.php` - LoanTaxSimulation 스키마 및 엔드포인트 문서화
## 🔧 상세 변경 사항
### 1. LoanService.php
**신규 메서드:**
- `taxSimulation(int $year)` - 세금 시뮬레이션 데이터 반환
- 기존 `summary()` 호출하여 미정산 가지급금 총액 획득
- 기존 `calculateInterest()` 호출하여 인정이자 계산
- 법인세 비교 (가지급금 유무에 따른 세금 차이)
- 소득세 비교 (대표이사 상여처분 시나리오)
**응답 구조:**
```php
[
'year' => int, // 시뮬레이션 연도
'loan_summary' => [
'total_outstanding' => float, // 가지급금 잔액
'recognized_interest' => float, // 인정이자
'interest_rate' => float, // 이자율 (4.6%)
],
'corporate_tax' => [ // 법인세 비교
'without_loan' => [
'taxable_income' => float,
'tax_amount' => float,
],
'with_loan' => [
'taxable_income' => float, // 인정이자
'tax_amount' => float, // 인정이자 × 19%
],
'difference' => float, // 추가 법인세
'rate_info' => string, // "법인세 19% 적용"
],
'income_tax' => [ // 소득세 비교
'without_loan' => [
'taxable_income' => float,
'tax_rate' => string,
'tax_amount' => float,
],
'with_loan' => [
'taxable_income' => float,
'tax_rate' => string, // "35%"
'tax_amount' => float,
],
'difference' => float,
'breakdown' => [
'income_tax' => float, // 소득세 (35%)
'local_tax' => float, // 지방소득세 (소득세의 10%)
'insurance' => float, // 4대보험 추정 (9%)
],
],
]
```
### 2. LoanController.php
**신규 액션:**
```php
public function taxSimulation(LoanCalculateInterestRequest $request): JsonResponse
```
### 3. api/routes/api.php
**신규 라우트:**
```php
Route::get('/tax-simulation', [LoanController::class, 'taxSimulation'])
->name('v1.loans.tax-simulation');
```
### 4. LoanApi.php (Swagger)
**신규 스키마:**
- `LoanTaxSimulation` - 세금 시뮬레이션 응답 전체 구조
**신규 엔드포인트:**
- `GET /api/v1/loans/tax-simulation?year={year}`
## ✅ 테스트 체크리스트
- [x] Pint 코드 스타일 검증 통과
- [x] 라우트 등록 확인 (php artisan route:list)
- [x] Swagger 문서 생성 완료
- [ ] API 호출 테스트 (Swagger UI)
- [ ] 프론트엔드 연동 테스트
## ⚠️ 배포 시 주의사항
특이사항 없음 (DB 스키마 변경 없음)
## 🔗 관련 문서
- 계획 문서: `docs/dev_plans/card-management-section-plan.md`
- Phase 1.1 변경: `docs/changes/20260122_card_transaction_dashboard_api.md`
- Phase 1.2 변경: `docs/changes/20260122_loan_dashboard_api.md`
- 기존 API 문서: `api/app/Swagger/v1/LoanApi.php`