43
src/infrastructure/api/notifications/schemas.py
Normal file
43
src/infrastructure/api/notifications/schemas.py
Normal file
@@ -0,0 +1,43 @@
|
||||
from pydantic import BaseModel
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class NotificationCreateRequest(BaseModel):
|
||||
"""Solicitud para crear una notificación"""
|
||||
id_usuario: int
|
||||
id_reporte: str
|
||||
message: str
|
||||
|
||||
|
||||
class NotificationResponse(BaseModel):
|
||||
"""Respuesta con datos de notificación"""
|
||||
id_notificacion: str
|
||||
id_usuario: int
|
||||
id_reporte: str
|
||||
message: str
|
||||
fecha: datetime
|
||||
read: bool
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class NotificationListResponse(BaseModel):
|
||||
"""Respuesta con lista de notificaciones"""
|
||||
total: int
|
||||
unread_count: int
|
||||
notifications: list[NotificationResponse]
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class NotificationMarkAsReadRequest(BaseModel):
|
||||
"""Solicitud para marcar como leída"""
|
||||
pass
|
||||
|
||||
|
||||
class UnreadCountResponse(BaseModel):
|
||||
"""Respuesta con conteo de no leídas"""
|
||||
unread_count: int
|
||||
Reference in New Issue
Block a user