website refactor
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
* Represents a user's notification preferences for different channels and types.
|
||||
*/
|
||||
|
||||
import type { Entity } from '@core/shared/domain/Entity';
|
||||
import { Entity } from '@core/shared/domain/Entity';
|
||||
import { NotificationDomainError } from '../errors/NotificationDomainError';
|
||||
import type { NotificationChannel, NotificationType } from '../types/NotificationTypes';
|
||||
import { QuietHours } from '../value-objects/QuietHours';
|
||||
@@ -44,8 +44,9 @@ export interface NotificationPreferenceProps {
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
export class NotificationPreference implements Entity<string> {
|
||||
private constructor(private readonly props: NotificationPreferenceProps) {}
|
||||
export class NotificationPreference extends Entity<string> {
|
||||
private constructor(private readonly props: NotificationPreferenceProps) {
|
||||
super(props.id);}
|
||||
|
||||
static create(
|
||||
props: Omit<NotificationPreferenceProps, 'updatedAt'> & { updatedAt?: Date },
|
||||
@@ -78,7 +79,6 @@ export class NotificationPreference implements Entity<string> {
|
||||
});
|
||||
}
|
||||
|
||||
get id(): string { return this.props.id; }
|
||||
get driverId(): string { return this.props.driverId; }
|
||||
get channels(): Record<NotificationChannel, ChannelPreference> { return { ...this.props.channels }; }
|
||||
get typePreferences(): Partial<Record<NotificationType, TypePreference>> | undefined {
|
||||
|
||||
Reference in New Issue
Block a user