fix: 오늘의 이슈 뱃지 타입 source_type 기반 매핑
- TodayIssue 모델에 SOURCE_TO_BADGE 매핑 상수 추가 - TodayIssueService에서 source_type 기반 badge 매핑 적용 - 입금/출금 소스 타입 및 뱃지 상수 추가 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -44,9 +44,12 @@ public function summary(int $limit = 30, ?string $badge = null): array
|
||||
$issues = $query->limit($limit)->get();
|
||||
|
||||
$items = $issues->map(function (TodayIssue $issue) {
|
||||
// source_type 기반으로 badge 매핑 (DB 값보다 우선)
|
||||
$badge = TodayIssue::SOURCE_TO_BADGE[$issue->source_type] ?? $issue->badge ?? '기타';
|
||||
|
||||
return [
|
||||
'id' => $issue->source_type.'_'.$issue->source_id,
|
||||
'badge' => $issue->badge,
|
||||
'badge' => $badge,
|
||||
'content' => $issue->content,
|
||||
'time' => $this->formatRelativeTime($issue->created_at),
|
||||
'date' => $issue->created_at?->toDateString(),
|
||||
@@ -85,9 +88,12 @@ public function getUnreadList(int $limit = 10): array
|
||||
->count();
|
||||
|
||||
$items = $issues->map(function (TodayIssue $issue) {
|
||||
// source_type 기반으로 badge 매핑 (DB 값보다 우선)
|
||||
$badge = TodayIssue::SOURCE_TO_BADGE[$issue->source_type] ?? $issue->badge ?? '기타';
|
||||
|
||||
return [
|
||||
'id' => $issue->id,
|
||||
'badge' => $issue->badge,
|
||||
'badge' => $badge,
|
||||
'notification_type' => $issue->notification_type,
|
||||
'content' => $issue->content,
|
||||
'path' => $issue->path,
|
||||
|
||||
Reference in New Issue
Block a user