공사관리 리스트 공통화: - 입찰/계약/견적/인수인계/이슈/품목/노무/현장/파트너/단가/기성/현장브리핑/구조검토/유틸리티/작업자현황 리스트 공통 포맷터 적용 - 중복 포맷팅 로직 제거 (-530줄) 캘린더 기능 개선: - CEODashboard CalendarSection 기능 확장 - ScheduleCalendar DayCell/MonthView/WeekView 개선 - ui/calendar 컴포넌트 기능 추가 유틸리티 개선: - date.ts 날짜 유틸 함수 추가 - formatAmount.ts 금액 포맷 함수 추가 신규 추가: - useListHandlers 훅 추가 - src/constants/ 디렉토리 추가 - 포맷터 공통화 계획 문서 추가 - SAM ERP/MES 정체성 분석 문서 추가 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
3.5 KiB
3.5 KiB
금액/날짜 포맷터 공통화 계획
작성일: 2026-02-05 상태: ✅ 완료 목적: 중복 정의된 formatAmount, formatDate 함수를 공통 유틸로 통합
📊 현황 분석
이미 존재하는 유틸
| 파일 | 함수 | 설명 |
|---|---|---|
src/utils/formatAmount.ts |
formatAmount() |
자동 만원 변환 (1만 이상 → "N만원") |
formatAmountWon() |
항상 원 단위 ("N원") | |
formatAmountManwon() |
항상 만원 단위 ("N만원") | |
formatKoreanAmount() |
억/만 축약 ("1억 5,000만") | |
formatNumber() |
신규 단순 천단위 콤마 | |
src/utils/date.ts |
getLocalDateString() |
YYYY-MM-DD 반환 |
getTodayString() |
오늘 날짜 YYYY-MM-DD | |
formatDateForInput() |
input용 날짜 변환 | |
formatDate() |
신규 YYYY-MM-DD 표시용 | |
formatDateRange() |
신규 "시작 ~ 종료" 형식 |
📊 결과 요약
마이그레이션 완료 파일
formatAmount → formatNumber (12개 파일) ✅
| 파일 | 상태 |
|---|---|
construction/contract/ContractListClient.tsx |
✅ 완료 |
construction/contract/ContractDetailForm.tsx |
✅ 완료 |
construction/bidding/BiddingListClient.tsx |
✅ 완료 |
construction/bidding/BiddingDetailForm.tsx |
✅ 완료 |
construction/estimates/EstimateListClient.tsx |
✅ 완료 |
construction/estimates/modals/EstimateDocumentContent.tsx |
✅ 완료 |
construction/handover-report/HandoverReportListClient.tsx |
✅ 완료 |
construction/handover-report/HandoverReportDetailForm.tsx |
✅ 완료 |
construction/handover-report/modals/HandoverReportDocumentModal.tsx |
✅ 완료 |
construction/utility-management/UtilityManagementListClient.tsx |
✅ 완료 |
construction/estimates/utils/formatters.ts |
✅ re-export로 변경 |
formatDate 공통화 (7개 파일) ✅
| 파일 | 상태 |
|---|---|
construction/contract/ContractListClient.tsx |
✅ 완료 (formatDateRange) |
construction/bidding/BiddingListClient.tsx |
✅ 완료 |
construction/handover-report/HandoverReportListClient.tsx |
✅ 완료 (formatDateRange) |
construction/utility-management/UtilityManagementListClient.tsx |
✅ 완료 |
construction/issue-management/IssueManagementListClient.tsx |
✅ 완료 |
construction/structure-review/StructureReviewListClient.tsx |
✅ 완료 |
construction/management/ConstructionDetailClient.tsx |
✅ 완료 |
마이그레이션 제외 (한글 형식 유지)
| 파일 | 사유 |
|---|---|
handover-report/modals/HandoverReportDocumentModal.tsx |
한글 형식 ("년 월 일") |
order-management/modals/OrderDocumentModal.tsx |
한글 형식 ("년 월 일") |
📋 효과
| 항목 | Before | After |
|---|---|---|
| formatAmount 정의 | 12개 파일 | 1개 파일 (formatNumber) |
| formatDate 정의 | 8개 파일 | 1개 파일 |
| 중복 코드 라인 | ~150줄 | 0줄 |
| 포맷 변경 시 수정 | 20개 파일 | 1개 파일 |
⚠️ 주의사항
-
기존 formatAmount()와 formatNumber() 차이
- 기존
formatAmount(): 자동 만원 변환 (유지됨) - 신규
formatNumber(): 단순 천단위 콤마만
- 기존
-
한글 날짜 형식은 별도 유지
- 문서 모달에서 사용하는 "년 월 일" 형식은 로컬 유지
- 공통
formatDate()는 YYYY-MM-DD 형식만 처리
-
backward compatibility
estimates/utils/formatters.ts는formatNumber를formatAmount로 re-export