- company.notifications 테이블 + NotificationType(SUCCESS/REGENERATED/FAILURE) - 백엔드 알림 조회/읽음 API + close_and_decide 결과 분기마다 알림 생성 - 헤더 알림 벨(안읽음 배지) + 알림 페이지(읽음·딥링크) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
34 lines
915 B
Python
34 lines
915 B
Python
import uuid
|
|
from datetime import datetime
|
|
from typing import Any, Optional
|
|
|
|
from pydantic import ConfigDict
|
|
|
|
from common.enums import NotificationType
|
|
from common.models.gmodel import Res_PageProtocol, Res_WebPacketProtocol, WebPacketProtocol
|
|
|
|
|
|
class NotificationProtocol(WebPacketProtocol):
|
|
pass
|
|
|
|
|
|
class NotificationData(WebPacketProtocol):
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
notification_id: uuid.UUID
|
|
type: NotificationType
|
|
ref_qt_id: Optional[uuid.UUID] = None
|
|
ref_session_id: Optional[uuid.UUID] = None
|
|
data: Optional[Any] = None # 렌더 스냅샷(유형별 필드)
|
|
read_at: Optional[datetime] = None
|
|
created_at: Optional[datetime] = None
|
|
|
|
|
|
class Res_NotificationList(Res_PageProtocol):
|
|
notifications: list[NotificationData] = []
|
|
unread: int = 0 # 안읽음 총수(헤더 빨콩이)
|
|
|
|
|
|
class Res_NotificationRead(Res_WebPacketProtocol):
|
|
pass
|