This commit is contained in:
2025-12-11 11:25:22 +01:00
parent 6a427eab57
commit e4c1be628d
86 changed files with 1222 additions and 736 deletions

View File

@@ -0,0 +1,33 @@
/**
* Application Use Case: GetUnreadNotificationsUseCase
*
* Retrieves unread notifications for a recipient.
*/
import type { Notification } from '../../domain/entities/Notification';
import type { INotificationRepository } from '../../domain/repositories/INotificationRepository';
export interface UnreadNotificationsResult {
notifications: Notification[];
totalCount: number;
}
export class GetUnreadNotificationsUseCase {
constructor(
private readonly notificationRepository: INotificationRepository,
) {}
async execute(recipientId: string): Promise<UnreadNotificationsResult> {
const notifications = await this.notificationRepository.findUnreadByRecipientId(recipientId);
return {
notifications,
totalCount: notifications.length,
};
}
}
/**
* Additional notification query/use case types (e.g., listing or counting notifications)
* can be added here in the future as needed.
*/