rename to core

This commit is contained in:
2025-12-15 13:46:07 +01:00
parent aedf58643d
commit 5c22f8820c
559 changed files with 415 additions and 767 deletions

View File

@@ -0,0 +1,29 @@
/**
* Repository Interface: INotificationPreferenceRepository
*
* Defines the contract for persisting and retrieving NotificationPreference entities.
*/
import type { NotificationPreference } from '../entities/NotificationPreference';
export interface INotificationPreferenceRepository {
/**
* Find preferences for a driver
*/
findByDriverId(driverId: string): Promise<NotificationPreference | null>;
/**
* Save preferences (create or update)
*/
save(preference: NotificationPreference): Promise<void>;
/**
* Delete preferences for a driver
*/
delete(driverId: string): Promise<void>;
/**
* Get or create default preferences for a driver
*/
getOrCreateDefault(driverId: string): Promise<NotificationPreference>;
}

View File

@@ -0,0 +1,60 @@
/**
* Repository Interface: INotificationRepository
*
* Defines the contract for persisting and retrieving Notification entities.
*/
import type { Notification } from '../entities/Notification';
import type { NotificationType } from '../types/NotificationTypes';
export interface INotificationRepository {
/**
* Find a notification by ID
*/
findById(id: string): Promise<Notification | null>;
/**
* Find all notifications for a recipient
*/
findByRecipientId(recipientId: string): Promise<Notification[]>;
/**
* Find unread notifications for a recipient
*/
findUnreadByRecipientId(recipientId: string): Promise<Notification[]>;
/**
* Find notifications by type for a recipient
*/
findByRecipientIdAndType(recipientId: string, type: NotificationType): Promise<Notification[]>;
/**
* Count unread notifications for a recipient
*/
countUnreadByRecipientId(recipientId: string): Promise<number>;
/**
* Save a new notification
*/
create(notification: Notification): Promise<void>;
/**
* Update an existing notification
*/
update(notification: Notification): Promise<void>;
/**
* Delete a notification
*/
delete(id: string): Promise<void>;
/**
* Delete all notifications for a recipient
*/
deleteAllByRecipientId(recipientId: string): Promise<void>;
/**
* Mark all notifications as read for a recipient
*/
markAllAsReadByRecipientId(recipientId: string): Promise<void>;
}