notification: add notification history

This commit is contained in:
behruz-dev
2025-10-30 16:17:25 +05:00
parent 22b1d37a1a
commit af8d212b3e
10 changed files with 146 additions and 5 deletions

View File

@@ -1 +1,2 @@
from .notification import *
from .notification import *
from .notification_history import *

View File

@@ -0,0 +1,17 @@
from django.db import models
from core.apps.shared.models import BaseModel
from core.apps.accounts.models import User
class NotificationHistory(BaseModel):
title = models.CharField(max_length=200)
body = models.TextField()
user = models.ForeignKey(
User, on_delete=models.CASCADE, related_name='notification_histories'
)
is_read = models.BooleanField(default=False)
data = models.JSONField(null=True, blank=True)
def __str__(self):
return f'Notification to {self.user}: {self.title}'