analytica-frontend-lib
Version:
Repositório público dos componentes utilizados nas plataformas da Analytica Ensino
1 lines • 4.29 kB
Source Map (JSON)
{"version":3,"sources":["../src/types/notifications.ts"],"sourcesContent":["import type { BaseApiClient } from './api';\n\n/**\n * Types for notification system\n */\n\n/**\n * Notification type enum\n */\nexport type NotificationType =\n | 'ACTIVITY'\n | 'TRAIL'\n | 'GENERAL'\n | 'ANNOUNCEMENT'\n | 'RECOMMENDEDCLASS';\n\n/**\n * Entity type for navigation\n */\nexport enum NotificationEntityType {\n ACTIVITY = 'ACTIVITY',\n TRAIL = 'TRAIL',\n RECOMMENDEDCLASS = 'RECOMMENDEDCLASS',\n}\n\n/**\n * Notification interface\n */\nexport interface Notification {\n /**\n * Unique identifier for the notification\n */\n id: string;\n /**\n * Notification title\n */\n title: string;\n /**\n * Notification message content\n */\n message: string;\n /**\n * Type of notification\n */\n type: NotificationType;\n /**\n * Whether the notification has been read\n */\n isRead: boolean;\n /**\n * When the notification was created\n */\n createdAt: Date;\n /**\n * Type of entity this notification refers to (optional)\n */\n entityType?: NotificationEntityType | null;\n /**\n * ID of the entity this notification refers to (optional)\n */\n entityId?: string | null;\n /**\n * Action link for global notifications (optional)\n */\n actionLink?: string | null;\n /**\n * Image URL for bulk notifications (optional)\n */\n linkImg?: string | null;\n /**\n * Sender information (optional)\n */\n sender?: {\n id: string;\n user: {\n id: string;\n name: string;\n email: string;\n };\n } | null;\n /**\n * Activity information (optional)\n */\n activity?: {\n id: string;\n title: string;\n type: string;\n } | null;\n /**\n * RecommendedClass information (optional)\n */\n recommendedClass?: {\n id: string;\n title: string;\n } | null;\n}\n\n/**\n * Backend notification response from API\n */\nexport interface BackendNotification {\n id: string;\n senderUserInstitutionId: string | null;\n receiverUserInstitutionId: string;\n title: string;\n description: string;\n entityType: string | null;\n entityId: string | null;\n actionLink?: string | null;\n linkImg?: string | null;\n read: boolean;\n createdAt: string;\n updatedAt: string;\n sender?: {\n id: string;\n user: {\n id: string;\n name: string;\n email: string;\n };\n } | null;\n activity?: {\n id: string;\n title: string;\n type: string;\n } | null;\n recommendedClass?: {\n id: string;\n title: string;\n } | null;\n}\n\n/**\n * API response for fetching notifications from backend\n */\nexport interface BackendNotificationsResponse {\n notifications: BackendNotification[];\n pagination: {\n page: number;\n limit: number;\n total: number;\n totalPages: number;\n };\n}\n\n/**\n * API response for fetching notifications (frontend format)\n */\nexport interface NotificationsResponse {\n /**\n * List of notifications\n */\n notifications: Notification[];\n /**\n * Total count of notifications\n */\n totalCount: number;\n /**\n * Count of unread notifications\n */\n unreadCount: number;\n /**\n * Whether there are more notifications to load\n */\n hasMore: boolean;\n}\n\n/**\n * Parameters for fetching notifications\n */\nexport interface FetchNotificationsParams {\n /**\n * Page number for pagination\n */\n page?: number;\n /**\n * Number of items per page\n */\n limit?: number;\n /**\n * Filter by read status\n */\n read?: boolean;\n /**\n * Filter by entity type\n */\n entityType?: string;\n}\n\n/**\n * Notification grouped by time period\n */\nexport interface NotificationGroup {\n /**\n * Group label (e.g., \"Hoje\", \"Última semana\")\n */\n label: string;\n /**\n * Notifications in this group\n */\n notifications: Notification[];\n}\n\n/**\n * API client interface for dependency injection\n * Uses Pick from BaseApiClient to select only the methods needed for notifications\n */\nexport type NotificationApiClient = Pick<\n BaseApiClient,\n 'get' | 'patch' | 'delete'\n>;\n"],"mappings":";AAmBO,IAAK,yBAAL,kBAAKA,4BAAL;AACL,EAAAA,wBAAA,cAAW;AACX,EAAAA,wBAAA,WAAQ;AACR,EAAAA,wBAAA,sBAAmB;AAHT,SAAAA;AAAA,GAAA;","names":["NotificationEntityType"]}