diff --git a/src/components/business/CEODashboard/sections/CalendarSection.tsx b/src/components/business/CEODashboard/sections/CalendarSection.tsx index 28bbcb42..6ba5a879 100644 --- a/src/components/business/CEODashboard/sections/CalendarSection.tsx +++ b/src/components/business/CEODashboard/sections/CalendarSection.tsx @@ -48,6 +48,7 @@ const ISSUE_BADGE_COLORS: Record = { '지출예상내역서': 'bg-green-100 text-green-700', '세금 신고': 'bg-red-100 text-red-700', '결재 요청': 'bg-yellow-100 text-yellow-700', + '신규거래처': 'bg-emerald-100 text-emerald-700', '기타': 'bg-gray-100 text-gray-700', }; diff --git a/src/components/business/CEODashboard/sections/TodayIssueSection.tsx b/src/components/business/CEODashboard/sections/TodayIssueSection.tsx index 65b1b53d..4fe8d625 100644 --- a/src/components/business/CEODashboard/sections/TodayIssueSection.tsx +++ b/src/components/business/CEODashboard/sections/TodayIssueSection.tsx @@ -23,9 +23,25 @@ const BADGE_COLORS: Record = { '지출예상내역서': 'bg-green-100 text-green-700 hover:bg-green-100', '세금 신고': 'bg-red-100 text-red-700 hover:bg-red-100', '결재 요청': 'bg-yellow-100 text-yellow-700 hover:bg-yellow-100', + '신규거래처': 'bg-emerald-100 text-emerald-700 hover:bg-emerald-100', '기타': 'bg-gray-100 text-gray-700 hover:bg-gray-100', }; +// 신용등급 색상 매핑 (A=녹색, B=노랑, C=주황, D=빨강) +type CreditRating = 'A' | 'B' | 'C' | 'D'; +const CREDIT_RATING_COLORS: Record = { + A: 'bg-green-500 hover:bg-green-600 text-white', + B: 'bg-yellow-500 hover:bg-yellow-600 text-white', + C: 'bg-orange-500 hover:bg-orange-600 text-white', + D: 'bg-red-500 hover:bg-red-600 text-white', +}; + +// 랜덤 신용등급 생성 (A~D) +const getRandomCreditRating = (): CreditRating => { + const ratings: CreditRating[] = ['A', 'B', 'C', 'D']; + return ratings[Math.floor(Math.random() * ratings.length)]; +}; + // 필터 옵션 키 const FILTER_KEYS = [ 'all', @@ -35,6 +51,7 @@ const FILTER_KEYS = [ '지출예상내역서', '세금 신고', '결재 요청', + '신규거래처', ] as const; interface TodayIssueSectionProps { @@ -49,6 +66,17 @@ export function TodayIssueSection({ items }: TodayIssueSectionProps) { // 확인되지 않은 아이템만 필터링 const activeItems = items.filter((item) => !dismissedIds.has(item.id)); + // 신규거래처 아이템별 랜덤 신용등급 생성 (세션 동안 유지) + const creditRatings = useMemo(() => { + const ratings: Record = {}; + items.forEach((item) => { + if (item.badge === '신규거래처') { + ratings[item.id] = getRandomCreditRating(); + } + }); + return ratings; + }, [items]); + // 항목별 수량 계산 const itemCounts = useMemo(() => { const counts: Record = { all: activeItems.length }; @@ -150,6 +178,23 @@ export function TodayIssueSection({ items }: TodayIssueSectionProps) { {item.content} + {/* 신용등급 배지 (신규거래처인 경우) */} + {item.badge === '신규거래처' && creditRatings[item.id] && ( + + )} + {/* 시간 */} {item.time} diff --git a/src/components/business/CEODashboard/types.ts b/src/components/business/CEODashboard/types.ts index de852326..2fcff0f0 100644 --- a/src/components/business/CEODashboard/types.ts +++ b/src/components/business/CEODashboard/types.ts @@ -64,6 +64,7 @@ export type TodayIssueListBadgeType = | '지출예상내역서' | '세금 신고' | '결재 요청' + | '신규거래처' | '기타'; // 오늘의 이슈 리스트 아이템 (리스트 형태 - 새로운 오늘의 이슈용) diff --git a/src/lib/api/dashboard/transformers.ts b/src/lib/api/dashboard/transformers.ts index f00882cf..935d60d2 100644 --- a/src/lib/api/dashboard/transformers.ts +++ b/src/lib/api/dashboard/transformers.ts @@ -577,6 +577,7 @@ const VALID_BADGE_TYPES: TodayIssueListBadgeType[] = [ '지출예상내역서', '세금 신고', '결재 요청', + '신규거래처', '기타', ];