website refactor
This commit is contained in:
@@ -5,11 +5,11 @@
|
||||
* Currently a stub - to be implemented when Discord integration is needed.
|
||||
*/
|
||||
|
||||
import type { Notification } from '@core/notifications/domain/entities/Notification';
|
||||
import type {
|
||||
NotificationGateway,
|
||||
NotificationDeliveryResult
|
||||
NotificationDeliveryResult,
|
||||
NotificationGateway
|
||||
} from '@core/notifications/application/ports/NotificationGateway';
|
||||
import type { Notification } from '@core/notifications/domain/entities/Notification';
|
||||
import type { NotificationChannel } from '@core/notifications/domain/types/NotificationTypes';
|
||||
|
||||
export interface DiscordAdapterConfig {
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
* Currently a stub - to be implemented when email integration is needed.
|
||||
*/
|
||||
|
||||
import type { Notification } from '@core/notifications/domain/entities/Notification';
|
||||
import type {
|
||||
NotificationGateway,
|
||||
NotificationDeliveryResult
|
||||
import type {
|
||||
NotificationDeliveryResult,
|
||||
NotificationGateway
|
||||
} from '@core/notifications/application/ports/NotificationGateway';
|
||||
import type { Notification } from '@core/notifications/domain/entities/Notification';
|
||||
import type { NotificationChannel } from '@core/notifications/domain/types/NotificationTypes';
|
||||
|
||||
export interface EmailAdapterConfig {
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
* Currently a stub - to be implemented when in-app notification system is needed.
|
||||
*/
|
||||
|
||||
import type { Notification } from '@core/notifications/domain/entities/Notification';
|
||||
import type {
|
||||
NotificationGateway,
|
||||
NotificationDeliveryResult
|
||||
import type {
|
||||
NotificationDeliveryResult,
|
||||
NotificationGateway
|
||||
} from '@core/notifications/application/ports/NotificationGateway';
|
||||
import type { Notification } from '@core/notifications/domain/entities/Notification';
|
||||
import type { NotificationChannel } from '@core/notifications/domain/types/NotificationTypes';
|
||||
|
||||
export class InAppNotificationAdapter implements NotificationGateway {
|
||||
|
||||
@@ -4,13 +4,12 @@
|
||||
* Manages notification gateways and routes notifications to appropriate channels.
|
||||
*/
|
||||
|
||||
import type {
|
||||
NotificationDeliveryResult,
|
||||
NotificationGateway
|
||||
} from '@core/notifications/application/ports/NotificationGateway';
|
||||
import type { Notification } from '@core/notifications/domain/entities/Notification';
|
||||
import type { NotificationChannel } from '@core/notifications/domain/types/NotificationTypes';
|
||||
import type {
|
||||
NotificationGateway,
|
||||
NotificationGatewayRegistry as INotificationGatewayRegistry,
|
||||
NotificationDeliveryResult
|
||||
} from '@core/notifications/application/ports/NotificationGateway';
|
||||
|
||||
export class NotificationGatewayRegistry implements NotificationGatewayRegistry {
|
||||
private gateways: Map<NotificationChannel, NotificationGateway> = new Map();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { NotificationPreferenceRepository } from '@core/notifications/domain/repositories/NotificationPreferenceRepository';
|
||||
import { NotificationPreference } from '@core/notifications/domain/entities/NotificationPreference';
|
||||
import { NotificationPreferenceRepository } from '@core/notifications/domain/repositories/NotificationPreferenceRepository';
|
||||
import { Logger } from '@core/shared/domain';
|
||||
|
||||
export class InMemoryNotificationPreferenceRepository implements NotificationPreferenceRepository {
|
||||
|
||||
@@ -2,17 +2,17 @@ import { Notification } from '@core/notifications/domain/entities/Notification';
|
||||
import { NotificationOrmEntity } from '../entities/NotificationOrmEntity';
|
||||
import { TypeOrmPersistenceSchemaError } from '../errors/TypeOrmPersistenceSchemaError';
|
||||
import {
|
||||
assertNonEmptyString,
|
||||
assertDate,
|
||||
assertOptionalDate,
|
||||
assertBoolean,
|
||||
assertNotificationType,
|
||||
assertNotificationChannel,
|
||||
assertNotificationStatus,
|
||||
assertNotificationUrgency,
|
||||
assertOptionalStringOrNull,
|
||||
assertOptionalObject,
|
||||
assertNotificationActions,
|
||||
assertBoolean,
|
||||
assertDate,
|
||||
assertNonEmptyString,
|
||||
assertNotificationActions,
|
||||
assertNotificationChannel,
|
||||
assertNotificationStatus,
|
||||
assertNotificationType,
|
||||
assertNotificationUrgency,
|
||||
assertOptionalDate,
|
||||
assertOptionalObject,
|
||||
assertOptionalStringOrNull,
|
||||
} from '../schema/NotificationSchemaGuards';
|
||||
|
||||
export class NotificationOrmMapper {
|
||||
|
||||
@@ -2,12 +2,12 @@ import { NotificationPreference } from '@core/notifications/domain/entities/Noti
|
||||
import { NotificationPreferenceOrmEntity } from '../entities/NotificationPreferenceOrmEntity';
|
||||
import { TypeOrmPersistenceSchemaError } from '../errors/TypeOrmPersistenceSchemaError';
|
||||
import {
|
||||
assertNonEmptyString,
|
||||
assertDate,
|
||||
assertBoolean,
|
||||
assertOptionalInteger,
|
||||
assertChannelPreferences,
|
||||
assertOptionalObject,
|
||||
assertBoolean,
|
||||
assertChannelPreferences,
|
||||
assertDate,
|
||||
assertNonEmptyString,
|
||||
assertOptionalInteger,
|
||||
assertOptionalObject,
|
||||
} from '../schema/NotificationSchemaGuards';
|
||||
|
||||
export class NotificationPreferenceOrmMapper {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { DataSource } from 'typeorm';
|
||||
import type { NotificationPreferenceRepository } from '@core/notifications/domain/repositories/NotificationPreferenceRepository';
|
||||
import { NotificationPreference } from '@core/notifications/domain/entities/NotificationPreference';
|
||||
import type { NotificationPreferenceRepository } from '@core/notifications/domain/repositories/NotificationPreferenceRepository';
|
||||
import type { DataSource } from 'typeorm';
|
||||
import { NotificationPreferenceOrmEntity } from '../entities/NotificationPreferenceOrmEntity';
|
||||
import { NotificationPreferenceOrmMapper } from '../mappers/NotificationPreferenceOrmMapper';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { DataSource } from 'typeorm';
|
||||
import { Notification } from '@core/notifications/domain/entities/Notification';
|
||||
import type { NotificationRepository } from '@core/notifications/domain/repositories/NotificationRepository';
|
||||
import type { NotificationType } from '@core/notifications/domain/types/NotificationTypes';
|
||||
import { Notification } from '@core/notifications/domain/entities/Notification';
|
||||
import type { DataSource } from 'typeorm';
|
||||
import { NotificationOrmEntity } from '../entities/NotificationOrmEntity';
|
||||
import { NotificationOrmMapper } from '../mappers/NotificationOrmMapper';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { MagicLinkNotificationPort, MagicLinkNotificationInput } from '@core/identity/domain/ports/MagicLinkNotificationPort';
|
||||
import { MagicLinkNotificationInput, MagicLinkNotificationPort } from '@core/identity/domain/ports/MagicLinkNotificationPort';
|
||||
import { Logger } from '@core/shared/domain';
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { NotificationDeliveryResult, NotificationGateway, NotificationGatewayRegistry } from '@core/notifications/application/ports/NotificationGateway';
|
||||
import type { Notification } from '@core/notifications/domain/entities/Notification';
|
||||
import type { NotificationChannel } from '@core/notifications/domain/types/NotificationTypes';
|
||||
import type { NotificationGateway, NotificationGatewayRegistry, NotificationDeliveryResult } from '@core/notifications/application/ports/NotificationGateway';
|
||||
|
||||
export class InMemoryNotificationGatewayRegistry implements NotificationGatewayRegistry {
|
||||
private gateways: Map<NotificationChannel, NotificationGateway> = new Map();
|
||||
|
||||
Reference in New Issue
Block a user