/** * Notifications Validator * * Validates and sanitizes Notifications DTOs using Zod schemas from @plyaz/types. * Supports list/delete operations for frontend, full CRUD for backend. * * Operations: * - delete (DELETE) - validateDelete, validateDeleteOrThrow * - query (GET) - validateQuery, validateQueryOrThrow * - create (POST) - validateCreate, validateCreateOrThrow (backend) */ import { BaseValidator } from '../../base'; import type { DeleteNotificationsDTO, QueryNotificationsDTO, CreateNotificationsDTO } from '@plyaz/types/core'; import type { NotificationCategory, NotificationChannel } from '@plyaz/types/notifications'; import type { NotificationPreferencesDatabaseRow } from '../../../models/notifications'; /** * Notifications Validator implementation * Supports list/delete for frontend, full CRUD for backend * * All schemas imported from @plyaz/types/core - single source of truth * * Available methods: * - validateDelete(data) → ValidationResult * - validateDeleteOrThrow(data) → DeleteNotificationsDTO * - validateQuery(data) → ValidationResult * - validateQueryOrThrow(data) → QueryNotificationsDTO * - validateCreate(data) → ValidationResult * - validateCreateOrThrow(data) → CreateNotificationsDTO */ declare class NotificationsValidatorClass extends BaseValidator, // Patch DeleteNotificationsDTO, QueryNotificationsDTO> { constructor(); /** * Validate notification ID for delete */ validateNotificationId(id: string): boolean; /** * Validate query filters */ validateFilters(filters: Partial): boolean; /** * Check if category is valid for unsubscribe. */ isValidUnsubscribeCategory(category: string): category is NotificationCategory; /** * Validate unsubscribe category - throws if invalid. */ validateUnsubscribeCategoryOrThrow(category: string, isFullUnsubscribe: boolean): void; /** * Check if preferences allow sending a notification. * Validates channel, category, and quiet hours. */ checkPreferencesAllowSend(prefs: NotificationPreferencesDatabaseRow, category: NotificationCategory, channel: NotificationChannel): boolean; } export { NotificationsValidatorClass }; export declare const NotificationsValidator: NotificationsValidatorClass; //# sourceMappingURL=NotificationsValidator.d.ts.map