feat(WEB): 공사관리 리스트 공통화 및 캘린더/포맷터 기능 개선

공사관리 리스트 공통화:
- 입찰/계약/견적/인수인계/이슈/품목/노무/현장/파트너/단가/기성/현장브리핑/구조검토/유틸리티/작업자현황 리스트 공통 포맷터 적용
- 중복 포맷팅 로직 제거 (-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>
This commit is contained in:
유병철
2026-02-05 17:38:38 +09:00
parent 2639724f9f
commit 32d6e3bbbd
36 changed files with 852 additions and 530 deletions

View File

@@ -0,0 +1,102 @@
/**
* 달력 이벤트 상수 (공휴일, 세금 마감일)
* - 매년 연말에 다음 연도 데이터 추가 필요
* - 추후 API 연동 시 이 파일을 API 호출로 대체
*/
export type CalendarEventType = 'holiday' | 'tax';
export interface CalendarEvent {
date: string;
name: string;
type: CalendarEventType;
}
// ============================================
// 2026년 공휴일
// ============================================
export const HOLIDAYS_2026: CalendarEvent[] = [
{ date: '2026-01-01', name: '신정', type: 'holiday' },
{ date: '2026-02-16', name: '설날 연휴', type: 'holiday' },
{ date: '2026-02-17', name: '설날', type: 'holiday' },
{ date: '2026-02-18', name: '설날 연휴', type: 'holiday' },
{ date: '2026-03-01', name: '삼일절', type: 'holiday' },
{ date: '2026-03-02', name: '대체공휴일(삼일절)', type: 'holiday' }, // 3/1이 일요일
{ date: '2026-05-05', name: '어린이날', type: 'holiday' },
{ date: '2026-05-24', name: '부처님오신날', type: 'holiday' },
{ date: '2026-06-06', name: '현충일', type: 'holiday' },
{ date: '2026-08-15', name: '광복절', type: 'holiday' },
{ date: '2026-08-17', name: '대체공휴일(광복절)', type: 'holiday' }, // 8/15가 토요일
{ date: '2026-09-24', name: '추석 연휴', type: 'holiday' },
{ date: '2026-09-25', name: '추석', type: 'holiday' },
{ date: '2026-09-26', name: '추석 연휴', type: 'holiday' },
{ date: '2026-10-03', name: '개천절', type: 'holiday' },
{ date: '2026-10-09', name: '한글날', type: 'holiday' },
{ date: '2026-12-25', name: '성탄절', type: 'holiday' },
];
// ============================================
// 2026년 주요 세금 마감일
// ============================================
export const TAX_DEADLINES_2026: CalendarEvent[] = [
{ date: '2026-01-26', name: '부가세 2기 확정신고', type: 'tax' }, // 1/25가 일요일 → 1/26
{ date: '2026-03-31', name: '법인세 신고', type: 'tax' },
{ date: '2026-06-01', name: '종합소득세 신고', type: 'tax' }, // 5/31이 일요일 → 6/1
{ date: '2026-07-27', name: '부가세 1기 확정신고', type: 'tax' }, // 7/25가 토요일 → 7/27
];
// ============================================
// 연도별 통합 데이터
// ============================================
export const CALENDAR_EVENTS: Record<number, CalendarEvent[]> = {
2026: [...HOLIDAYS_2026, ...TAX_DEADLINES_2026],
};
// ============================================
// 유틸리티 함수
// ============================================
/**
* 특정 날짜의 모든 이벤트 조회
*/
export function getEventsForDate(date: string): CalendarEvent[] {
const year = parseInt(date.substring(0, 4), 10);
const events = CALENDAR_EVENTS[year] || [];
return events.filter((e) => e.date === date);
}
/**
* 공휴일 여부 확인
*/
export function isHoliday(date: string): boolean {
const year = parseInt(date.substring(0, 4), 10);
const events = CALENDAR_EVENTS[year] || [];
return events.some((e) => e.date === date && e.type === 'holiday');
}
/**
* 세금 마감일 여부 확인
*/
export function isTaxDeadline(date: string): boolean {
const year = parseInt(date.substring(0, 4), 10);
const events = CALENDAR_EVENTS[year] || [];
return events.some((e) => e.date === date && e.type === 'tax');
}
/**
* 공휴일명 조회
*/
export function getHolidayName(date: string): string | null {
const events = getEventsForDate(date);
const holiday = events.find((e) => e.type === 'holiday');
return holiday?.name || null;
}
/**
* 세금 마감일명 조회
*/
export function getTaxDeadlineName(date: string): string | null {
const events = getEventsForDate(date);
const tax = events.find((e) => e.type === 'tax');
return tax?.name || null;
}