29 lines
763 B
TypeScript
29 lines
763 B
TypeScript
/**
|
|
* 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>;
|
|
} |