Files
ulitka/src/modules/notification/domain/repositories/device-token.repository.interface.ts
T
2026-09-29 18:42:29 +03:00

12 lines
680 B
TypeScript

import type { NotificationDeviceToken } from '../../../../generated/prisma/client.js';
/** DI-токен, т.к. интерфейсы стираются при компиляции TS */
export const DEVICE_TOKEN_REPOSITORY = Symbol('DEVICE_TOKEN_REPOSITORY');
export interface IDeviceTokenRepository {
/** Регистрирует токен устройства, обновляет запись при повторной регистрации того же токена */
upsert(userId: string, token: string, platform: string): Promise<void>;
remove(userId: string, token: string): Promise<void>;
findByUserId(userId: string): Promise<NotificationDeviceToken[]>;
}