알림함 항목 생성 · 알림 이동 · 브리핑 항목 승인·상세 · 푸시 토픽을 가입 팬덤 전체로

This commit is contained in:
Sn-Kinos
2026-10-05 22:48:10 +09:00
parent fbf9a2c3d7
commit cf608a1d99
27 changed files with 714 additions and 69 deletions
@@ -78,6 +78,7 @@ class AppNotification {
required this.at,
this.read = false,
this.source,
this.targetPath,
});
final String id;
@@ -91,6 +92,12 @@ class AppNotification {
final String? source;
String get sourceLabel => source ?? kind.label;
/// 눌렀을 때 열 대상 문서 경로(`quests/{id}` · `campaigns/{id}` 등). 서버가 싣는다.
/// 명세가 *이동 X* 로 정한 종류(이클립스 · 아이템)는 경로가 있어도 쓰지 않는다.
final String? targetPath;
String? get target => kind.navigable ? targetPath : null;
}
/// 날짜 머리글. 명세 — *오늘 및 어제를 제외한 과거는 yyyy.mm.dd 로 표시*.
@@ -223,6 +230,15 @@ class FirestoreNotificationRepository implements NotificationRepository {
'' => null,
final v => v,
},
// 캠페인 정산 알림(`campaign/settle.ts`)은 경로 대신 `campaignId` 를 싣는다.
targetPath: switch ((
doc.data().strOr('targetPath'),
doc.data().strOr('campaignId'),
)) {
(final p, _) when p.isNotEmpty => p,
(_, final c) when c.isNotEmpty => 'campaigns/$c',
_ => null,
},
),
];
}