import { type NotificationEntity, type NotificationStatus } from '../entities/notification.entity';
import { type NotificationChannel } from '../value-objects/notification-channel.vo';

export const NOTIFICATION_REPOSITORY = Symbol('NOTIFICATION_REPOSITORY');

export interface CreateNotificationDto {
  userId: string;
  channel: NotificationChannel;
  templateKey: string;
  subject: string | null;
  body: string;
  metadata?: Record<string, unknown>;
}

export interface INotificationRepository {
  create(dto: CreateNotificationDto): Promise<NotificationEntity>;
  updateStatus(id: string, status: NotificationStatus, errorDetail?: string): Promise<void>;
  findByUserId(userId: string, limit?: number): Promise<NotificationEntity[]>;
  findUnreadByUserId(userId: string, limit?: number): Promise<NotificationEntity[]>;
  countUnreadByUserId(userId: string): Promise<number>;
  markAsRead(id: string, userId: string): Promise<void>;
  markAllAsRead(userId: string): Promise<number>;
}
