From ddcb7e76a3b241a5778c675f435af6672e64f76d Mon Sep 17 00:00:00 2001 From: Blake Matthes Date: Wed, 25 Mar 2026 06:56:19 -0500 Subject: [PATCH] fixed imports on several files --- .gitignore | 3 +++ .vscode/settings.json | 2 ++ backend/notification/notification.controller.ts | 8 ++++---- backend/notification/notification.reprintLabels.ts | 4 ++++ backend/notification/notification.route.ts | 5 +++-- backend/notification/notification.update.route.ts | 2 +- .../notification/notificationSub.delete.route.ts | 13 +++---------- backend/notification/notificationSub.get.route.ts | 4 ++-- backend/notification/notificationSub.post.route.ts | 2 +- .../notification/notificationSub.update.route.ts | 2 +- backend/notification/notifications.master.ts | 8 ++++---- backend/routeHandler.routes.ts | 3 ++- backend/server.ts | 4 ++-- brunoApi/notifications/subscriptions.bru | 8 -------- brunoApi/notifications/update notification.bru | 4 ++-- tsconfig.json | 5 ++--- 16 files changed, 36 insertions(+), 41 deletions(-) diff --git a/.gitignore b/.gitignore index 04eab77..aa77468 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,9 @@ builds temp .scriptCreds node-v24.14.0-x64.msi +postgresql-17.9-2-windows-x64.exe +VSCodeUserSetup-x64-1.112.0.exe + # Logs logs *.log diff --git a/.vscode/settings.json b/.vscode/settings.json index 9ab1bc3..9a28b80 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,6 +3,8 @@ "workbench.colorTheme": "Default Dark+", "terminal.integrated.env.windows": {}, "editor.formatOnSave": true, + "typescript.preferences.importModuleSpecifier": "relative", + "javascript.preferences.importModuleSpecifier": "relative", "editor.codeActionsOnSave": { "source.fixAll.biome": "explicit", "source.organizeImports.biome": "explicit" diff --git a/backend/notification/notification.controller.ts b/backend/notification/notification.controller.ts index 21df735..01a19ba 100644 --- a/backend/notification/notification.controller.ts +++ b/backend/notification/notification.controller.ts @@ -1,10 +1,10 @@ -import { notificationSub } from "db/schema/notifications.sub.schema.js"; import { eq } from "drizzle-orm"; -import { createLogger } from "logger/logger.controller.js"; -import { minutesToCron } from "utils/croner.minConvert.js"; -import { createCronJob, stopCronJob } from "utils/croner.utils.js"; import { db } from "../db/db.controller.js"; import { notifications } from "../db/schema/notifications.schema.js"; +import { notificationSub } from "../db/schema/notifications.sub.schema.js"; +import { createLogger } from "../logger/logger.controller.js"; +import { minutesToCron } from "../utils/croner.minConvert.js"; +import { createCronJob, stopCronJob } from "../utils/croner.utils.js"; import { tryCatch } from "../utils/trycatch.utils.js"; const log = createLogger({ module: "notifications", subModule: "start" }); diff --git a/backend/notification/notification.reprintLabels.ts b/backend/notification/notification.reprintLabels.ts index c40dd26..930e092 100644 --- a/backend/notification/notification.reprintLabels.ts +++ b/backend/notification/notification.reprintLabels.ts @@ -1,6 +1,10 @@ const reprint = (data: any, emails: string) => { + // TODO: do the actual logic for the notification. console.log(data); console.log(emails); + + // TODO send the error to systemAdmin users so they do not always need to be on the notifications. + // these errors are defined per notification. }; export default reprint; diff --git a/backend/notification/notification.route.ts b/backend/notification/notification.route.ts index c22bd79..c844f88 100644 --- a/backend/notification/notification.route.ts +++ b/backend/notification/notification.route.ts @@ -1,8 +1,9 @@ -import { notifications } from "db/schema/notifications.schema.js"; import { eq } from "drizzle-orm"; import { type Response, Router } from "express"; -import { auth } from "utils/auth.utils.js"; + import { db } from "../db/db.controller.js"; +import { notifications } from "../db/schema/notifications.schema.js"; +import { auth } from "../utils/auth.utils.js"; import { apiReturn } from "../utils/returnHelper.utils.js"; import { tryCatch } from "../utils/trycatch.utils.js"; diff --git a/backend/notification/notification.update.route.ts b/backend/notification/notification.update.route.ts index 7d70daa..91c0662 100644 --- a/backend/notification/notification.update.route.ts +++ b/backend/notification/notification.update.route.ts @@ -1,8 +1,8 @@ -import { notifications } from "db/schema/notifications.schema.js"; import { eq } from "drizzle-orm"; import { type Response, Router } from "express"; import z from "zod"; import { db } from "../db/db.controller.js"; +import { notifications } from "../db/schema/notifications.schema.js"; import { requirePermission } from "../middleware/auth.requiredPerms.middleware.js"; import { apiReturn } from "../utils/returnHelper.utils.js"; import { tryCatch } from "../utils/trycatch.utils.js"; diff --git a/backend/notification/notificationSub.delete.route.ts b/backend/notification/notificationSub.delete.route.ts index 8e230c9..6ce9821 100644 --- a/backend/notification/notificationSub.delete.route.ts +++ b/backend/notification/notificationSub.delete.route.ts @@ -1,23 +1,16 @@ -import { notificationSub } from "db/schema/notifications.sub.schema.js"; import { and, eq } from "drizzle-orm"; import { type Response, Router } from "express"; import z from "zod"; import { db } from "../db/db.controller.js"; +import { notificationSub } from "../db/schema/notifications.sub.schema.js"; import { apiReturn } from "../utils/returnHelper.utils.js"; import { tryCatch } from "../utils/trycatch.utils.js"; import { modifiedNotification } from "./notification.controller.js"; const newSubscribe = z.object({ - emails: z - .email() - .array() - - .describe("An array of emails"), + emails: z.email().array().describe("An array of emails"), userId: z.string().describe("User id."), - notificationId: z - .string() - - .describe("Notification id"), + notificationId: z.string().describe("Notification id"), }); const r = Router(); diff --git a/backend/notification/notificationSub.get.route.ts b/backend/notification/notificationSub.get.route.ts index e6889e4..e2c65cd 100644 --- a/backend/notification/notificationSub.get.route.ts +++ b/backend/notification/notificationSub.get.route.ts @@ -1,8 +1,8 @@ -import { notificationSub } from "db/schema/notifications.sub.schema.js"; import { eq } from "drizzle-orm"; import { type Response, Router } from "express"; -import { auth } from "utils/auth.utils.js"; import { db } from "../db/db.controller.js"; +import { notificationSub } from "../db/schema/notifications.sub.schema.js"; +import { auth } from "../utils/auth.utils.js"; import { apiReturn } from "../utils/returnHelper.utils.js"; import { tryCatch } from "../utils/trycatch.utils.js"; diff --git a/backend/notification/notificationSub.post.route.ts b/backend/notification/notificationSub.post.route.ts index 2d98816..b0f43a0 100644 --- a/backend/notification/notificationSub.post.route.ts +++ b/backend/notification/notificationSub.post.route.ts @@ -1,7 +1,7 @@ -import { notificationSub } from "db/schema/notifications.sub.schema.js"; import { type Response, Router } from "express"; import z from "zod"; import { db } from "../db/db.controller.js"; +import { notificationSub } from "../db/schema/notifications.sub.schema.js"; import { apiReturn } from "../utils/returnHelper.utils.js"; import { tryCatch } from "../utils/trycatch.utils.js"; import { modifiedNotification } from "./notification.controller.js"; diff --git a/backend/notification/notificationSub.update.route.ts b/backend/notification/notificationSub.update.route.ts index 804bf52..d7525cc 100644 --- a/backend/notification/notificationSub.update.route.ts +++ b/backend/notification/notificationSub.update.route.ts @@ -1,8 +1,8 @@ -import { notificationSub } from "db/schema/notifications.sub.schema.js"; import { and, eq } from "drizzle-orm"; import { type Response, Router } from "express"; import z from "zod"; import { db } from "../db/db.controller.js"; +import { notificationSub } from "../db/schema/notifications.sub.schema.js"; import { apiReturn } from "../utils/returnHelper.utils.js"; import { tryCatch } from "../utils/trycatch.utils.js"; import { modifiedNotification } from "./notification.controller.js"; diff --git a/backend/notification/notifications.master.ts b/backend/notification/notifications.master.ts index 7788849..4590417 100644 --- a/backend/notification/notifications.master.ts +++ b/backend/notification/notifications.master.ts @@ -1,11 +1,11 @@ -import { db } from "db/db.controller.js"; +import { sql } from "drizzle-orm"; +import { db } from "../db/db.controller.js"; import { type NewNotification, notifications, -} from "db/schema/notifications.schema.js"; -import { sql } from "drizzle-orm"; -import { tryCatch } from "utils/trycatch.utils.js"; +} from "../db/schema/notifications.schema.js"; import { createLogger } from "../logger/logger.controller.js"; +import { tryCatch } from "../utils/trycatch.utils.js"; const note: NewNotification[] = [ { diff --git a/backend/routeHandler.routes.ts b/backend/routeHandler.routes.ts index c4f4387..047830f 100644 --- a/backend/routeHandler.routes.ts +++ b/backend/routeHandler.routes.ts @@ -1,9 +1,10 @@ import type { Express } from "express"; -import { setupNotificationRoutes } from "notification/notification.routes.js"; + import { setupAuthRoutes } from "./auth/auth.routes.js"; // import the routes and route setups import { setupApiDocsRoutes } from "./configs/scaler.config.js"; import { setupDatamartRoutes } from "./datamart/datamart.routes.js"; +import { setupNotificationRoutes } from "./notification/notification.routes.js"; import { setupOpendockRoutes } from "./opendock/opendock.routes.js"; import { setupProdSqlRoutes } from "./prodSql/prodSql.routes.js"; import { setupSystemRoutes } from "./system/system.routes.js"; diff --git a/backend/server.ts b/backend/server.ts index beb7769..9985524 100644 --- a/backend/server.ts +++ b/backend/server.ts @@ -1,12 +1,12 @@ import { createServer } from "node:http"; import os from "node:os"; -import { startNotifications } from "notification/notification.controller.js"; -import { createNotifications } from "notification/notifications.master.js"; import createApp from "./app.js"; import { db } from "./db/db.controller.js"; import { dbCleanup } from "./db/dbCleanup.controller.js"; import { type Setting, settings } from "./db/schema/settings.schema.js"; import { createLogger } from "./logger/logger.controller.js"; +import { startNotifications } from "./notification/notification.controller.js"; +import { createNotifications } from "./notification/notifications.master.js"; import { monitorReleaseChanges } from "./opendock/openDockRreleaseMonitor.utils.js"; import { opendockSocketMonitor } from "./opendock/opendockSocketMonitor.utils.js"; import { connectProdSql } from "./prodSql/prodSqlConnection.controller.js"; diff --git a/brunoApi/notifications/subscriptions.bru b/brunoApi/notifications/subscriptions.bru index 2f6153c..30d336d 100644 --- a/brunoApi/notifications/subscriptions.bru +++ b/brunoApi/notifications/subscriptions.bru @@ -10,14 +10,6 @@ get { auth: inherit } -body:json { - { - "userId":"0kHd6Kkdub4GW6rK1qa1yjWwqXtvykqT", - "notificationId": "0399eb2a-39df-48b7-9f1c-d233cec94d2e", - "emails": ["blake.mattes@alpla.com"] - } -} - settings { encodeUrl: true timeout: 0 diff --git a/brunoApi/notifications/update notification.bru b/brunoApi/notifications/update notification.bru index 98b1f02..761c7cc 100644 --- a/brunoApi/notifications/update notification.bru +++ b/brunoApi/notifications/update notification.bru @@ -16,8 +16,8 @@ params:path { body:json { { - "active" : false, - "options": [{"prodId": 5}] + "active" : true, + "options": [] } } diff --git a/tsconfig.json b/tsconfig.json index a18c4ca..db8c4aa 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,7 +18,7 @@ "exactOptionalPropertyTypes": true, "baseUrl": "./backend", "paths": { - "@/*": ["src/*"] + "@/*": ["*"] }, "esModuleInterop": true, "skipLibCheck": true, @@ -27,8 +27,7 @@ //"allowImportingTsExtensions": true, "noEmit": false }, - "include": ["backend/**/*" -], + "include": ["backend/**/*"], "exclude": [ "node_modules", "frontend",