notification: add firebase notification to web

This commit is contained in:
behruz-dev
2025-10-30 14:59:59 +05:00
parent b6b2875e0d
commit 9b4f343f77
10 changed files with 198 additions and 79 deletions

View File

@@ -3,7 +3,15 @@ from django.db import models
from core.apps.shared.models import BaseModel
from core.apps.accounts.models import User
class Notification(BaseModel):
type = models.CharField(
choices=[('web', 'web'), ('mobile', 'mobile')],
max_length=6,
default='mobile'
)
user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='notifications')
token = models.CharField(max_length=255, unique=True)
class Meta:
unique_together = ('type', 'user', 'token')