website refactor
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
import { describe, expect, it, vi, type Mock } from 'vitest';
|
||||
import { beforeEach, describe, expect, it, vi, type Mock } from 'vitest';
|
||||
import { Notification } from '../../domain/entities/Notification';
|
||||
import { NotificationRepository } from '../../domain/repositories/NotificationRepository';
|
||||
import {
|
||||
GetUnreadNotificationsUseCase,
|
||||
type GetUnreadNotificationsInput,
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
* Retrieves unread notifications for a recipient.
|
||||
*/
|
||||
|
||||
import { NotificationRepository } from '../../domain/repositories/NotificationRepository';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
import type { Notification } from '../../domain/entities/Notification';
|
||||
import { NotificationRepository } from '../../domain/repositories/NotificationRepository';
|
||||
|
||||
export interface GetUnreadNotificationsInput {
|
||||
recipientId: string;
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
import { describe, expect, it, vi, type Mock } from 'vitest';
|
||||
import { beforeEach, describe, expect, it, vi, type Mock } from 'vitest';
|
||||
import { Notification } from '../../domain/entities/Notification';
|
||||
import { NotificationRepository } from '../../domain/repositories/NotificationRepository';
|
||||
import {
|
||||
DismissNotificationUseCase,
|
||||
MarkAllNotificationsReadUseCase,
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
* Marks a notification as read.
|
||||
*/
|
||||
|
||||
import { NotificationRepository } from '../../domain/repositories/NotificationRepository';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
import { NotificationRepository } from '../../domain/repositories/NotificationRepository';
|
||||
|
||||
export interface MarkNotificationReadCommand {
|
||||
notificationId: string;
|
||||
|
||||
@@ -3,6 +3,7 @@ import { Result } from '@core/shared/domain/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
import { beforeEach, describe, expect, it, vi, type Mock } from 'vitest';
|
||||
import type { ChannelPreference, NotificationPreference, TypePreference } from '../../domain/entities/NotificationPreference';
|
||||
import { NotificationPreferenceRepository } from '../../domain/repositories/NotificationPreferenceRepository';
|
||||
import type { NotificationChannel, NotificationType } from '../../domain/types/NotificationTypes';
|
||||
import {
|
||||
GetNotificationPreferencesQuery,
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
* Manages user notification preferences.
|
||||
*/
|
||||
|
||||
import { NotificationPreferenceRepository } from '../../domain/repositories/NotificationPreferenceRepository';
|
||||
import { NotificationChannel, NotificationType } from '../../domain/types/NotificationTypes';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
import type { ChannelPreference, TypePreference } from '../../domain/entities/NotificationPreference';
|
||||
import { NotificationPreference } from '../../domain/entities/NotificationPreference';
|
||||
import { NotificationPreferenceRepository } from '../../domain/repositories/NotificationPreferenceRepository';
|
||||
import { NotificationChannel, NotificationType } from '../../domain/types/NotificationTypes';
|
||||
|
||||
/**
|
||||
* Query: GetNotificationPreferencesQuery
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
import { describe, expect, it, vi, type Mock } from 'vitest';
|
||||
import { beforeEach, describe, expect, it, vi, type Mock } from 'vitest';
|
||||
|
||||
import {
|
||||
SendNotificationUseCase,
|
||||
@@ -10,6 +10,8 @@ import {
|
||||
type SendNotificationResult,
|
||||
} from './SendNotificationUseCase';
|
||||
|
||||
import { NotificationPreferenceRepository } from '../../domain/repositories/NotificationPreferenceRepository';
|
||||
import { NotificationRepository } from '../../domain/repositories/NotificationRepository';
|
||||
import type { NotificationChannel, NotificationType } from '../../domain/types/NotificationTypes';
|
||||
import type { NotificationGatewayRegistry } from '../ports/NotificationGateway';
|
||||
|
||||
|
||||
@@ -5,16 +5,16 @@
|
||||
* based on their preferences.
|
||||
*/
|
||||
|
||||
import { NotificationChannel, NotificationType } from '../../domain/types/NotificationTypes';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import type { NotificationData } from '../../domain/entities/Notification';
|
||||
import { Notification } from '../../domain/entities/Notification';
|
||||
import type { NotificationDeliveryResult, NotificationGatewayRegistry } from '../ports/NotificationGateway';
|
||||
import { NotificationRepository } from '../../domain/repositories/NotificationRepository';
|
||||
import { NotificationPreferenceRepository } from '../../domain/repositories/NotificationPreferenceRepository';
|
||||
import { NotificationRepository } from '../../domain/repositories/NotificationRepository';
|
||||
import { NotificationChannel, NotificationType } from '../../domain/types/NotificationTypes';
|
||||
import type { NotificationDeliveryResult, NotificationGatewayRegistry } from '../ports/NotificationGateway';
|
||||
|
||||
export interface SendNotificationCommand {
|
||||
recipientId: string;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import * as mod from '@core/notifications/domain/entities/Notification';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
describe('notifications/domain/entities/Notification.ts', () => {
|
||||
it('imports', () => {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import * as mod from '@core/notifications/domain/entities/NotificationPreference';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
describe('notifications/domain/entities/NotificationPreference.ts', () => {
|
||||
it('imports', () => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { DomainError, CommonDomainErrorKind } from '@core/shared/errors/DomainError';
|
||||
import type { CommonDomainErrorKind, DomainError } from '@core/shared/errors/DomainError';
|
||||
|
||||
/**
|
||||
* Domain Error: NotificationDomainError
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { NotificationId } from './NotificationId';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { NotificationDomainError } from '../errors/NotificationDomainError';
|
||||
import { NotificationId } from './NotificationId';
|
||||
|
||||
describe('NotificationId', () => {
|
||||
it('creates a valid NotificationId from a non-empty string', () => {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { QuietHours } from './QuietHours';
|
||||
|
||||
describe('QuietHours', () => {
|
||||
|
||||
Reference in New Issue
Block a user