콘텐츠로 이동

notifications 스키마 (인앱 알림)

사용자 인앱 알림 서브컬렉션. FCM 푸시와는 별개로 앱 내 알림함에 표시되는 기록입니다.

저장 위치

users/{uid}/notifications/{notification_id}
  • notification_id: Firestore 자동 생성 ID
  • FCM 푸시 발송과 동시에 users/{uid}/notifications에도 기록되어, 사용자가 나중에 열어봐도 이력이 남습니다.

문서 필드

필드 타입 설명
title string 알림 제목
body string 알림 본문
type string 알림 유형 (예: site_attendance, site_assign, suspension_work, inquiry_answer 등)
company_id string? 관련 회사 ID
site_id string? 관련 현장 ID
target_id string? 관련 엔티티 ID (request_id, suspension_work_id 등)
target_type string? target_id의 유형
data object? 딥링크/앱 라우팅용 추가 데이터
read bool 읽음 여부 (기본 false)
hidden bool? 사용자가 숨김 처리 (hide_notifications)
created_at timestamp 생성 시각 (SERVER_TIMESTAMP)
read_at timestamp? 읽음 처리 시각 (read_notifications)

con24/common/fcm_trigger.pysend_notification 유틸이 FCM 전송과 동시에 이 문서를 생성합니다.

관련 엔드포인트

예시 문서

{
  "title": "출근 요청이 승인되었습니다",
  "body": "A현장 출근이 승인되었습니다.",
  "type": "site_attendance",
  "company_id": "company_abc",
  "site_id": "site_001",
  "target_id": "request_xyz",
  "target_type": "site_attendance_request",
  "read": false,
  "created_at": "2026-04-20T08:05:00Z"
}