/
PostmenBlake
/
NotificationPreferencesService
Обзор
Документация
Войти
/
PostmenBlake
/
NotificationPreferencesService
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/domain/types/notification.ts
59 строк
1 KB
kurava
feat: initial commit - Notification Preferences Service
17 июн 2026, 09:11
17 июн 2026, 09:11
48825c3
Код
Авторство
О чём код?
export type NotificationType = | 'transactional_email' | 'transactional_push' | 'transactional_sms' | 'marketing_email' | 'marketing_push' | 'marketing_sms'; export type Channel = 'email' | 'push' | 'sms'; export type Region = 'US' | 'EU' | 'ASIA' | 'GLOBAL'; export type Decision = 'allow' | 'deny'; export interface QuietHours { start: string; // HH:mm end: string; // HH:mm timezone: string; // e.g., 'Europe/Moscow' } export interface UserPreference { userId: string; notificationType: NotificationType; channel: Channel; enabled: boolean; quietHours?: QuietHours | null; updatedAt: Date; } export interface GlobalPolicy { id: string; notificationType: NotificationType; channel: Channel; region: Region; allowed: boolean; reason: string; createdAt: Date; } export interface EvaluationRequest { userId: string; notificationType: NotificationType; channel: Channel; region: Region; datetime: string; // ISO 8601 } export interface EvaluationResult { decision: Decision; reason: string; } export interface UpdatePreferencesRequest { userId: string; notificationType?: NotificationType; channel?: Channel; enabled?: boolean; quietHours?: QuietHours | null; }