first structure & deployment of notification
This commit is contained in:
0
apps/notification/__init__.py
Normal file
0
apps/notification/__init__.py
Normal file
0
apps/notification/api/__init__.py
Normal file
0
apps/notification/api/__init__.py
Normal file
0
apps/notification/api/v1/__init__.py
Normal file
0
apps/notification/api/v1/__init__.py
Normal file
0
apps/notification/api/v2/__init__.py
Normal file
0
apps/notification/api/v2/__init__.py
Normal file
0
apps/notification/api/v2/serializers.py
Normal file
0
apps/notification/api/v2/serializers.py
Normal file
0
apps/notification/api/v2/urls.py
Normal file
0
apps/notification/api/v2/urls.py
Normal file
0
apps/notification/api/v2/views.py
Normal file
0
apps/notification/api/v2/views.py
Normal file
0
apps/notification/apps.py
Normal file
0
apps/notification/apps.py
Normal file
0
apps/notification/fixtures/.gitkeep
Normal file
0
apps/notification/fixtures/.gitkeep
Normal file
0
apps/notification/management/__init__.py
Normal file
0
apps/notification/management/__init__.py
Normal file
0
apps/notification/management/commands/__init__.py
Normal file
0
apps/notification/management/commands/__init__.py
Normal file
1
apps/notification/management/commands/command.py
Normal file
1
apps/notification/management/commands/command.py
Normal file
@@ -0,0 +1 @@
|
||||
# Your custom management commands go here.
|
||||
0
apps/notification/migrations/__init__.py
Normal file
0
apps/notification/migrations/__init__.py
Normal file
0
apps/notification/mobile/api/__init__.py
Normal file
0
apps/notification/mobile/api/__init__.py
Normal file
0
apps/notification/mobile/api/v1/__init__.py
Normal file
0
apps/notification/mobile/api/v1/__init__.py
Normal file
0
apps/notification/mobile/api/v1/api.py
Normal file
0
apps/notification/mobile/api/v1/api.py
Normal file
0
apps/notification/mobile/api/v1/serializers.py
Normal file
0
apps/notification/mobile/api/v1/serializers.py
Normal file
0
apps/notification/mobile/api/v1/urls.py
Normal file
0
apps/notification/mobile/api/v1/urls.py
Normal file
0
apps/notification/mobile/api/v1/views.py
Normal file
0
apps/notification/mobile/api/v1/views.py
Normal file
35
apps/notification/models.py
Normal file
35
apps/notification/models.py
Normal file
@@ -0,0 +1,35 @@
|
||||
from apps.core.models import BaseModel
|
||||
from apps.authentication.models import Organization
|
||||
from django.db import models
|
||||
|
||||
|
||||
class Notification(BaseModel):
|
||||
NOTIFICATION_TYPES = (
|
||||
('quota', 'Quota'),
|
||||
('inventory', 'Inventory'),
|
||||
('transaction', 'Transaction'),
|
||||
('system', 'System'),
|
||||
)
|
||||
|
||||
organization = models.ForeignKey(
|
||||
Organization,
|
||||
on_delete=models.CASCADE,
|
||||
related_name='notifications',
|
||||
null=True
|
||||
)
|
||||
|
||||
title = models.CharField(max_length=255, null=True)
|
||||
message = models.TextField(null=True, blank=True)
|
||||
type = models.CharField(
|
||||
max_length=50,
|
||||
choices=NOTIFICATION_TYPES,
|
||||
default='system'
|
||||
)
|
||||
is_read = models.BooleanField(default=False)
|
||||
delivered = models.BooleanField(default=False)
|
||||
|
||||
def __str__(self):
|
||||
return f'{self.organization.name} - {self.title}'
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
return super(Notification, self).save(*args, **kwargs)
|
||||
0
apps/notification/pos/__init__.py
Normal file
0
apps/notification/pos/__init__.py
Normal file
0
apps/notification/pos/api/__init__.py
Normal file
0
apps/notification/pos/api/__init__.py
Normal file
0
apps/notification/pos/api/v1/__init__.py
Normal file
0
apps/notification/pos/api/v1/__init__.py
Normal file
0
apps/notification/pos/api/v1/api.py
Normal file
0
apps/notification/pos/api/v1/api.py
Normal file
0
apps/notification/pos/api/v1/serializers.py
Normal file
0
apps/notification/pos/api/v1/serializers.py
Normal file
0
apps/notification/pos/api/v1/urls.py
Normal file
0
apps/notification/pos/api/v1/urls.py
Normal file
0
apps/notification/pos/api/v1/views.py
Normal file
0
apps/notification/pos/api/v1/views.py
Normal file
1
apps/notification/services.py
Normal file
1
apps/notification/services.py
Normal file
@@ -0,0 +1 @@
|
||||
# Your services go here
|
||||
0
apps/notification/tests/test_common_services.py
Normal file
0
apps/notification/tests/test_common_services.py
Normal file
1
apps/notification/urls.py
Normal file
1
apps/notification/urls.py
Normal file
@@ -0,0 +1 @@
|
||||
# Your urls go here
|
||||
0
apps/notification/web/api/__init__.py
Normal file
0
apps/notification/web/api/__init__.py
Normal file
0
apps/notification/web/api/v1/__init__.py
Normal file
0
apps/notification/web/api/v1/__init__.py
Normal file
0
apps/notification/web/api/v1/api.py
Normal file
0
apps/notification/web/api/v1/api.py
Normal file
0
apps/notification/web/api/v1/serializers.py
Normal file
0
apps/notification/web/api/v1/serializers.py
Normal file
0
apps/notification/web/api/v1/urls.py
Normal file
0
apps/notification/web/api/v1/urls.py
Normal file
0
apps/notification/web/api/v1/views.py
Normal file
0
apps/notification/web/api/v1/views.py
Normal file
Reference in New Issue
Block a user