docs: CURRENT_WORKS.md 가지급금 관리 API 작업 내용 추가

This commit is contained in:
2025-12-18 14:31:42 +09:00
parent af833194ea
commit acb7a45a31

View File

@@ -1,5 +1,84 @@
# SAM API 작업 현황
## 2025-12-18 (수) - 가지급금 관리 API 개발
### 작업 목표
- `docs/plans/erp-api-development-plan.md` Phase 3의 3.5 가지급금 관리
- 가지급금 CRUD, 정산 처리, 인정이자 계산/리포트 API 구현
### 생성된 마이그레이션 (1개)
| 파일명 | 설명 |
|--------|------|
| `2025_12_18_120001_create_loans_table.php` | 가지급금 테이블 (tenant_id, user_id, loan_date, amount, purpose, settlement_date, settlement_amount, status, withdrawal_id) |
### 생성된 모델 (1개)
**app/Models/Tenants/Loan.php:**
- 가지급금 모델 (BelongsToTenant, SoftDeletes)
- 상태: outstanding(미정산), settled(정산완료), partial(부분정산)
- 인정이자율: 연 4.6% (2024/2025), DEFAULT_INTEREST_RATE
- 세금: 법인세 19%, 소득세 35%, 주민세 10%
- Relations: user(), withdrawal(), creator(), updater()
- Methods: calculateRecognizedInterest(), calculateTaxes(), isEditable(), isSettleable()
### 생성된 서비스 (1개)
**app/Services/LoanService.php:**
- CRUD: index, show, store, update, destroy
- 요약: summary (미정산 건수/금액, 정산완료 금액)
- 정산: settle (전액/부분 정산)
- 인정이자: calculateInterest, interestReport
### 생성된 FormRequest (5개)
| 파일명 | 설명 |
|--------|------|
| `LoanIndexRequest.php` | 목록 조회 (user_id, status, date_from, date_to, per_page) |
| `LoanStoreRequest.php` | 등록 (user_id, loan_date, amount, purpose, withdrawal_id) |
| `LoanUpdateRequest.php` | 수정 (선택적 필드) |
| `LoanSettleRequest.php` | 정산 (settlement_date, settlement_amount) |
| `LoanCalculateInterestRequest.php` | 인정이자 계산 (year, user_id) |
### 생성된 컨트롤러 (1개)
**app/Http/Controllers/Api/V1/LoanController.php:**
- index, summary, store, show, update, destroy, settle, calculateInterest, interestReport
### API 라우트 (9개)
| Method | Endpoint | 설명 |
|--------|----------|------|
| GET | /v1/loans | 목록 조회 |
| POST | /v1/loans | 등록 |
| GET | /v1/loans/summary | 요약 조회 |
| POST | /v1/loans/calculate-interest | 인정이자 계산 |
| GET | /v1/loans/interest-report/{year} | 인정이자 리포트 |
| GET | /v1/loans/{id} | 상세 조회 |
| PUT | /v1/loans/{id} | 수정 |
| DELETE | /v1/loans/{id} | 삭제 |
| POST | /v1/loans/{id}/settle | 정산 |
### i18n 키 추가
**lang/ko/message.php:**
- loan.fetched, loan.created, loan.updated, loan.deleted
- loan.settled, loan.summary_fetched
- loan.interest_calculated, loan.interest_report_fetched
**lang/ko/error.php:**
- loan.not_found, loan.not_editable, loan.not_deletable
- loan.not_settleable, loan.settlement_exceeds
- loan.invalid_withdrawal, loan.user_not_found
**lang/ko/validation.php (attributes):**
- loan_date, amount, purpose, settlement_date, settlement_amount, year
### Git 커밋
- `af83319` - feat: 가지급금 관리 API 구현
---
## 2025-12-17 (화) - 전자결재 모듈 API 개발
### 작업 목표