diff --git a/server/test/helpers/InMemoryIncidentsRepository.ts b/server/test/helpers/InMemoryIncidentsRepository.ts index f76236f89..74b79e0e3 100644 --- a/server/test/helpers/InMemoryIncidentsRepository.ts +++ b/server/test/helpers/InMemoryIncidentsRepository.ts @@ -1,5 +1,5 @@ -import type { IIncidentsRepository } from "../../src/repositories/incidents/IIncidentsRepository.ts"; -import type { Incident, IncidentSummary } from "../../src/types/index.ts"; +import type { IIncidentsRepository } from "../../src/domain/incidents/incident.repository.interface.ts"; +import type { Incident, IncidentSummary } from "../../src/domain/incidents/incident.type.ts"; import { randomUUID } from "crypto"; export class InMemoryIncidentsRepository implements IIncidentsRepository { diff --git a/server/test/helpers/InMemoryMonitorsRepository.ts b/server/test/helpers/InMemoryMonitorsRepository.ts index 756a7bfb7..c53f270a7 100644 --- a/server/test/helpers/InMemoryMonitorsRepository.ts +++ b/server/test/helpers/InMemoryMonitorsRepository.ts @@ -1,5 +1,6 @@ -import type { IMonitorsRepository, TeamQueryConfig, SummaryConfig } from "../../src/repositories/monitors/IMonitorsRepository.ts"; -import type { Monitor, MonitorsSummary, CheckSnapshot } from "../../src/types/index.ts"; +import type { IMonitorsRepository, TeamQueryConfig, SummaryConfig } from "../../src/domain/monitors/monitor.repository.interface.ts"; +import type { CheckSnapshot } from "../../src/domain/checks/check.type.ts"; +import type { Monitor, MonitorsSummary } from "../../src/domain/monitors/monitor.types.ts"; export class InMemoryMonitorsRepository implements IMonitorsRepository { private monitors: Monitor[] = []; diff --git a/server/test/helpers/heartbeatTestHarness.ts b/server/test/helpers/heartbeatTestHarness.ts index 9b0592afc..46a6fc630 100644 --- a/server/test/helpers/heartbeatTestHarness.ts +++ b/server/test/helpers/heartbeatTestHarness.ts @@ -1,14 +1,14 @@ import { jest } from "@jest/globals"; -import { QueueHelper } from "../../src/service/infrastructure/JobQueues/QueueHelper.ts"; -import { StatusService } from "../../src/service/infrastructure/statusService.ts"; -import { IncidentService } from "../../src/service/business/incidentService.ts"; +import { QueueHelper } from "../../src/service/job-queues/job-queue.helper.ts"; +import { StatusService } from "../../src/service/statusService.ts"; +import { IncidentService } from "../../src/domain/incidents/incident.service.ts"; import { InMemoryMonitorsRepository } from "./InMemoryMonitorsRepository.ts"; import { InMemoryIncidentsRepository } from "./InMemoryIncidentsRepository.ts"; import { createMockLogger } from "./createMockLogger.ts"; -import type { Monitor } from "../../src/types/monitor.ts"; +import type { Monitor } from "../../src/domain/monitors/monitor.types.ts"; import type { MonitorStatusResponse } from "../../src/types/network.ts"; -import type { Check } from "../../src/types/check.ts"; -import type { MaintenanceWindow } from "../../src/types/maintenanceWindow.ts"; +import type { Check } from "../../src/domain/checks/check.type.ts"; +import type { MaintenanceWindow } from "../../src/domain/maintenance-windows/maintenance-window.type.ts"; let checkCounter = 0; diff --git a/server/test/helpers/makeStatusPage.ts b/server/test/helpers/makeStatusPage.ts index 23c13bca1..56fd26596 100644 --- a/server/test/helpers/makeStatusPage.ts +++ b/server/test/helpers/makeStatusPage.ts @@ -1,4 +1,4 @@ -import type { StatusPage } from "../../src/types/index.ts"; +import type { StatusPage } from "../../src/domain/status-pages/status-page.type.ts"; export const makeStatusPage = (overrides?: Partial): StatusPage => ({ diff --git a/server/test/helpers/notificationMessage.ts b/server/test/helpers/notificationMessage.ts index c25644c81..f73ce67e7 100644 --- a/server/test/helpers/notificationMessage.ts +++ b/server/test/helpers/notificationMessage.ts @@ -1,5 +1,5 @@ -import type { Notification } from "../../src/types/index.ts"; -import type { NotificationMessage } from "../../src/types/notificationMessage.ts"; +import type { Notification } from "../../src/domain/notifications/notification.type.ts"; +import type { NotificationMessage } from "../../src/domain/notifications/notification.type.ts"; export const makeNotification = (overrides?: Partial): Notification => ({ diff --git a/server/test/helpers/notificationProviderContract.ts b/server/test/helpers/notificationProviderContract.ts index f95048f24..3f3c5b80b 100644 --- a/server/test/helpers/notificationProviderContract.ts +++ b/server/test/helpers/notificationProviderContract.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "@jest/globals"; -import type { INotificationProvider } from "../../src/service/infrastructure/notificationProviders/INotificationProvider.ts"; -import type { Notification } from "../../src/types/index.ts"; -import type { NotificationMessage } from "../../src/types/notificationMessage.ts"; +import type { INotificationProvider } from "../../src/domain/notifications/providers/INotificationProvider.ts"; +import type { Notification } from "../../src/domain/notifications/notification.type.ts"; +import type { NotificationMessage } from "../../src/domain/notifications/notification.type.ts"; const makeMessage = (): NotificationMessage => ({ type: "monitor_down", diff --git a/server/test/helpers/statusProviderContract.ts b/server/test/helpers/statusProviderContract.ts index 6f7c89466..af625f64d 100644 --- a/server/test/helpers/statusProviderContract.ts +++ b/server/test/helpers/statusProviderContract.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "@jest/globals"; -import type { IStatusProvider } from "../../src/service/infrastructure/network/IStatusProvider.ts"; -import type { Monitor } from "../../src/types/index.ts"; +import type { IStatusProvider } from "../../src/service/network/IStatusProvider.ts"; +import type { Monitor } from "../../src/domain/monitors/monitor.types.ts"; /** * Shared contract tests for all IStatusProvider implementations. diff --git a/server/test/integration/heartbeatJobMaintenance.test.ts b/server/test/integration/heartbeatJobMaintenance.test.ts index 5df287242..3e51814db 100644 --- a/server/test/integration/heartbeatJobMaintenance.test.ts +++ b/server/test/integration/heartbeatJobMaintenance.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, beforeEach } from "@jest/globals"; import { createHeartbeatTestHarness, makeMonitor, type HeartbeatTestHarness } from "../helpers/heartbeatTestHarness.ts"; -import type { MaintenanceWindow } from "../../src/types/maintenanceWindow.ts"; +import type { MaintenanceWindow } from "../../src/domain/maintenance-windows/maintenance-window.type.ts"; const makeMaintenanceWindow = (overrides?: Partial): MaintenanceWindow => { const now = new Date(); diff --git a/server/test/integration/incidentLifecycle.test.ts b/server/test/integration/incidentLifecycle.test.ts index 0fe1ddcf8..3f301113a 100644 --- a/server/test/integration/incidentLifecycle.test.ts +++ b/server/test/integration/incidentLifecycle.test.ts @@ -1,11 +1,12 @@ import { describe, expect, it, jest, beforeEach } from "@jest/globals"; -import { IncidentService } from "../../src/service/business/incidentService.ts"; +import { IncidentService } from "../../src/domain/incidents/incident.service.ts"; import { InMemoryIncidentsRepository } from "../helpers/InMemoryIncidentsRepository.ts"; import { createMockLogger } from "../helpers/createMockLogger.ts"; -import type { IMonitorsRepository, IUsersRepository } from "../../src/repositories/index.ts"; -import type { INotificationMessageBuilder } from "../../src/service/infrastructure/notificationMessageBuilder.ts"; -import type { Monitor } from "../../src/types/monitor.ts"; -import type { MonitorActionDecision } from "../../src/service/infrastructure/JobQueues/QueueHelper.ts"; +import type { IMonitorsRepository } from "../../src/domain/monitors/monitor.repository.interface.ts"; +import type { IUsersRepository } from "../../src/domain/users/user.repository.interface.ts"; +import type { INotificationMessageBuilder } from "../../src/domain/notifications/notification.message-builder.ts"; +import type { Monitor } from "../../src/domain/monitors/monitor.types.ts"; +import type { MonitorActionDecision } from "../../src/service/job-queues/job-queue.helper.ts"; // ── Helpers ────────────────────────────────────────────────────────────────── diff --git a/server/test/unit/controllers/statusPageThemeFlag.test.ts b/server/test/unit/controllers/statusPageThemeFlag.test.ts index b4f9435a9..b1d51361a 100644 --- a/server/test/unit/controllers/statusPageThemeFlag.test.ts +++ b/server/test/unit/controllers/statusPageThemeFlag.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "@jest/globals"; -import { applyDefaultTheme, withoutThemeFields } from "../../../src/controllers/statusPageThemeFlag.ts"; -import { DEFAULT_STATUS_PAGE_THEME, DEFAULT_STATUS_PAGE_THEME_MODE } from "../../../src/types/statusPage.ts"; +import { applyDefaultTheme, withoutThemeFields } from "../../../src/api/controllers/statusPageThemeFlag.ts"; +import { DEFAULT_STATUS_PAGE_THEME, DEFAULT_STATUS_PAGE_THEME_MODE } from "../../../src/domain/status-pages/status-page.type.ts"; import { makeStatusPage } from "../../helpers/makeStatusPage.ts"; describe("statusPageThemeFlag", () => { diff --git a/server/test/unit/providers/network/advancedMatcher.test.ts b/server/test/unit/providers/network/advancedMatcher.test.ts index e0b2c773c..f94e9bb53 100644 --- a/server/test/unit/providers/network/advancedMatcher.test.ts +++ b/server/test/unit/providers/network/advancedMatcher.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, jest } from "@jest/globals"; -import { AdvancedMatcher } from "../../../../src/service/infrastructure/network/AdvancedMatcher.ts"; -import type { Monitor } from "../../../../src/types/index.ts"; +import { AdvancedMatcher } from "../../../../src/service/network/AdvancedMatcher.ts"; +import type { Monitor } from "../../../../src/domain/monitors/monitor.types.ts"; // ── Helpers ────────────────────────────────────────────────────────────────── diff --git a/server/test/unit/providers/network/dnsProvider.test.ts b/server/test/unit/providers/network/dnsProvider.test.ts index a96731be5..1c31b3b1d 100644 --- a/server/test/unit/providers/network/dnsProvider.test.ts +++ b/server/test/unit/providers/network/dnsProvider.test.ts @@ -1,8 +1,8 @@ import { beforeEach, describe, expect, it, jest } from "@jest/globals"; import { testStatusProviderContract } from "../../../helpers/statusProviderContract.ts"; -import { NETWORK_ERROR } from "../../../../src/service/infrastructure/network/utils.ts"; -import type { Monitor } from "../../../../src/types/index.ts"; -import { DNSProvider } from "../../../../src/service/infrastructure/network/DNSProvider.ts"; +import { NETWORK_ERROR } from "../../../../src/service/network/utils.ts"; +import type { Monitor } from "../../../../src/domain/monitors/monitor.types.ts"; +import { DNSProvider } from "../../../../src/service/network/DNSProvider.ts"; // ── Mocks ──────────────────────────────────────────────────────────────────── diff --git a/server/test/unit/providers/network/dockerProvider.test.ts b/server/test/unit/providers/network/dockerProvider.test.ts index 0f3dd68f6..f0b743f16 100644 --- a/server/test/unit/providers/network/dockerProvider.test.ts +++ b/server/test/unit/providers/network/dockerProvider.test.ts @@ -1,9 +1,9 @@ import { describe, expect, it, jest } from "@jest/globals"; -import { DockerProvider } from "../../../../src/service/infrastructure/network/DockerProvider.ts"; +import { DockerProvider } from "../../../../src/service/network/DockerProvider.ts"; import { testStatusProviderContract } from "../../../helpers/statusProviderContract.ts"; import { createMockLogger } from "../../../helpers/createMockLogger.ts"; -import { NETWORK_ERROR } from "../../../../src/service/infrastructure/network/utils.ts"; -import type { Monitor } from "../../../../src/types/index.ts"; +import { NETWORK_ERROR } from "../../../../src/service/network/utils.ts"; +import type { Monitor } from "../../../../src/domain/monitors/monitor.types.ts"; // ── Helpers ────────────────────────────────────────────────────────────────── diff --git a/server/test/unit/providers/network/gameProvider.test.ts b/server/test/unit/providers/network/gameProvider.test.ts index d34e99621..d166c30f3 100644 --- a/server/test/unit/providers/network/gameProvider.test.ts +++ b/server/test/unit/providers/network/gameProvider.test.ts @@ -1,9 +1,9 @@ import { describe, expect, it, jest } from "@jest/globals"; -import { GameProvider } from "../../../../src/service/infrastructure/network/GameProvider.ts"; +import { GameProvider } from "../../../../src/service/network/GameProvider.ts"; import { testStatusProviderContract } from "../../../helpers/statusProviderContract.ts"; import { createMockLogger } from "../../../helpers/createMockLogger.ts"; -import { NETWORK_ERROR } from "../../../../src/service/infrastructure/network/utils.ts"; -import type { Monitor } from "../../../../src/types/index.ts"; +import { NETWORK_ERROR } from "../../../../src/service/network/utils.ts"; +import type { Monitor } from "../../../../src/domain/monitors/monitor.types.ts"; // ── Helpers ────────────────────────────────────────────────────────────────── diff --git a/server/test/unit/providers/network/grpcProvider.test.ts b/server/test/unit/providers/network/grpcProvider.test.ts index efa2e7992..bb1c78aac 100644 --- a/server/test/unit/providers/network/grpcProvider.test.ts +++ b/server/test/unit/providers/network/grpcProvider.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it, jest } from "@jest/globals"; -import { GrpcProvider } from "../../../../src/service/infrastructure/network/GrpcProvider.ts"; +import { GrpcProvider } from "../../../../src/service/network/GrpcProvider.ts"; import { testStatusProviderContract } from "../../../helpers/statusProviderContract.ts"; -import type { Monitor } from "../../../../src/types/index.ts"; +import type { Monitor } from "../../../../src/domain/monitors/monitor.types.ts"; // ── Helpers ────────────────────────────────────────────────────────────────── diff --git a/server/test/unit/providers/network/hardwareProvider.test.ts b/server/test/unit/providers/network/hardwareProvider.test.ts index 2f51454a0..2b4583af9 100644 --- a/server/test/unit/providers/network/hardwareProvider.test.ts +++ b/server/test/unit/providers/network/hardwareProvider.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it, jest } from "@jest/globals"; -import { HardwareProvider } from "../../../../src/service/infrastructure/network/HardwareProvider.ts"; +import { HardwareProvider } from "../../../../src/service/network/HardwareProvider.ts"; import { testStatusProviderContract } from "../../../helpers/statusProviderContract.ts"; -import type { HttpProvider } from "../../../../src/service/infrastructure/network/HttpProvider.ts"; -import type { Monitor } from "../../../../src/types/index.ts"; +import type { HttpProvider } from "../../../../src/service/network/HttpProvider.ts"; +import type { Monitor } from "../../../../src/domain/monitors/monitor.types.ts"; // ── Helpers ────────────────────────────────────────────────────────────────── diff --git a/server/test/unit/providers/network/httpProvider.test.ts b/server/test/unit/providers/network/httpProvider.test.ts index 1addcba6f..10b66a93a 100644 --- a/server/test/unit/providers/network/httpProvider.test.ts +++ b/server/test/unit/providers/network/httpProvider.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it, jest } from "@jest/globals"; import { testStatusProviderContract } from "../../../helpers/statusProviderContract.ts"; -import { NETWORK_ERROR } from "../../../../src/service/infrastructure/network/utils.ts"; -import type { Monitor } from "../../../../src/types/index.ts"; +import { NETWORK_ERROR } from "../../../../src/service/network/utils.ts"; +import type { Monitor } from "../../../../src/domain/monitors/monitor.types.ts"; // ── Mocks ──────────────────────────────────────────────────────────────────── @@ -38,7 +38,7 @@ jest.unstable_mockModule("got", () => ({ }, })); -const { HttpProvider } = await import("../../../../src/service/infrastructure/network/HttpProvider.ts"); +const { HttpProvider } = await import("../../../../src/service/network/HttpProvider.ts"); const gotModule = await import("got"); const { HTTPError, RequestError } = gotModule; diff --git a/server/test/unit/providers/network/pageSpeedProvider.test.ts b/server/test/unit/providers/network/pageSpeedProvider.test.ts index c461b0ad2..df5beb0be 100644 --- a/server/test/unit/providers/network/pageSpeedProvider.test.ts +++ b/server/test/unit/providers/network/pageSpeedProvider.test.ts @@ -1,10 +1,10 @@ import { describe, expect, it, jest } from "@jest/globals"; -import { PageSpeedProvider } from "../../../../src/service/infrastructure/network/PageSpeedProvider.ts"; +import { PageSpeedProvider } from "../../../../src/service/network/PageSpeedProvider.ts"; import { testStatusProviderContract } from "../../../helpers/statusProviderContract.ts"; import { createMockLogger } from "../../../helpers/createMockLogger.ts"; -import type { HttpProvider } from "../../../../src/service/infrastructure/network/HttpProvider.ts"; -import type { ISettingsService } from "../../../../src/service/system/settingsService.ts"; -import type { Monitor } from "../../../../src/types/index.ts"; +import type { HttpProvider } from "../../../../src/service/network/HttpProvider.ts"; +import type { ISettingsService } from "../../../../src/domain/app-settings/app-settings.service.ts"; +import type { Monitor } from "../../../../src/domain/monitors/monitor.types.ts"; // ── Helpers ────────────────────────────────────────────────────────────────── diff --git a/server/test/unit/providers/network/pingProvider.test.ts b/server/test/unit/providers/network/pingProvider.test.ts index 2f38eef00..8f006a470 100644 --- a/server/test/unit/providers/network/pingProvider.test.ts +++ b/server/test/unit/providers/network/pingProvider.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it, jest } from "@jest/globals"; -import { PingProvider } from "../../../../src/service/infrastructure/network/PingProvider.ts"; +import { PingProvider } from "../../../../src/service/network/PingProvider.ts"; import { testStatusProviderContract } from "../../../helpers/statusProviderContract.ts"; -import type { Monitor } from "../../../../src/types/index.ts"; +import type { Monitor } from "../../../../src/domain/monitors/monitor.types.ts"; // ── Helpers ────────────────────────────────────────────────────────────────── diff --git a/server/test/unit/providers/network/portProvider.test.ts b/server/test/unit/providers/network/portProvider.test.ts index cbf64af16..8a7d55c4c 100644 --- a/server/test/unit/providers/network/portProvider.test.ts +++ b/server/test/unit/providers/network/portProvider.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it, jest } from "@jest/globals"; -import { PortProvider } from "../../../../src/service/infrastructure/network/PortProvider.ts"; +import { PortProvider } from "../../../../src/service/network/PortProvider.ts"; import { testStatusProviderContract } from "../../../helpers/statusProviderContract.ts"; -import { NETWORK_ERROR } from "../../../../src/service/infrastructure/network/utils.ts"; -import type { Monitor } from "../../../../src/types/index.ts"; +import { NETWORK_ERROR } from "../../../../src/service/network/utils.ts"; +import type { Monitor } from "../../../../src/domain/monitors/monitor.types.ts"; // ── Helpers ────────────────────────────────────────────────────────────────── diff --git a/server/test/unit/providers/network/utils.test.ts b/server/test/unit/providers/network/utils.test.ts index 84427152e..b37a5597c 100644 --- a/server/test/unit/providers/network/utils.test.ts +++ b/server/test/unit/providers/network/utils.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "@jest/globals"; -import { timeRequest, NETWORK_ERROR, PING_ERROR, isStatusUp } from "../../../../src/service/infrastructure/network/utils.ts"; +import { timeRequest, NETWORK_ERROR, PING_ERROR, isStatusUp } from "../../../../src/service/network/utils.ts"; describe("network utils", () => { describe("timeRequest", () => { diff --git a/server/test/unit/providers/network/webSocketProvider.test.ts b/server/test/unit/providers/network/webSocketProvider.test.ts index 73e4416a1..12ff32d63 100644 --- a/server/test/unit/providers/network/webSocketProvider.test.ts +++ b/server/test/unit/providers/network/webSocketProvider.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it, jest, beforeEach, afterEach } from "@jest/globals"; -import { WebSocketProvider } from "../../../../src/service/infrastructure/network/WebSocketProvider.ts"; +import { WebSocketProvider } from "../../../../src/service/network/WebSocketProvider.ts"; import { testStatusProviderContract } from "../../../helpers/statusProviderContract.ts"; -import { NETWORK_ERROR } from "../../../../src/service/infrastructure/network/utils.ts"; -import type { Monitor } from "../../../../src/types/index.ts"; +import { NETWORK_ERROR } from "../../../../src/service/network/utils.ts"; +import type { Monitor } from "../../../../src/domain/monitors/monitor.types.ts"; // ── Helpers ────────────────────────────────────────────────────────────────── diff --git a/server/test/unit/providers/notifications/discordProvider.test.ts b/server/test/unit/providers/notifications/discordProvider.test.ts index 28c30ed22..bdb431fce 100644 --- a/server/test/unit/providers/notifications/discordProvider.test.ts +++ b/server/test/unit/providers/notifications/discordProvider.test.ts @@ -6,7 +6,7 @@ import { testNotificationProviderContract } from "../../../helpers/notificationP const mockGotPost = jest.fn().mockResolvedValue({}); jest.unstable_mockModule("got", () => ({ default: { post: mockGotPost } })); -const { DiscordProvider } = await import("../../../../src/service/infrastructure/notificationProviders/discord.ts"); +const { DiscordProvider } = await import("../../../../src/domain/notifications/providers/discord.ts"); const createProvider = () => { const logger = createMockLogger(); diff --git a/server/test/unit/providers/notifications/emailProvider.test.ts b/server/test/unit/providers/notifications/emailProvider.test.ts index e0dc8b676..fecce8ef6 100644 --- a/server/test/unit/providers/notifications/emailProvider.test.ts +++ b/server/test/unit/providers/notifications/emailProvider.test.ts @@ -1,9 +1,9 @@ import { describe, expect, it, jest, beforeEach } from "@jest/globals"; -import { EmailProvider } from "../../../../src/service/infrastructure/notificationProviders/email.ts"; +import { EmailProvider } from "../../../../src/domain/notifications/providers/email.ts"; import { createMockLogger } from "../../../helpers/createMockLogger.ts"; import { makeNotification, makeMessage } from "../../../helpers/notificationMessage.ts"; import { testNotificationProviderContract } from "../../../helpers/notificationProviderContract.ts"; -import type { IEmailService } from "../../../../src/service/infrastructure/emailService.ts"; +import type { IEmailService } from "../../../../src/service/emailService.ts"; // ── Helpers ────────────────────────────────────────────────────────────────── diff --git a/server/test/unit/providers/notifications/matrixProvider.test.ts b/server/test/unit/providers/notifications/matrixProvider.test.ts index f6ad36692..65305e731 100644 --- a/server/test/unit/providers/notifications/matrixProvider.test.ts +++ b/server/test/unit/providers/notifications/matrixProvider.test.ts @@ -7,7 +7,7 @@ const mockGotPut = jest.fn().mockResolvedValue({}); jest.unstable_mockModule("got", () => ({ default: { put: mockGotPut } })); jest.unstable_mockModule("crypto", () => ({ randomUUID: () => "test-uuid-1234" })); -const { MatrixProvider } = await import("../../../../src/service/infrastructure/notificationProviders/matrix.ts"); +const { MatrixProvider } = await import("../../../../src/domain/notifications/providers/matrix.ts"); const createProvider = () => { const logger = createMockLogger(); diff --git a/server/test/unit/providers/notifications/notificationUtils.test.ts b/server/test/unit/providers/notifications/notificationUtils.test.ts index 53a2666c8..5118e570e 100644 --- a/server/test/unit/providers/notifications/notificationUtils.test.ts +++ b/server/test/unit/providers/notifications/notificationUtils.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, jest } from "@jest/globals"; -import { buildTestEmail, getTestMessage } from "../../../../src/service/infrastructure/notificationProviders/utils.ts"; -import type { IEmailService } from "../../../../src/service/infrastructure/emailService.ts"; +import { buildTestEmail, getTestMessage } from "../../../../src/domain/notifications/providers/utils.ts"; +import type { IEmailService } from "../../../../src/service/emailService.ts"; describe("notification utils", () => { describe("getTestMessage", () => { diff --git a/server/test/unit/providers/notifications/ntfyProvider.test.ts b/server/test/unit/providers/notifications/ntfyProvider.test.ts index d335b5d01..ffd95a0d7 100644 --- a/server/test/unit/providers/notifications/ntfyProvider.test.ts +++ b/server/test/unit/providers/notifications/ntfyProvider.test.ts @@ -6,7 +6,7 @@ import { testNotificationProviderContract } from "../../../helpers/notificationP const mockGotPost = jest.fn().mockResolvedValue({}); jest.unstable_mockModule("got", () => ({ default: { post: mockGotPost } })); -const { NtfyProvider } = await import("../../../../src/service/infrastructure/notificationProviders/ntfy.ts"); +const { NtfyProvider } = await import("../../../../src/domain/notifications/providers/ntfy.ts"); const createProvider = () => { const logger = createMockLogger(); diff --git a/server/test/unit/providers/notifications/pagerdutyProvider.test.ts b/server/test/unit/providers/notifications/pagerdutyProvider.test.ts index f7c9c04c8..8b8d185b4 100644 --- a/server/test/unit/providers/notifications/pagerdutyProvider.test.ts +++ b/server/test/unit/providers/notifications/pagerdutyProvider.test.ts @@ -6,7 +6,7 @@ import { testNotificationProviderContract } from "../../../helpers/notificationP const mockGotPost = jest.fn().mockResolvedValue({}); jest.unstable_mockModule("got", () => ({ default: { post: mockGotPost } })); -const { PagerDutyProvider } = await import("../../../../src/service/infrastructure/notificationProviders/pagerduty.ts"); +const { PagerDutyProvider } = await import("../../../../src/domain/notifications/providers/pagerduty.ts"); const createProvider = () => { const logger = createMockLogger(); diff --git a/server/test/unit/providers/notifications/pushoverProvider.test.ts b/server/test/unit/providers/notifications/pushoverProvider.test.ts index 8d32573b5..a227b0b1b 100644 --- a/server/test/unit/providers/notifications/pushoverProvider.test.ts +++ b/server/test/unit/providers/notifications/pushoverProvider.test.ts @@ -6,7 +6,7 @@ import { testNotificationProviderContract } from "../../../helpers/notificationP const mockGotPost = jest.fn().mockResolvedValue({}); jest.unstable_mockModule("got", () => ({ default: { post: mockGotPost } })); -const { PushoverProvider } = await import("../../../../src/service/infrastructure/notificationProviders/pushover.ts"); +const { PushoverProvider } = await import("../../../../src/domain/notifications/providers/pushover.ts"); const createProvider = () => { const logger = createMockLogger(); diff --git a/server/test/unit/providers/notifications/slackProvider.test.ts b/server/test/unit/providers/notifications/slackProvider.test.ts index 232eccaaa..20058ab11 100644 --- a/server/test/unit/providers/notifications/slackProvider.test.ts +++ b/server/test/unit/providers/notifications/slackProvider.test.ts @@ -6,7 +6,7 @@ import { testNotificationProviderContract } from "../../../helpers/notificationP const mockGotPost = jest.fn().mockResolvedValue({}); jest.unstable_mockModule("got", () => ({ default: { post: mockGotPost }, HTTPError: class extends Error {} })); -const { SlackProvider } = await import("../../../../src/service/infrastructure/notificationProviders/slack.ts"); +const { SlackProvider } = await import("../../../../src/domain/notifications/providers/slack.ts"); const createProvider = () => { const logger = createMockLogger(); diff --git a/server/test/unit/providers/notifications/teamsProvider.test.ts b/server/test/unit/providers/notifications/teamsProvider.test.ts index d27d396a9..c3766ec16 100644 --- a/server/test/unit/providers/notifications/teamsProvider.test.ts +++ b/server/test/unit/providers/notifications/teamsProvider.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, jest, beforeEach } from "@jest/globals"; -import type { Notification } from "../../../../src/types/notification.ts"; -import type { NotificationMessage } from "../../../../src/types/notificationMessage.ts"; +import type { Notification } from "../../../../src/domain/notifications/notification.type.ts"; +import type { NotificationMessage } from "../../../../src/domain/notifications/notification.type.ts"; import { createMockLogger } from "../../../helpers/createMockLogger.ts"; const mockPost = jest.fn(); @@ -9,7 +9,7 @@ jest.unstable_mockModule("got", () => ({ HTTPError: class HTTPError extends Error {}, })); -const { TeamsProvider } = await import("../../../../src/service/infrastructure/notificationProviders/teams.ts"); +const { TeamsProvider } = await import("../../../../src/domain/notifications/providers/teams.ts"); const createNotification = (overrides?: Partial): Notification => ({ id: "notif-1", diff --git a/server/test/unit/providers/notifications/telegramProvider.test.ts b/server/test/unit/providers/notifications/telegramProvider.test.ts index fe9dd2c2e..f8f853e62 100644 --- a/server/test/unit/providers/notifications/telegramProvider.test.ts +++ b/server/test/unit/providers/notifications/telegramProvider.test.ts @@ -6,7 +6,7 @@ import { testNotificationProviderContract } from "../../../helpers/notificationP const mockGotPost = jest.fn().mockResolvedValue({}); jest.unstable_mockModule("got", () => ({ default: { post: mockGotPost } })); -const { TelegramProvider } = await import("../../../../src/service/infrastructure/notificationProviders/telegram.ts"); +const { TelegramProvider } = await import("../../../../src/domain/notifications/providers/telegram.ts"); const createProvider = () => { const logger = createMockLogger(); diff --git a/server/test/unit/providers/notifications/twilioProvider.test.ts b/server/test/unit/providers/notifications/twilioProvider.test.ts index 88bfcdf7e..896a23395 100644 --- a/server/test/unit/providers/notifications/twilioProvider.test.ts +++ b/server/test/unit/providers/notifications/twilioProvider.test.ts @@ -6,7 +6,7 @@ import { testNotificationProviderContract } from "../../../helpers/notificationP const mockGotPost = jest.fn().mockResolvedValue({}); jest.unstable_mockModule("got", () => ({ default: { post: mockGotPost } })); -const { TwilioProvider } = await import("../../../../src/service/infrastructure/notificationProviders/twilio.ts"); +const { TwilioProvider } = await import("../../../../src/domain/notifications/providers/twilio.ts"); const createProvider = () => { const logger = createMockLogger(); diff --git a/server/test/unit/providers/notifications/webhookProvider.test.ts b/server/test/unit/providers/notifications/webhookProvider.test.ts index caf17851b..fd16f2c06 100644 --- a/server/test/unit/providers/notifications/webhookProvider.test.ts +++ b/server/test/unit/providers/notifications/webhookProvider.test.ts @@ -6,7 +6,7 @@ import { testNotificationProviderContract } from "../../../helpers/notificationP const mockGotPost = jest.fn().mockResolvedValue({}); jest.unstable_mockModule("got", () => ({ default: { post: mockGotPost } })); -const { WebhookProvider } = await import("../../../../src/service/infrastructure/notificationProviders/webhook.ts"); +const { WebhookProvider } = await import("../../../../src/domain/notifications/providers/webhook.ts"); const createProvider = () => { const logger = createMockLogger(); diff --git a/server/test/unit/services/bufferService.test.ts b/server/test/unit/services/bufferService.test.ts index f1f395e2d..5a6418c70 100644 --- a/server/test/unit/services/bufferService.test.ts +++ b/server/test/unit/services/bufferService.test.ts @@ -1,10 +1,11 @@ import { describe, expect, it, jest, beforeEach, afterEach } from "@jest/globals"; -import { BufferService } from "../../../src/service/infrastructure/bufferService.ts"; +import { BufferService } from "../../../src/service/bufferService.ts"; import { createMockLogger } from "../../helpers/createMockLogger.ts"; -import type { ICheckService } from "../../../src/service/business/checkService.ts"; -import type { IGeoChecksService } from "../../../src/service/business/geoChecksService.ts"; -import type { ISettingsService } from "../../../src/service/system/settingsService.ts"; -import type { Check, GeoCheck } from "../../../src/types/index.ts"; +import type { ICheckService } from "../../../src/domain/checks/check.service.ts"; +import type { IGeoChecksService } from "../../../src/domain/geo-checks/geo-check.service.ts"; +import type { ISettingsService } from "../../../src/domain/app-settings/app-settings.service.ts"; +import type { Check } from "../../../src/domain/checks/check.type.ts"; +import type { GeoCheck } from "../../../src/domain/geo-checks/geo-check.type.ts"; // ── Helpers ────────────────────────────────────────────────────────────────── diff --git a/server/test/unit/services/checkService.test.ts b/server/test/unit/services/checkService.test.ts index 93919df5f..b658c78da 100644 --- a/server/test/unit/services/checkService.test.ts +++ b/server/test/unit/services/checkService.test.ts @@ -1,8 +1,9 @@ import { describe, expect, it, jest } from "@jest/globals"; -import { CheckService } from "../../../src/service/business/checkService.ts"; +import { CheckService } from "../../../src/domain/checks/check.service.ts"; import { createMockLogger } from "../../helpers/createMockLogger.ts"; -import type { IChecksRepository, IMonitorsRepository } from "../../../src/repositories/index.ts"; -import type { MonitorStatusResponse, HardwareStatusPayload, PageSpeedStatusPayload } from "../../../src/types/index.ts"; +import type { IChecksRepository } from "../../../src/domain/checks/check.repository.interface.ts"; +import type { IMonitorsRepository } from "../../../src/domain/monitors/monitor.repository.interface.ts"; +import type { MonitorStatusResponse, HardwareStatusPayload, PageSpeedStatusPayload } from "../../../src/types/network.ts"; // ── Helpers ────────────────────────────────────────────────────────────────── diff --git a/server/test/unit/services/diagnosticService.test.ts b/server/test/unit/services/diagnosticService.test.ts index 402c0c527..b44de1986 100644 --- a/server/test/unit/services/diagnosticService.test.ts +++ b/server/test/unit/services/diagnosticService.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, jest, beforeEach, afterEach } from "@jest/globals"; -import { DiagnosticService } from "../../../src/service/business/diagnosticService.ts"; -import type { IDb } from "../../../src/db/IDb.ts"; +import { DiagnosticService } from "../../../src/domain/diagnostics/diagnostic.service.ts"; +import type { IDb } from "../../../src/db/db.interface.ts"; import type { Mongoose } from "mongoose"; // ── Test helpers ───────────────────────────────────────────────────────────── diff --git a/server/test/unit/services/emailService.test.ts b/server/test/unit/services/emailService.test.ts index d4d275ad8..fbfdf15fd 100644 --- a/server/test/unit/services/emailService.test.ts +++ b/server/test/unit/services/emailService.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it, jest, beforeEach } from "@jest/globals"; -import { EmailService } from "../../../src/service/infrastructure/emailService.ts"; +import { EmailService } from "../../../src/service/emailService.ts"; import { createMockLogger } from "../../helpers/createMockLogger.ts"; -import type { ISettingsService } from "../../../src/service/system/settingsService.ts"; -import type { EmailTransportConfig } from "../../../src/types/index.ts"; +import type { ISettingsService } from "../../../src/domain/app-settings/app-settings.service.ts"; +import type { EmailTransportConfig } from "../../../src/domain/app-settings/app-settings.type.ts"; // ── Helpers ────────────────────────────────────────────────────────────────── diff --git a/server/test/unit/services/geoChecksService.test.ts b/server/test/unit/services/geoChecksService.test.ts index ab03d319e..8e50fa3e8 100644 --- a/server/test/unit/services/geoChecksService.test.ts +++ b/server/test/unit/services/geoChecksService.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it, jest } from "@jest/globals"; -import { GeoChecksService } from "../../../src/service/business/geoChecksService.ts"; +import { GeoChecksService } from "../../../src/domain/geo-checks/geo-check.service.ts"; import { createMockLogger } from "../../helpers/createMockLogger.ts"; -import type { Monitor } from "../../../src/types/index.ts"; -import type { GeoCheckResult } from "../../../src/types/geoCheck.ts"; +import type { Monitor } from "../../../src/domain/monitors/monitor.types.ts"; +import type { GeoCheckResult } from "../../../src/domain/geo-checks/geo-check.type.ts"; // ── Helpers ────────────────────────────────────────────────────────────────── diff --git a/server/test/unit/services/globalPingService.test.ts b/server/test/unit/services/globalPingService.test.ts index 78d195b0f..376653110 100644 --- a/server/test/unit/services/globalPingService.test.ts +++ b/server/test/unit/services/globalPingService.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, jest, beforeEach, afterEach } from "@jest/globals"; import { createMockLogger } from "../../helpers/createMockLogger.ts"; -import type { GeoContinent } from "../../../src/types/geoCheck.ts"; +import type { GeoContinent } from "../../../src/domain/geo-checks/geo-check.type.ts"; // ── got mock ───────────────────────────────────────────────────────────────── @@ -15,7 +15,7 @@ jest.unstable_mockModule("got", () => ({ })); // Dynamic import AFTER mock registration -const { GlobalPingService } = await import("../../../src/service/infrastructure/globalPingService.ts"); +const { GlobalPingService } = await import("../../../src/service/globalPingService.ts"); // ── Helpers ────────────────────────────────────────────────────────────────── diff --git a/server/test/unit/services/incidentService.test.ts b/server/test/unit/services/incidentService.test.ts index 4274f67d8..f62f4ccf4 100644 --- a/server/test/unit/services/incidentService.test.ts +++ b/server/test/unit/services/incidentService.test.ts @@ -1,11 +1,13 @@ import { describe, expect, it, jest, beforeEach } from "@jest/globals"; -import { IncidentService } from "../../../src/service/business/incidentService.ts"; +import { IncidentService } from "../../../src/domain/incidents/incident.service.ts"; import { createMockLogger } from "../../helpers/createMockLogger.ts"; -import type { IIncidentsRepository, IMonitorsRepository, IUsersRepository } from "../../../src/repositories/index.ts"; -import type { INotificationMessageBuilder } from "../../../src/service/infrastructure/notificationMessageBuilder.ts"; -import type { Monitor } from "../../../src/types/monitor.ts"; -import type { Incident } from "../../../src/types/index.ts"; -import type { MonitorActionDecision } from "../../../src/service/infrastructure/JobQueues/QueueHelper.ts"; +import type { IIncidentsRepository } from "../../../src/domain/incidents/incident.repository.interface.ts"; +import type { IMonitorsRepository } from "../../../src/domain/monitors/monitor.repository.interface.ts"; +import type { IUsersRepository } from "../../../src/domain/users/user.repository.interface.ts"; +import type { INotificationMessageBuilder } from "../../../src/domain/notifications/notification.message-builder.ts"; +import type { Monitor } from "../../../src/domain/monitors/monitor.types.ts"; +import type { Incident } from "../../../src/domain/incidents/incident.type.ts"; +import type { MonitorActionDecision } from "../../../src/service/job-queues/job-queue.helper.ts"; // ── Helpers ────────────────────────────────────────────────────────────────── diff --git a/server/test/unit/services/inviteService.test.ts b/server/test/unit/services/inviteService.test.ts index da29d1834..c050d91e6 100644 --- a/server/test/unit/services/inviteService.test.ts +++ b/server/test/unit/services/inviteService.test.ts @@ -1,6 +1,7 @@ import { describe, expect, it, jest } from "@jest/globals"; -import { InviteService } from "../../../src/service/business/inviteService.ts"; -import type { Invite, UserRole } from "../../../src/types/index.ts"; +import { InviteService } from "../../../src/domain/invites/invite.service.ts"; +import type { Invite } from "../../../src/domain/invites/invite.type.ts"; +import type { UserRole } from "../../../src/domain/users/user.type.ts"; // ── Helpers ────────────────────────────────────────────────────────────────── diff --git a/server/test/unit/services/lessSimpleQueue.test.ts b/server/test/unit/services/lessSimpleQueue.test.ts index 6351dc5d5..b43383825 100644 --- a/server/test/unit/services/lessSimpleQueue.test.ts +++ b/server/test/unit/services/lessSimpleQueue.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, jest } from "@jest/globals"; import { createMockLogger } from "../../helpers/createMockLogger.ts"; -import type { Monitor } from "../../../src/types/monitor.ts"; +import type { Monitor } from "../../../src/domain/monitors/monitor.types.ts"; // ── Mock Scheduler / MongoStore ────────────────────────────────────────────── @@ -44,7 +44,7 @@ jest.unstable_mockModule("less-simple-scheduler", () => ({ MongoStore: MockMongoStore, })); -const { LessSimpleQueue } = await import("../../../src/service/infrastructure/JobQueues/LessSimpleQueue.ts"); +const { LessSimpleQueue } = await import("../../../src/service/job-queues/job-queue.less-simple.ts"); const createQueueHelper = () => ({ getHeartbeatJob: jest.fn().mockReturnValue(() => Promise.resolve()), diff --git a/server/test/unit/services/maintenanceWindowService.test.ts b/server/test/unit/services/maintenanceWindowService.test.ts index 376b8f20d..9d381ae74 100644 --- a/server/test/unit/services/maintenanceWindowService.test.ts +++ b/server/test/unit/services/maintenanceWindowService.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it, jest } from "@jest/globals"; -import { MaintenanceWindowService } from "../../../src/service/business/maintenanceWindowService.ts"; -import type { IMaintenanceWindowsRepository } from "../../../src/repositories/maintenance-windows/IMaintenanceWindowsRepository.ts"; -import type { IMonitorsRepository } from "../../../src/repositories/monitors/IMonitorsRepository.ts"; -import type { MaintenanceWindow } from "../../../src/types/index.ts"; +import { MaintenanceWindowService } from "../../../src/domain/maintenance-windows/maintenance-window.service.ts"; +import type { IMaintenanceWindowsRepository } from "../../../src/domain/maintenance-windows/maintenance-window.repository.interface.ts"; +import type { IMonitorsRepository } from "../../../src/domain/monitors/monitor.repository.interface.ts"; +import type { MaintenanceWindow } from "../../../src/domain/maintenance-windows/maintenance-window.type.ts"; // ── Helpers ────────────────────────────────────────────────────────────────── diff --git a/server/test/unit/services/monitorService.test.ts b/server/test/unit/services/monitorService.test.ts index a21967de8..3dff29f26 100644 --- a/server/test/unit/services/monitorService.test.ts +++ b/server/test/unit/services/monitorService.test.ts @@ -1,13 +1,11 @@ import { describe, expect, it, jest, beforeEach } from "@jest/globals"; -import { MonitorService } from "../../../src/service/business/monitorService.ts"; -import type { - IChecksRepository, - IGeoChecksRepository, - IIncidentsRepository, - IMonitorStatsRepository, - IMonitorsRepository, - IStatusPagesRepository, -} from "../../../src/repositories/index.ts"; +import { MonitorService } from "../../../src/domain/monitors/monitor.service.ts"; +import type { IChecksRepository } from "../../../src/domain/checks/check.repository.interface.ts"; +import type { IGeoChecksRepository } from "../../../src/domain/geo-checks/geo-check.repository.interface.ts"; +import type { IIncidentsRepository } from "../../../src/domain/incidents/incident.repository.interface.ts"; +import type { IMonitorStatsRepository } from "../../../src/domain/monitor-stats/monitor-stats.repository.interface.ts"; +import type { IMonitorsRepository } from "../../../src/domain/monitors/monitor.repository.interface.ts"; +import type { IStatusPagesRepository } from "../../../src/domain/status-pages/status-page-repository.interface.ts"; import { createMockLogger } from "../../helpers/createMockLogger.ts"; const createMonitorsRepositoryMock = () => diff --git a/server/test/unit/services/networkService.test.ts b/server/test/unit/services/networkService.test.ts index c9f496166..268b52e3a 100644 --- a/server/test/unit/services/networkService.test.ts +++ b/server/test/unit/services/networkService.test.ts @@ -1,9 +1,9 @@ import { describe, expect, it, jest } from "@jest/globals"; -import { NetworkService } from "../../../src/service/infrastructure/networkService.ts"; +import { NetworkService } from "../../../src/service/networkService.ts"; import { createMockLogger } from "../../helpers/createMockLogger.ts"; -import { NETWORK_ERROR } from "../../../src/service/infrastructure/network/utils.ts"; -import type { IStatusProvider } from "../../../src/service/infrastructure/network/IStatusProvider.ts"; -import type { Monitor, MonitorType } from "../../../src/types/index.ts"; +import { NETWORK_ERROR } from "../../../src/service/network/utils.ts"; +import type { IStatusProvider } from "../../../src/service/network/IStatusProvider.ts"; +import type { Monitor, MonitorType } from "../../../src/domain/monitors/monitor.types.ts"; import type { AxiosStatic } from "axios"; // ── Helpers ────────────────────────────────────────────────────────────────── diff --git a/server/test/unit/services/notificationMessageBuilder.test.ts b/server/test/unit/services/notificationMessageBuilder.test.ts index 4403a8bb3..0ae4d8096 100644 --- a/server/test/unit/services/notificationMessageBuilder.test.ts +++ b/server/test/unit/services/notificationMessageBuilder.test.ts @@ -1,7 +1,8 @@ import { describe, expect, it, beforeEach } from "@jest/globals"; -import { NotificationMessageBuilder } from "../../../src/service/infrastructure/notificationMessageBuilder.ts"; -import type { Monitor, MonitorStatusResponse, HardwareStatusPayload } from "../../../src/types/index.ts"; -import type { MonitorActionDecision } from "../../../src/service/infrastructure/JobQueues/QueueHelper.ts"; +import { NotificationMessageBuilder } from "../../../src/domain/notifications/notification.message-builder.ts"; +import type { Monitor } from "../../../src/domain/monitors/monitor.types.ts"; +import type { MonitorStatusResponse, HardwareStatusPayload } from "../../../src/types/network.ts"; +import type { MonitorActionDecision } from "../../../src/service/job-queues/job-queue.helper.ts"; // ── Helpers ────────────────────────────────────────────────────────────────── diff --git a/server/test/unit/services/notificationsService.test.ts b/server/test/unit/services/notificationsService.test.ts index 9527fd3b5..eca1f349b 100644 --- a/server/test/unit/services/notificationsService.test.ts +++ b/server/test/unit/services/notificationsService.test.ts @@ -1,8 +1,10 @@ import { describe, expect, it, jest, beforeEach } from "@jest/globals"; -import { NotificationsService } from "../../../src/service/infrastructure/notificationsService.ts"; +import { NotificationsService } from "../../../src/domain/notifications/notification.service.ts"; import { createMockLogger } from "../../helpers/createMockLogger.ts"; -import type { Notification, Monitor, MonitorStatusResponse } from "../../../src/types/index.ts"; -import type { MonitorActionDecision } from "../../../src/service/infrastructure/JobQueues/QueueHelper.ts"; +import type { Monitor } from "../../../src/domain/monitors/monitor.types.ts"; +import type { Notification } from "../../../src/domain/notifications/notification.type.ts"; +import type { MonitorStatusResponse } from "../../../src/types/network.ts"; +import type { MonitorActionDecision } from "../../../src/service/job-queues/job-queue.helper.ts"; // ── Helpers ────────────────────────────────────────────────────────────────── diff --git a/server/test/unit/services/settingsService.test.ts b/server/test/unit/services/settingsService.test.ts index da75d3ee5..af58b5705 100644 --- a/server/test/unit/services/settingsService.test.ts +++ b/server/test/unit/services/settingsService.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it, jest } from "@jest/globals"; -import { SettingsService } from "../../../src/service/system/settingsService.ts"; -import type { ISettingsRepository } from "../../../src/repositories/settings/ISettingsRepository.ts"; -import type { ValidatedEnv } from "../../../src/validation/envValidation.ts"; -import type { Settings } from "../../../src/types/index.ts"; +import { SettingsService } from "../../../src/domain/app-settings/app-settings.service.ts"; +import type { ISettingsRepository } from "../../../src/domain/app-settings/app-settings-repository.interface.ts"; +import type { ValidatedEnv } from "../../../src/config/envValidation.ts"; +import type { Settings } from "../../../src/domain/app-settings/app-settings.type.ts"; // ── Helpers ────────────────────────────────────────────────────────────────── diff --git a/server/test/unit/services/statusPageService.test.ts b/server/test/unit/services/statusPageService.test.ts index 2deac9897..066bdff95 100644 --- a/server/test/unit/services/statusPageService.test.ts +++ b/server/test/unit/services/statusPageService.test.ts @@ -1,9 +1,9 @@ import { describe, expect, it, jest } from "@jest/globals"; -import { StatusPageService } from "../../../src/service/business/statusPageService.ts"; -import type { IStatusPagesRepository } from "../../../src/repositories/status-pages/IStatusPagesRepository.ts"; -import type { ISettingsService } from "../../../src/service/system/settingsService.ts"; -import type { StatusPage } from "../../../src/types/index.ts"; -import { DEFAULT_STATUS_PAGE_THEME, DEFAULT_STATUS_PAGE_THEME_MODE } from "../../../src/types/index.ts"; +import { StatusPageService } from "../../../src/domain/status-pages/status-page.service.ts"; +import type { IStatusPagesRepository } from "../../../src/domain/status-pages/status-page-repository.interface.ts"; +import type { ISettingsService } from "../../../src/domain/app-settings/app-settings.service.ts"; +import type { StatusPage } from "../../../src/domain/status-pages/status-page.type.ts"; +import { DEFAULT_STATUS_PAGE_THEME, DEFAULT_STATUS_PAGE_THEME_MODE } from "../../../src/domain/status-pages/status-page.type.ts"; // ── Helpers ────────────────────────────────────────────────────────────────── diff --git a/server/test/unit/services/statusService.test.ts b/server/test/unit/services/statusService.test.ts index 75323943b..2bd5fa74c 100644 --- a/server/test/unit/services/statusService.test.ts +++ b/server/test/unit/services/statusService.test.ts @@ -1,10 +1,14 @@ import { describe, expect, it, jest, beforeEach } from "@jest/globals"; -import { StatusService } from "../../../src/service/infrastructure/statusService.ts"; +import { StatusService } from "../../../src/service/statusService.ts"; import { createMockLogger } from "../../helpers/createMockLogger.ts"; -import { MAX_RECENT_CHECKS } from "../../../src/types/index.ts"; -import type { Monitor, MonitorStatus, MonitorStatusResponse, Check, HardwareStatusPayload } from "../../../src/types/index.ts"; -import type { IMonitorsRepository, IMonitorStatsRepository, IChecksRepository } from "../../../src/repositories/index.ts"; -import type { IBufferService } from "../../../src/service/infrastructure/bufferService.ts"; +import { MAX_RECENT_CHECKS } from "../../../src/domain/monitors/monitor.types.ts"; +import type { Monitor, MonitorStatus } from "../../../src/domain/monitors/monitor.types.ts"; +import type { Check } from "../../../src/domain/checks/check.type.ts"; +import type { MonitorStatusResponse, HardwareStatusPayload } from "../../../src/types/network.ts"; +import type { IMonitorsRepository } from "../../../src/domain/monitors/monitor.repository.interface.ts"; +import type { IMonitorStatsRepository } from "../../../src/domain/monitor-stats/monitor-stats.repository.interface.ts"; +import type { IChecksRepository } from "../../../src/domain/checks/check.repository.interface.ts"; +import type { IBufferService } from "../../../src/service/bufferService.ts"; // ── Helpers ────────────────────────────────────────────────────────────────── diff --git a/server/test/unit/services/superSimpleQueue.test.ts b/server/test/unit/services/superSimpleQueue.test.ts index b6da507ce..8f446b74f 100644 --- a/server/test/unit/services/superSimpleQueue.test.ts +++ b/server/test/unit/services/superSimpleQueue.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, jest, beforeEach } from "@jest/globals"; import { createMockLogger } from "../../helpers/createMockLogger.ts"; -import type { Monitor } from "../../../src/types/monitor.ts"; +import type { Monitor } from "../../../src/domain/monitors/monitor.types.ts"; // ── Mock Scheduler ─────────────────────────────────────────────────────────── @@ -35,7 +35,7 @@ jest.unstable_mockModule("super-simple-scheduler", () => ({ default: MockScheduler, })); -const { SuperSimpleQueue } = await import("../../../src/service/infrastructure/JobQueues/SuperSimpleQueue.ts"); +const { SuperSimpleQueue } = await import("../../../src/service/job-queues/job-queue.sumper-simple.ts"); const createQueueHelper = () => ({ getHeartbeatJob: jest.fn().mockReturnValue(() => Promise.resolve()), diff --git a/server/test/unit/services/superSimpleQueueHelper.test.ts b/server/test/unit/services/superSimpleQueueHelper.test.ts index 7075051eb..7a369f4db 100644 --- a/server/test/unit/services/superSimpleQueueHelper.test.ts +++ b/server/test/unit/services/superSimpleQueueHelper.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, jest } from "@jest/globals"; -import { QueueHelper } from "../../../src/service/infrastructure/JobQueues/QueueHelper.ts"; -import type { Monitor } from "../../../src/types/monitor.ts"; +import { QueueHelper } from "../../../src/service/job-queues/job-queue.helper.ts"; +import type { Monitor } from "../../../src/domain/monitors/monitor.types.ts"; import { createMockLogger } from "../../helpers/createMockLogger.ts"; // ── Helpers ────────────────────────────────────────────────────────────────── diff --git a/server/test/unit/services/tagsService.test.ts b/server/test/unit/services/tagsService.test.ts index d611d641e..7f99906d7 100644 --- a/server/test/unit/services/tagsService.test.ts +++ b/server/test/unit/services/tagsService.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, jest } from "@jest/globals"; -import { TagsService } from "../../../src/service/infrastructure/tagService.ts"; -import type { Tag } from "../../../src/types/index.ts"; +import { TagsService } from "../../../src/domain/tags/tag.service.ts"; +import type { Tag } from "../../../src/domain/tags/tag.type.ts"; // ── Helpers ────────────────────────────────────────────────────────────────── diff --git a/server/test/unit/services/userService.test.ts b/server/test/unit/services/userService.test.ts index 51590fb38..e2e11369c 100644 --- a/server/test/unit/services/userService.test.ts +++ b/server/test/unit/services/userService.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it, jest } from "@jest/globals"; -import { UserService } from "../../../src/service/business/userService.ts"; +import { UserService } from "../../../src/domain/users/user.service.ts"; import { createMockLogger } from "../../helpers/createMockLogger.ts"; -import type { User, UserRole } from "../../../src/types/index.ts"; +import type { User, UserRole } from "../../../src/domain/users/user.type.ts"; // ── Helpers ────────────────────────────────────────────────────────────────── diff --git a/server/test/unit/utils/maintenanceWindow.test.ts b/server/test/unit/utils/maintenanceWindow.test.ts index 5a3a39b6a..4c4ed3337 100644 --- a/server/test/unit/utils/maintenanceWindow.test.ts +++ b/server/test/unit/utils/maintenanceWindow.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "@jest/globals"; import { isWindowActive } from "../../../src/utils/maintenanceWindow.ts"; -import type { MaintenanceWindow } from "../../../src/types/index.ts"; +import type { MaintenanceWindow } from "../../../src/domain/maintenance-windows/maintenance-window.type.ts"; const makeWindow = (overrides?: Partial): MaintenanceWindow => { const now = Date.now(); diff --git a/server/test/unit/validation/maintenanceWindowValidation.test.ts b/server/test/unit/validation/maintenanceWindowValidation.test.ts index a209ba64f..d77fabd2c 100644 --- a/server/test/unit/validation/maintenanceWindowValidation.test.ts +++ b/server/test/unit/validation/maintenanceWindowValidation.test.ts @@ -2,7 +2,7 @@ import { describe, expect, it, jest, afterEach } from "@jest/globals"; import { createMaintenanceWindowBodyValidation, editMaintenanceByIdWindowBodyValidation, -} from "../../../src/validation/maintenanceWindowValidation.ts"; +} from "../../../src/api/validation/maintenanceWindowValidation.ts"; const FROZEN_NOW = new Date("2026-05-07T12:00:00Z").getTime(); diff --git a/server/test/unit/validation/monitorValidation.test.ts b/server/test/unit/validation/monitorValidation.test.ts index 04cf2537e..c08b8be84 100644 --- a/server/test/unit/validation/monitorValidation.test.ts +++ b/server/test/unit/validation/monitorValidation.test.ts @@ -1,5 +1,9 @@ import { describe, expect, it } from "@jest/globals"; -import { createMonitorBodyValidation, editMonitorBodyValidation, importMonitorsBodyValidation } from "../../../src/validation/monitorValidation.ts"; +import { + createMonitorBodyValidation, + editMonitorBodyValidation, + importMonitorsBodyValidation, +} from "../../../src/api/validation/monitorValidation.ts"; const baseDnsBody = { name: "DNS check", diff --git a/server/test/unit/validation/userValidation.test.ts b/server/test/unit/validation/userValidation.test.ts index 2e263d1a9..c50a70caa 100644 --- a/server/test/unit/validation/userValidation.test.ts +++ b/server/test/unit/validation/userValidation.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "@jest/globals"; -import { editUserBodyValidation } from "../../../src/validation/userValidation.ts"; +import { editUserBodyValidation } from "../../../src/api/validation/userValidation.ts"; const validPassword = "OldPass1!"; const validNewPassword = "NewPass1!";