refactor(notifications): align app structure with backend conventions
This commit is contained in:
1
apps/notifications/api/__init__.py
Normal file
1
apps/notifications/api/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from django.urls import include, path
|
||||
from rest_framework.routers import DefaultRouter
|
||||
|
||||
from apps.notifications import views
|
||||
from apps.notifications.api import views
|
||||
|
||||
router = DefaultRouter()
|
||||
router.register("box", views.NotificationListViewSet, basename="box")
|
||||
@@ -13,7 +13,7 @@ from rest_framework.permissions import IsAuthenticated
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.views import APIView
|
||||
|
||||
from apps.notifications.serializers import (
|
||||
from apps.notifications.api.serializers import (
|
||||
NotificationDeleteResponseSerializer,
|
||||
NotificationListResponseSerializer,
|
||||
NotificationMarkAllReadResponseSerializer,
|
||||
23
apps/notifications/services/__init__.py
Normal file
23
apps/notifications/services/__init__.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from apps.notifications.services.membership_events import (
|
||||
notify_project_membership_added,
|
||||
notify_project_membership_deactivated,
|
||||
notify_project_membership_removed,
|
||||
notify_project_membership_role_changed,
|
||||
notify_workspace_membership_added,
|
||||
notify_workspace_membership_deactivated,
|
||||
notify_workspace_membership_removed,
|
||||
notify_workspace_membership_role_changed,
|
||||
)
|
||||
from apps.notifications.services.store import RedisNotificationStore
|
||||
|
||||
__all__ = [
|
||||
"RedisNotificationStore",
|
||||
"notify_workspace_membership_added",
|
||||
"notify_workspace_membership_role_changed",
|
||||
"notify_workspace_membership_deactivated",
|
||||
"notify_workspace_membership_removed",
|
||||
"notify_project_membership_added",
|
||||
"notify_project_membership_role_changed",
|
||||
"notify_project_membership_deactivated",
|
||||
"notify_project_membership_removed",
|
||||
]
|
||||
@@ -1,4 +1,4 @@
|
||||
from apps.notifications.services import RedisNotificationStore
|
||||
from apps.notifications.services.store import RedisNotificationStore
|
||||
|
||||
|
||||
def _actor_name(actor) -> str:
|
||||
@@ -1,7 +1,7 @@
|
||||
import pytest
|
||||
from rest_framework.test import APIClient
|
||||
|
||||
from apps.notifications import services
|
||||
from apps.notifications.services import store as services
|
||||
from apps.notifications.services import RedisNotificationStore
|
||||
from apps.notifications.tests.test_services import FakeRedis
|
||||
from apps.projects.models import Project, ProjectMembership
|
||||
|
||||
@@ -3,7 +3,7 @@ from collections import defaultdict
|
||||
|
||||
import pytest
|
||||
|
||||
from apps.notifications import services
|
||||
from apps.notifications.services import store as services
|
||||
from apps.notifications.services import RedisNotificationStore
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,8 @@ import pytest
|
||||
from django.utils import timezone
|
||||
from rest_framework.test import APIClient
|
||||
|
||||
from apps.notifications import services, views
|
||||
from apps.notifications.api import views
|
||||
from apps.notifications.services import store as services
|
||||
from apps.notifications.services import RedisNotificationStore
|
||||
from apps.notifications.tests.test_services import FakePubSub, FakeRedis
|
||||
from apps.users.models import User
|
||||
|
||||
Reference in New Issue
Block a user