From 9d9a2683fada6143b96b1d0f92b53a56879f1d45 Mon Sep 17 00:00:00 2001 From: Blake Matthes Date: Thu, 15 May 2025 20:55:17 -0500 Subject: [PATCH] feat(apihits): so i can see if what end points are being used and when and how often --- .../migrations/0053_short_colleen_wing.sql | 11 + database/migrations/0054_careless_ultron.sql | 1 + .../migrations/0055_sudden_frank_castle.sql | 1 + database/migrations/0056_breezy_inertia.sql | 1 + .../0057_orange_lady_deathstrike.sql | 1 + database/migrations/0058_cultured_argent.sql | 1 + database/migrations/0059_calm_energizer.sql | 1 + database/migrations/0060_daffy_overlord.sql | 1 + database/migrations/meta/0053_snapshot.json | 1844 ++++++++++++++++ database/migrations/meta/0054_snapshot.json | 1851 ++++++++++++++++ database/migrations/meta/0055_snapshot.json | 1851 ++++++++++++++++ database/migrations/meta/0056_snapshot.json | 1845 ++++++++++++++++ database/migrations/meta/0057_snapshot.json | 1851 ++++++++++++++++ database/migrations/meta/0058_snapshot.json | 1852 +++++++++++++++++ database/migrations/meta/0059_snapshot.json | 1846 ++++++++++++++++ database/migrations/meta/0060_snapshot.json | 1852 +++++++++++++++++ database/migrations/meta/_journal.json | 56 + database/schema/apiHits.ts | 27 +- server/globalUtils/apiHits.ts | 49 +- server/services/dataMart/route/fakeEDI.ts | 3 +- .../dataMart/route/getActiveArticles.ts | 2 +- .../dataMart/route/getCurrentQuerys.ts | 3 +- .../services/dataMart/route/getCustomerInv.ts | 3 +- .../dataMart/route/getDeliveryDateByRange.ts | 3 +- .../services/dataMart/route/getInventory.ts | 3 +- .../services/dataMart/route/getOpenOrders.ts | 3 +- server/services/eom/route/invHistory.ts | 2 +- server/services/eom/route/stats.ts | 2 +- .../logistics/route/consumeMaterial.ts | 17 +- .../logistics/route/dm/bulkOrdersIn.ts | 3 +- .../services/logistics/route/dm/forecastIn.ts | 3 +- .../route/dm/getStandardForecastTemplate.ts | 3 +- .../logistics/route/dm/getStandardTemplate.ts | 3 +- .../logistics/route/getCycleCountChecks.ts | 3 +- .../logistics/route/getCycleCountLanes.ts | 3 +- .../services/logistics/route/getOutbound.ts | 3 +- server/services/logistics/route/getPPOO.ts | 3 +- .../logistics/route/returnMaterial.ts | 17 +- .../siloAdjustments/createSiloAdjustment.ts | 17 +- .../siloAdjustments/getSiloAdjustments.ts | 2 + .../route/siloAdjustments/getStockData.ts | 3 +- .../route/siloAdjustments/postComment.ts | 3 +- .../routes/getActiveNotifications.ts | 2 + .../notifications/routes/getNotifications.ts | 3 +- .../notifications/routes/manualTiggerTi.ts | 2 + .../notifications/routes/qualityBlocking.ts | 3 +- .../services/notifications/routes/sendMail.ts | 2 + server/services/ocme/route/cycleCount.ts | 3 +- server/services/ocme/route/getInfo.ts | 2 +- .../services/ocme/route/getShipmentPallets.ts | 194 +- server/services/ocme/route/pickedUp.ts | 199 +- .../services/ocme/route/postRunningNumber.ts | 2 +- server/services/ocme/route/postSSCC.ts | 183 +- server/services/ocme/route/triggerCamera.ts | 2 +- server/services/ocp/routes/labeling/bookIn.ts | 2 + .../services/ocp/routes/labeling/getLabels.ts | 2 + .../ocp/routes/labeling/manualPrint.ts | 2 + .../ocp/routes/labeling/manualPrintLog.ts | 2 +- server/services/ocp/routes/lots/getLots.ts | 3 +- .../ocp/routes/printers/autoLabelerStart.ts | 2 + .../ocp/routes/printers/autoLabelerStop.ts | 2 + .../ocp/routes/printers/getPritners.ts | 2 + .../ocp/routes/printers/startCycle.ts | 2 + .../services/ocp/routes/printers/stopCycle.ts | 2 + .../ocp/routes/printers/updatePrinters.ts | 2 + .../specialProcesses/dyco/closeConnection.ts | 3 +- .../specialProcesses/dyco/connection.ts | 4 +- server/services/quality/route/getRequest.ts | 3 +- .../services/quality/route/postNewRequest.ts | 3 +- server/services/rfid/route/addReader.ts | 39 +- server/services/rfid/route/manualTagEnter.ts | 36 +- server/services/rfid/route/manualTagRead.ts | 37 +- server/services/rfid/route/mgtEvents.ts | 3 +- server/services/rfid/route/tagInfo.ts | 3 +- server/services/rfid/route/updateReader.ts | 41 +- .../server/route/modules/addModule.ts | 68 +- .../server/route/modules/getModules.ts | 2 + .../server/route/modules/getSubModules.ts | 2 + .../server/route/modules/updateModules.ts | 88 +- .../server/route/modules/updateSubModules.ts | 6 + .../server/route/servers/getServers.ts | 37 +- .../server/route/servers/serverContorl.ts | 3 +- .../server/route/settings/addSetting.ts | 43 +- .../server/route/settings/getSettings.ts | 46 +- .../server/route/settings/updateSetting.ts | 67 +- .../server/route/updates/updateServer.ts | 3 +- 86 files changed, 15710 insertions(+), 496 deletions(-) create mode 100644 database/migrations/0053_short_colleen_wing.sql create mode 100644 database/migrations/0054_careless_ultron.sql create mode 100644 database/migrations/0055_sudden_frank_castle.sql create mode 100644 database/migrations/0056_breezy_inertia.sql create mode 100644 database/migrations/0057_orange_lady_deathstrike.sql create mode 100644 database/migrations/0058_cultured_argent.sql create mode 100644 database/migrations/0059_calm_energizer.sql create mode 100644 database/migrations/0060_daffy_overlord.sql create mode 100644 database/migrations/meta/0053_snapshot.json create mode 100644 database/migrations/meta/0054_snapshot.json create mode 100644 database/migrations/meta/0055_snapshot.json create mode 100644 database/migrations/meta/0056_snapshot.json create mode 100644 database/migrations/meta/0057_snapshot.json create mode 100644 database/migrations/meta/0058_snapshot.json create mode 100644 database/migrations/meta/0059_snapshot.json create mode 100644 database/migrations/meta/0060_snapshot.json diff --git a/database/migrations/0053_short_colleen_wing.sql b/database/migrations/0053_short_colleen_wing.sql new file mode 100644 index 0000000..436557a --- /dev/null +++ b/database/migrations/0053_short_colleen_wing.sql @@ -0,0 +1,11 @@ +CREATE TABLE "apiHits" ( + "ip" text, + "endpoint" text, + "action" text, + "lastBody" text, + "stats" text, + "add_date" timestamp DEFAULT now(), + "upd_date" timestamp DEFAULT now() +); +--> statement-breakpoint +CREATE UNIQUE INDEX "endpoint" ON "apiHits" USING btree ("endpoint","ip"); \ No newline at end of file diff --git a/database/migrations/0054_careless_ultron.sql b/database/migrations/0054_careless_ultron.sql new file mode 100644 index 0000000..1deb7e1 --- /dev/null +++ b/database/migrations/0054_careless_ultron.sql @@ -0,0 +1 @@ +ALTER TABLE "apiHits" ADD COLUMN "apiHit_id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL; \ No newline at end of file diff --git a/database/migrations/0055_sudden_frank_castle.sql b/database/migrations/0055_sudden_frank_castle.sql new file mode 100644 index 0000000..1206c82 --- /dev/null +++ b/database/migrations/0055_sudden_frank_castle.sql @@ -0,0 +1 @@ +ALTER TABLE "apiHits" ALTER COLUMN "stats" SET DATA TYPE integer; \ No newline at end of file diff --git a/database/migrations/0056_breezy_inertia.sql b/database/migrations/0056_breezy_inertia.sql new file mode 100644 index 0000000..97d06ca --- /dev/null +++ b/database/migrations/0056_breezy_inertia.sql @@ -0,0 +1 @@ +ALTER TABLE "apiHits" DROP COLUMN "stats"; \ No newline at end of file diff --git a/database/migrations/0057_orange_lady_deathstrike.sql b/database/migrations/0057_orange_lady_deathstrike.sql new file mode 100644 index 0000000..5fefb75 --- /dev/null +++ b/database/migrations/0057_orange_lady_deathstrike.sql @@ -0,0 +1 @@ +ALTER TABLE "apiHits" ADD COLUMN "stats" integer; \ No newline at end of file diff --git a/database/migrations/0058_cultured_argent.sql b/database/migrations/0058_cultured_argent.sql new file mode 100644 index 0000000..d234a84 --- /dev/null +++ b/database/migrations/0058_cultured_argent.sql @@ -0,0 +1 @@ +ALTER TABLE "apiHits" ALTER COLUMN "stats" SET DEFAULT 1; \ No newline at end of file diff --git a/database/migrations/0059_calm_energizer.sql b/database/migrations/0059_calm_energizer.sql new file mode 100644 index 0000000..8bb3f1d --- /dev/null +++ b/database/migrations/0059_calm_energizer.sql @@ -0,0 +1 @@ +ALTER TABLE "apiHits" DROP COLUMN "lastBody"; \ No newline at end of file diff --git a/database/migrations/0060_daffy_overlord.sql b/database/migrations/0060_daffy_overlord.sql new file mode 100644 index 0000000..65f8a7b --- /dev/null +++ b/database/migrations/0060_daffy_overlord.sql @@ -0,0 +1 @@ +ALTER TABLE "apiHits" ADD COLUMN "lastBody" jsonb; \ No newline at end of file diff --git a/database/migrations/meta/0053_snapshot.json b/database/migrations/meta/0053_snapshot.json new file mode 100644 index 0000000..df51fac --- /dev/null +++ b/database/migrations/meta/0053_snapshot.json @@ -0,0 +1,1844 @@ +{ + "id": "3fc5d0af-4ce9-4769-a2cd-1a2e76d8411f", + "prevId": "bc74a802-eaf2-434f-aafb-2aefa5f97121", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.apiHits": { + "name": "apiHits", + "schema": "", + "columns": { + "ip": { + "name": "ip", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "endpoint": { + "name": "endpoint", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "action": { + "name": "action", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastBody": { + "name": "lastBody", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "stats": { + "name": "stats", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "endpoint": { + "name": "endpoint", + "columns": [ + { + "expression": "endpoint", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "ip", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.logs": { + "name": "logs", + "schema": "", + "columns": { + "log_id": { + "name": "log_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "level": { + "name": "level", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST_Serivce'" + }, + "service": { + "name": "service", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'system'" + }, + "message": { + "name": "message", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "checked": { + "name": "checked", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.modules": { + "name": "modules", + "schema": "", + "columns": { + "module_id": { + "name": "module_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "roles": { + "name": "roles", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[\"view\",\"systemAdmin\"]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "module_name": { + "name": "module_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.notifications": { + "name": "notifications", + "schema": "", + "columns": { + "notify_id": { + "name": "notify_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "checkInterval": { + "name": "checkInterval", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'1'" + }, + "timeType": { + "name": "timeType", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'hour'" + }, + "emails": { + "name": "emails", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "lastRan": { + "name": "lastRan", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "notifiySettings": { + "name": "notifiySettings", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'{}'::jsonb" + } + }, + "indexes": { + "notify_name": { + "name": "notify_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ocmeData": { + "name": "ocmeData", + "schema": "", + "columns": { + "ocme_id": { + "name": "ocme_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "sscc": { + "name": "sscc", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "runningNr": { + "name": "runningNr", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "completed": { + "name": "completed", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "lineNum": { + "name": "lineNum", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "pickedUp": { + "name": "pickedUp", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "areaFrom": { + "name": "areaFrom", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "ocme_runningNr": { + "name": "ocme_runningNr", + "columns": [ + { + "expression": "runningNr", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ocmeCycleCounts": { + "name": "ocmeCycleCounts", + "schema": "", + "columns": { + "ocme_id": { + "name": "ocme_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "laneId": { + "name": "laneId", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "warehouseName": { + "name": "warehouseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "laneName": { + "name": "laneName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "good": { + "name": "good", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "cycleCount": { + "name": "cycleCount", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.manualPrinting": { + "name": "manualPrinting", + "schema": "", + "columns": { + "print_id": { + "name": "print_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "line": { + "name": "line", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "printReason": { + "name": "printReason", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "initials": { + "name": "initials", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "additionalComments": { + "name": "additionalComments", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.printerData": { + "name": "printerData", + "schema": "", + "columns": { + "printer_id": { + "name": "printer_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "humanReadableId": { + "name": "humanReadableId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "ipAddress": { + "name": "ipAddress", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "port": { + "name": "port", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "statusText": { + "name": "statusText", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastTimePrinted": { + "name": "lastTimePrinted", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "assigned": { + "name": "assigned", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "remark": { + "name": "remark", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "printDelay": { + "name": "printDelay", + "type": "numeric", + "primaryKey": false, + "notNull": false, + "default": "'90'" + }, + "monitorState": { + "name": "monitorState", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "humanReadableId": { + "name": "humanReadableId", + "columns": [ + { + "expression": "humanReadableId", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.prodlabels": { + "name": "prodlabels", + "schema": "", + "columns": { + "label_id": { + "name": "label_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "printerID": { + "name": "printerID", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "printerName": { + "name": "printerName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "line": { + "name": "line", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "runningNr": { + "name": "runningNr", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'lst'" + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "runningNr": { + "name": "runningNr", + "columns": [ + { + "expression": "runningNr", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.qualityRequest": { + "name": "qualityRequest", + "schema": "", + "columns": { + "request_id": { + "name": "request_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "article": { + "name": "article", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "runningNr": { + "name": "runningNr", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lotNr": { + "name": "lotNr", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "warehouseAtRequest": { + "name": "warehouseAtRequest", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "locationAtRequest": { + "name": "locationAtRequest", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "warehouseMovedTo": { + "name": "warehouseMovedTo", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "locationMovedTo": { + "name": "locationMovedTo", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "durationToMove": { + "name": "durationToMove", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "locationDropOff": { + "name": "locationDropOff", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "palletStatus": { + "name": "palletStatus", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "palletStatusText": { + "name": "palletStatusText", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "palletRequest": { + "name": "palletRequest", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_user": { + "name": "upd_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST'" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.rfidReaders": { + "name": "rfidReaders", + "schema": "", + "columns": { + "rfidReader_id": { + "name": "rfidReader_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "reader": { + "name": "reader", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "readerIP": { + "name": "readerIP", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastHeartBeat": { + "name": "lastHeartBeat", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "lastTrigger": { + "name": "lastTrigger", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "lastTiggerGood": { + "name": "lastTiggerGood", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "lastTagScanned": { + "name": "lastTagScanned", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "reader": { + "name": "reader", + "columns": [ + { + "expression": "reader", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.rfidTags": { + "name": "rfidTags", + "schema": "", + "columns": { + "rfidTag_id": { + "name": "rfidTag_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "tagHex": { + "name": "tagHex", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tag": { + "name": "tag", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "timeStamp": { + "name": "timeStamp", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "counts": { + "name": "counts", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "lastareaIn": { + "name": "lastareaIn", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "runningNumber": { + "name": "runningNumber", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "antenna": { + "name": "antenna", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "tagStrength": { + "name": "tagStrength", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "tagHex": { + "name": "tagHex", + "columns": [ + { + "expression": "tagHex", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.roles": { + "name": "roles", + "schema": "", + "columns": { + "role_id": { + "name": "role_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "role_name": { + "name": "role_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.serverData": { + "name": "serverData", + "schema": "", + "columns": { + "server_id": { + "name": "server_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "sName": { + "name": "sName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "serverDNS": { + "name": "serverDNS", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "plantToken": { + "name": "plantToken", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "idAddress": { + "name": "idAddress", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "greatPlainsPlantCode": { + "name": "greatPlainsPlantCode", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "streetAddress": { + "name": "streetAddress", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cityState": { + "name": "cityState", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "zipcode": { + "name": "zipcode", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "contactEmail": { + "name": "contactEmail", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "contactPhone": { + "name": "contactPhone", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customerTiAcc": { + "name": "customerTiAcc", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lstServerPort": { + "name": "lstServerPort", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "serverLoc": { + "name": "serverLoc", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "oldVersion": { + "name": "oldVersion", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastUpdated": { + "name": "lastUpdated", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "shippingHours": { + "name": "shippingHours", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'[{\"early\": \"06:30\", \"late\": \"23:00\"}]'" + }, + "tiPostTime": { + "name": "tiPostTime", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'[{\"from\": \"24\", \"to\": \"24\"}]'" + }, + "otherSettings": { + "name": "otherSettings", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[{\"specialInstructions\":\"something for ti\",\"active\":false}]'::jsonb" + }, + "isUpgrading": { + "name": "isUpgrading", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + } + }, + "indexes": { + "plantToken": { + "name": "plantToken", + "columns": [ + { + "expression": "plantToken", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.settings": { + "name": "settings", + "schema": "", + "columns": { + "role_id": { + "name": "role_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "moduleName": { + "name": "moduleName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roles": { + "name": "roles", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[\"systemAdmin\"]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "name": { + "name": "name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.siloAdjustments": { + "name": "siloAdjustments", + "schema": "", + "columns": { + "siloAdjust_id": { + "name": "siloAdjust_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "level": { + "name": "level", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "locationID": { + "name": "locationID", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "currentStockLevel": { + "name": "currentStockLevel", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "newLevel": { + "name": "newLevel", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "comment": { + "name": "comment", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "''" + }, + "dateAdjusted": { + "name": "dateAdjusted", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "lastDateAdjusted": { + "name": "lastDateAdjusted", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "commentAddedBy": { + "name": "commentAddedBy", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "commentDate": { + "name": "commentDate", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "commentKey": { + "name": "commentKey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST_Serivce'" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.subModules": { + "name": "subModules", + "schema": "", + "columns": { + "submodule_id": { + "name": "submodule_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "moduleName": { + "name": "moduleName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "link": { + "name": "link", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "roles": { + "name": "roles", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[\"systemAdmin\"]'::jsonb" + }, + "icon": { + "name": "icon", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "subSubModule": { + "name": "subSubModule", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "subModule_name": { + "name": "subModule_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.userRoles": { + "name": "userRoles", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "role_id": { + "name": "role_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "module_id": { + "name": "module_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "user_module_unique": { + "name": "user_module_unique", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "module_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "userRoles_user_id_users_user_id_fk": { + "name": "userRoles_user_id_users_user_id_fk", + "tableFrom": "userRoles", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "user_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "userRoles_role_id_roles_role_id_fk": { + "name": "userRoles_role_id_roles_role_id_fk", + "tableFrom": "userRoles", + "tableTo": "roles", + "columnsFrom": [ + "role_id" + ], + "columnsTo": [ + "role_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "userRoles_module_id_modules_module_id_fk": { + "name": "userRoles_module_id_modules_module_id_fk", + "tableFrom": "userRoles", + "tableTo": "modules", + "columnsFrom": [ + "module_id" + ], + "columnsTo": [ + "module_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.users": { + "name": "users", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "passwordToken": { + "name": "passwordToken", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "passwordTokenExpires": { + "name": "passwordTokenExpires", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "pingcode": { + "name": "pingcode", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'user'" + }, + "lastLogin": { + "name": "lastLogin", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "username": { + "name": "username", + "columns": [ + { + "expression": "username", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": {}, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/database/migrations/meta/0054_snapshot.json b/database/migrations/meta/0054_snapshot.json new file mode 100644 index 0000000..a910d07 --- /dev/null +++ b/database/migrations/meta/0054_snapshot.json @@ -0,0 +1,1851 @@ +{ + "id": "500fa5e3-43d1-4c93-ad39-d04d4b375733", + "prevId": "3fc5d0af-4ce9-4769-a2cd-1a2e76d8411f", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.apiHits": { + "name": "apiHits", + "schema": "", + "columns": { + "apiHit_id": { + "name": "apiHit_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "ip": { + "name": "ip", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "endpoint": { + "name": "endpoint", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "action": { + "name": "action", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastBody": { + "name": "lastBody", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "stats": { + "name": "stats", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "endpoint": { + "name": "endpoint", + "columns": [ + { + "expression": "endpoint", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "ip", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.logs": { + "name": "logs", + "schema": "", + "columns": { + "log_id": { + "name": "log_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "level": { + "name": "level", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST_Serivce'" + }, + "service": { + "name": "service", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'system'" + }, + "message": { + "name": "message", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "checked": { + "name": "checked", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.modules": { + "name": "modules", + "schema": "", + "columns": { + "module_id": { + "name": "module_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "roles": { + "name": "roles", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[\"view\",\"systemAdmin\"]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "module_name": { + "name": "module_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.notifications": { + "name": "notifications", + "schema": "", + "columns": { + "notify_id": { + "name": "notify_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "checkInterval": { + "name": "checkInterval", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'1'" + }, + "timeType": { + "name": "timeType", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'hour'" + }, + "emails": { + "name": "emails", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "lastRan": { + "name": "lastRan", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "notifiySettings": { + "name": "notifiySettings", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'{}'::jsonb" + } + }, + "indexes": { + "notify_name": { + "name": "notify_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ocmeData": { + "name": "ocmeData", + "schema": "", + "columns": { + "ocme_id": { + "name": "ocme_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "sscc": { + "name": "sscc", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "runningNr": { + "name": "runningNr", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "completed": { + "name": "completed", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "lineNum": { + "name": "lineNum", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "pickedUp": { + "name": "pickedUp", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "areaFrom": { + "name": "areaFrom", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "ocme_runningNr": { + "name": "ocme_runningNr", + "columns": [ + { + "expression": "runningNr", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ocmeCycleCounts": { + "name": "ocmeCycleCounts", + "schema": "", + "columns": { + "ocme_id": { + "name": "ocme_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "laneId": { + "name": "laneId", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "warehouseName": { + "name": "warehouseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "laneName": { + "name": "laneName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "good": { + "name": "good", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "cycleCount": { + "name": "cycleCount", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.manualPrinting": { + "name": "manualPrinting", + "schema": "", + "columns": { + "print_id": { + "name": "print_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "line": { + "name": "line", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "printReason": { + "name": "printReason", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "initials": { + "name": "initials", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "additionalComments": { + "name": "additionalComments", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.printerData": { + "name": "printerData", + "schema": "", + "columns": { + "printer_id": { + "name": "printer_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "humanReadableId": { + "name": "humanReadableId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "ipAddress": { + "name": "ipAddress", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "port": { + "name": "port", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "statusText": { + "name": "statusText", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastTimePrinted": { + "name": "lastTimePrinted", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "assigned": { + "name": "assigned", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "remark": { + "name": "remark", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "printDelay": { + "name": "printDelay", + "type": "numeric", + "primaryKey": false, + "notNull": false, + "default": "'90'" + }, + "monitorState": { + "name": "monitorState", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "humanReadableId": { + "name": "humanReadableId", + "columns": [ + { + "expression": "humanReadableId", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.prodlabels": { + "name": "prodlabels", + "schema": "", + "columns": { + "label_id": { + "name": "label_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "printerID": { + "name": "printerID", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "printerName": { + "name": "printerName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "line": { + "name": "line", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "runningNr": { + "name": "runningNr", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'lst'" + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "runningNr": { + "name": "runningNr", + "columns": [ + { + "expression": "runningNr", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.qualityRequest": { + "name": "qualityRequest", + "schema": "", + "columns": { + "request_id": { + "name": "request_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "article": { + "name": "article", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "runningNr": { + "name": "runningNr", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lotNr": { + "name": "lotNr", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "warehouseAtRequest": { + "name": "warehouseAtRequest", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "locationAtRequest": { + "name": "locationAtRequest", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "warehouseMovedTo": { + "name": "warehouseMovedTo", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "locationMovedTo": { + "name": "locationMovedTo", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "durationToMove": { + "name": "durationToMove", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "locationDropOff": { + "name": "locationDropOff", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "palletStatus": { + "name": "palletStatus", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "palletStatusText": { + "name": "palletStatusText", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "palletRequest": { + "name": "palletRequest", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_user": { + "name": "upd_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST'" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.rfidReaders": { + "name": "rfidReaders", + "schema": "", + "columns": { + "rfidReader_id": { + "name": "rfidReader_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "reader": { + "name": "reader", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "readerIP": { + "name": "readerIP", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastHeartBeat": { + "name": "lastHeartBeat", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "lastTrigger": { + "name": "lastTrigger", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "lastTiggerGood": { + "name": "lastTiggerGood", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "lastTagScanned": { + "name": "lastTagScanned", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "reader": { + "name": "reader", + "columns": [ + { + "expression": "reader", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.rfidTags": { + "name": "rfidTags", + "schema": "", + "columns": { + "rfidTag_id": { + "name": "rfidTag_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "tagHex": { + "name": "tagHex", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tag": { + "name": "tag", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "timeStamp": { + "name": "timeStamp", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "counts": { + "name": "counts", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "lastareaIn": { + "name": "lastareaIn", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "runningNumber": { + "name": "runningNumber", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "antenna": { + "name": "antenna", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "tagStrength": { + "name": "tagStrength", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "tagHex": { + "name": "tagHex", + "columns": [ + { + "expression": "tagHex", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.roles": { + "name": "roles", + "schema": "", + "columns": { + "role_id": { + "name": "role_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "role_name": { + "name": "role_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.serverData": { + "name": "serverData", + "schema": "", + "columns": { + "server_id": { + "name": "server_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "sName": { + "name": "sName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "serverDNS": { + "name": "serverDNS", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "plantToken": { + "name": "plantToken", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "idAddress": { + "name": "idAddress", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "greatPlainsPlantCode": { + "name": "greatPlainsPlantCode", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "streetAddress": { + "name": "streetAddress", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cityState": { + "name": "cityState", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "zipcode": { + "name": "zipcode", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "contactEmail": { + "name": "contactEmail", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "contactPhone": { + "name": "contactPhone", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customerTiAcc": { + "name": "customerTiAcc", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lstServerPort": { + "name": "lstServerPort", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "serverLoc": { + "name": "serverLoc", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "oldVersion": { + "name": "oldVersion", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastUpdated": { + "name": "lastUpdated", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "shippingHours": { + "name": "shippingHours", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'[{\"early\": \"06:30\", \"late\": \"23:00\"}]'" + }, + "tiPostTime": { + "name": "tiPostTime", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'[{\"from\": \"24\", \"to\": \"24\"}]'" + }, + "otherSettings": { + "name": "otherSettings", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[{\"specialInstructions\":\"something for ti\",\"active\":false}]'::jsonb" + }, + "isUpgrading": { + "name": "isUpgrading", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + } + }, + "indexes": { + "plantToken": { + "name": "plantToken", + "columns": [ + { + "expression": "plantToken", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.settings": { + "name": "settings", + "schema": "", + "columns": { + "role_id": { + "name": "role_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "moduleName": { + "name": "moduleName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roles": { + "name": "roles", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[\"systemAdmin\"]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "name": { + "name": "name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.siloAdjustments": { + "name": "siloAdjustments", + "schema": "", + "columns": { + "siloAdjust_id": { + "name": "siloAdjust_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "level": { + "name": "level", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "locationID": { + "name": "locationID", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "currentStockLevel": { + "name": "currentStockLevel", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "newLevel": { + "name": "newLevel", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "comment": { + "name": "comment", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "''" + }, + "dateAdjusted": { + "name": "dateAdjusted", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "lastDateAdjusted": { + "name": "lastDateAdjusted", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "commentAddedBy": { + "name": "commentAddedBy", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "commentDate": { + "name": "commentDate", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "commentKey": { + "name": "commentKey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST_Serivce'" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.subModules": { + "name": "subModules", + "schema": "", + "columns": { + "submodule_id": { + "name": "submodule_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "moduleName": { + "name": "moduleName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "link": { + "name": "link", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "roles": { + "name": "roles", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[\"systemAdmin\"]'::jsonb" + }, + "icon": { + "name": "icon", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "subSubModule": { + "name": "subSubModule", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "subModule_name": { + "name": "subModule_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.userRoles": { + "name": "userRoles", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "role_id": { + "name": "role_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "module_id": { + "name": "module_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "user_module_unique": { + "name": "user_module_unique", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "module_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "userRoles_user_id_users_user_id_fk": { + "name": "userRoles_user_id_users_user_id_fk", + "tableFrom": "userRoles", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "user_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "userRoles_role_id_roles_role_id_fk": { + "name": "userRoles_role_id_roles_role_id_fk", + "tableFrom": "userRoles", + "tableTo": "roles", + "columnsFrom": [ + "role_id" + ], + "columnsTo": [ + "role_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "userRoles_module_id_modules_module_id_fk": { + "name": "userRoles_module_id_modules_module_id_fk", + "tableFrom": "userRoles", + "tableTo": "modules", + "columnsFrom": [ + "module_id" + ], + "columnsTo": [ + "module_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.users": { + "name": "users", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "passwordToken": { + "name": "passwordToken", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "passwordTokenExpires": { + "name": "passwordTokenExpires", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "pingcode": { + "name": "pingcode", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'user'" + }, + "lastLogin": { + "name": "lastLogin", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "username": { + "name": "username", + "columns": [ + { + "expression": "username", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": {}, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/database/migrations/meta/0055_snapshot.json b/database/migrations/meta/0055_snapshot.json new file mode 100644 index 0000000..2930664 --- /dev/null +++ b/database/migrations/meta/0055_snapshot.json @@ -0,0 +1,1851 @@ +{ + "id": "4f887c67-f50f-4bbf-acf2-6fb02b7db594", + "prevId": "500fa5e3-43d1-4c93-ad39-d04d4b375733", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.apiHits": { + "name": "apiHits", + "schema": "", + "columns": { + "apiHit_id": { + "name": "apiHit_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "ip": { + "name": "ip", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "endpoint": { + "name": "endpoint", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "action": { + "name": "action", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastBody": { + "name": "lastBody", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "stats": { + "name": "stats", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "endpoint": { + "name": "endpoint", + "columns": [ + { + "expression": "endpoint", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "ip", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.logs": { + "name": "logs", + "schema": "", + "columns": { + "log_id": { + "name": "log_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "level": { + "name": "level", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST_Serivce'" + }, + "service": { + "name": "service", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'system'" + }, + "message": { + "name": "message", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "checked": { + "name": "checked", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.modules": { + "name": "modules", + "schema": "", + "columns": { + "module_id": { + "name": "module_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "roles": { + "name": "roles", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[\"view\",\"systemAdmin\"]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "module_name": { + "name": "module_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.notifications": { + "name": "notifications", + "schema": "", + "columns": { + "notify_id": { + "name": "notify_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "checkInterval": { + "name": "checkInterval", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'1'" + }, + "timeType": { + "name": "timeType", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'hour'" + }, + "emails": { + "name": "emails", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "lastRan": { + "name": "lastRan", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "notifiySettings": { + "name": "notifiySettings", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'{}'::jsonb" + } + }, + "indexes": { + "notify_name": { + "name": "notify_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ocmeData": { + "name": "ocmeData", + "schema": "", + "columns": { + "ocme_id": { + "name": "ocme_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "sscc": { + "name": "sscc", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "runningNr": { + "name": "runningNr", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "completed": { + "name": "completed", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "lineNum": { + "name": "lineNum", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "pickedUp": { + "name": "pickedUp", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "areaFrom": { + "name": "areaFrom", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "ocme_runningNr": { + "name": "ocme_runningNr", + "columns": [ + { + "expression": "runningNr", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ocmeCycleCounts": { + "name": "ocmeCycleCounts", + "schema": "", + "columns": { + "ocme_id": { + "name": "ocme_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "laneId": { + "name": "laneId", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "warehouseName": { + "name": "warehouseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "laneName": { + "name": "laneName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "good": { + "name": "good", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "cycleCount": { + "name": "cycleCount", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.manualPrinting": { + "name": "manualPrinting", + "schema": "", + "columns": { + "print_id": { + "name": "print_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "line": { + "name": "line", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "printReason": { + "name": "printReason", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "initials": { + "name": "initials", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "additionalComments": { + "name": "additionalComments", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.printerData": { + "name": "printerData", + "schema": "", + "columns": { + "printer_id": { + "name": "printer_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "humanReadableId": { + "name": "humanReadableId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "ipAddress": { + "name": "ipAddress", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "port": { + "name": "port", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "statusText": { + "name": "statusText", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastTimePrinted": { + "name": "lastTimePrinted", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "assigned": { + "name": "assigned", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "remark": { + "name": "remark", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "printDelay": { + "name": "printDelay", + "type": "numeric", + "primaryKey": false, + "notNull": false, + "default": "'90'" + }, + "monitorState": { + "name": "monitorState", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "humanReadableId": { + "name": "humanReadableId", + "columns": [ + { + "expression": "humanReadableId", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.prodlabels": { + "name": "prodlabels", + "schema": "", + "columns": { + "label_id": { + "name": "label_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "printerID": { + "name": "printerID", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "printerName": { + "name": "printerName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "line": { + "name": "line", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "runningNr": { + "name": "runningNr", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'lst'" + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "runningNr": { + "name": "runningNr", + "columns": [ + { + "expression": "runningNr", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.qualityRequest": { + "name": "qualityRequest", + "schema": "", + "columns": { + "request_id": { + "name": "request_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "article": { + "name": "article", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "runningNr": { + "name": "runningNr", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lotNr": { + "name": "lotNr", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "warehouseAtRequest": { + "name": "warehouseAtRequest", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "locationAtRequest": { + "name": "locationAtRequest", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "warehouseMovedTo": { + "name": "warehouseMovedTo", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "locationMovedTo": { + "name": "locationMovedTo", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "durationToMove": { + "name": "durationToMove", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "locationDropOff": { + "name": "locationDropOff", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "palletStatus": { + "name": "palletStatus", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "palletStatusText": { + "name": "palletStatusText", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "palletRequest": { + "name": "palletRequest", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_user": { + "name": "upd_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST'" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.rfidReaders": { + "name": "rfidReaders", + "schema": "", + "columns": { + "rfidReader_id": { + "name": "rfidReader_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "reader": { + "name": "reader", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "readerIP": { + "name": "readerIP", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastHeartBeat": { + "name": "lastHeartBeat", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "lastTrigger": { + "name": "lastTrigger", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "lastTiggerGood": { + "name": "lastTiggerGood", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "lastTagScanned": { + "name": "lastTagScanned", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "reader": { + "name": "reader", + "columns": [ + { + "expression": "reader", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.rfidTags": { + "name": "rfidTags", + "schema": "", + "columns": { + "rfidTag_id": { + "name": "rfidTag_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "tagHex": { + "name": "tagHex", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tag": { + "name": "tag", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "timeStamp": { + "name": "timeStamp", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "counts": { + "name": "counts", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "lastareaIn": { + "name": "lastareaIn", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "runningNumber": { + "name": "runningNumber", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "antenna": { + "name": "antenna", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "tagStrength": { + "name": "tagStrength", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "tagHex": { + "name": "tagHex", + "columns": [ + { + "expression": "tagHex", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.roles": { + "name": "roles", + "schema": "", + "columns": { + "role_id": { + "name": "role_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "role_name": { + "name": "role_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.serverData": { + "name": "serverData", + "schema": "", + "columns": { + "server_id": { + "name": "server_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "sName": { + "name": "sName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "serverDNS": { + "name": "serverDNS", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "plantToken": { + "name": "plantToken", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "idAddress": { + "name": "idAddress", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "greatPlainsPlantCode": { + "name": "greatPlainsPlantCode", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "streetAddress": { + "name": "streetAddress", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cityState": { + "name": "cityState", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "zipcode": { + "name": "zipcode", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "contactEmail": { + "name": "contactEmail", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "contactPhone": { + "name": "contactPhone", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customerTiAcc": { + "name": "customerTiAcc", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lstServerPort": { + "name": "lstServerPort", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "serverLoc": { + "name": "serverLoc", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "oldVersion": { + "name": "oldVersion", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastUpdated": { + "name": "lastUpdated", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "shippingHours": { + "name": "shippingHours", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'[{\"early\": \"06:30\", \"late\": \"23:00\"}]'" + }, + "tiPostTime": { + "name": "tiPostTime", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'[{\"from\": \"24\", \"to\": \"24\"}]'" + }, + "otherSettings": { + "name": "otherSettings", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[{\"specialInstructions\":\"something for ti\",\"active\":false}]'::jsonb" + }, + "isUpgrading": { + "name": "isUpgrading", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + } + }, + "indexes": { + "plantToken": { + "name": "plantToken", + "columns": [ + { + "expression": "plantToken", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.settings": { + "name": "settings", + "schema": "", + "columns": { + "role_id": { + "name": "role_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "moduleName": { + "name": "moduleName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roles": { + "name": "roles", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[\"systemAdmin\"]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "name": { + "name": "name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.siloAdjustments": { + "name": "siloAdjustments", + "schema": "", + "columns": { + "siloAdjust_id": { + "name": "siloAdjust_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "level": { + "name": "level", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "locationID": { + "name": "locationID", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "currentStockLevel": { + "name": "currentStockLevel", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "newLevel": { + "name": "newLevel", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "comment": { + "name": "comment", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "''" + }, + "dateAdjusted": { + "name": "dateAdjusted", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "lastDateAdjusted": { + "name": "lastDateAdjusted", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "commentAddedBy": { + "name": "commentAddedBy", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "commentDate": { + "name": "commentDate", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "commentKey": { + "name": "commentKey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST_Serivce'" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.subModules": { + "name": "subModules", + "schema": "", + "columns": { + "submodule_id": { + "name": "submodule_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "moduleName": { + "name": "moduleName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "link": { + "name": "link", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "roles": { + "name": "roles", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[\"systemAdmin\"]'::jsonb" + }, + "icon": { + "name": "icon", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "subSubModule": { + "name": "subSubModule", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "subModule_name": { + "name": "subModule_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.userRoles": { + "name": "userRoles", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "role_id": { + "name": "role_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "module_id": { + "name": "module_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "user_module_unique": { + "name": "user_module_unique", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "module_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "userRoles_user_id_users_user_id_fk": { + "name": "userRoles_user_id_users_user_id_fk", + "tableFrom": "userRoles", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "user_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "userRoles_role_id_roles_role_id_fk": { + "name": "userRoles_role_id_roles_role_id_fk", + "tableFrom": "userRoles", + "tableTo": "roles", + "columnsFrom": [ + "role_id" + ], + "columnsTo": [ + "role_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "userRoles_module_id_modules_module_id_fk": { + "name": "userRoles_module_id_modules_module_id_fk", + "tableFrom": "userRoles", + "tableTo": "modules", + "columnsFrom": [ + "module_id" + ], + "columnsTo": [ + "module_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.users": { + "name": "users", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "passwordToken": { + "name": "passwordToken", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "passwordTokenExpires": { + "name": "passwordTokenExpires", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "pingcode": { + "name": "pingcode", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'user'" + }, + "lastLogin": { + "name": "lastLogin", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "username": { + "name": "username", + "columns": [ + { + "expression": "username", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": {}, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/database/migrations/meta/0056_snapshot.json b/database/migrations/meta/0056_snapshot.json new file mode 100644 index 0000000..9f5b043 --- /dev/null +++ b/database/migrations/meta/0056_snapshot.json @@ -0,0 +1,1845 @@ +{ + "id": "7a287a4b-d0b8-4c3b-a03f-61d24d630e52", + "prevId": "4f887c67-f50f-4bbf-acf2-6fb02b7db594", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.apiHits": { + "name": "apiHits", + "schema": "", + "columns": { + "apiHit_id": { + "name": "apiHit_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "ip": { + "name": "ip", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "endpoint": { + "name": "endpoint", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "action": { + "name": "action", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastBody": { + "name": "lastBody", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "endpoint": { + "name": "endpoint", + "columns": [ + { + "expression": "endpoint", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "ip", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.logs": { + "name": "logs", + "schema": "", + "columns": { + "log_id": { + "name": "log_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "level": { + "name": "level", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST_Serivce'" + }, + "service": { + "name": "service", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'system'" + }, + "message": { + "name": "message", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "checked": { + "name": "checked", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.modules": { + "name": "modules", + "schema": "", + "columns": { + "module_id": { + "name": "module_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "roles": { + "name": "roles", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[\"view\",\"systemAdmin\"]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "module_name": { + "name": "module_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.notifications": { + "name": "notifications", + "schema": "", + "columns": { + "notify_id": { + "name": "notify_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "checkInterval": { + "name": "checkInterval", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'1'" + }, + "timeType": { + "name": "timeType", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'hour'" + }, + "emails": { + "name": "emails", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "lastRan": { + "name": "lastRan", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "notifiySettings": { + "name": "notifiySettings", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'{}'::jsonb" + } + }, + "indexes": { + "notify_name": { + "name": "notify_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ocmeData": { + "name": "ocmeData", + "schema": "", + "columns": { + "ocme_id": { + "name": "ocme_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "sscc": { + "name": "sscc", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "runningNr": { + "name": "runningNr", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "completed": { + "name": "completed", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "lineNum": { + "name": "lineNum", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "pickedUp": { + "name": "pickedUp", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "areaFrom": { + "name": "areaFrom", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "ocme_runningNr": { + "name": "ocme_runningNr", + "columns": [ + { + "expression": "runningNr", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ocmeCycleCounts": { + "name": "ocmeCycleCounts", + "schema": "", + "columns": { + "ocme_id": { + "name": "ocme_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "laneId": { + "name": "laneId", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "warehouseName": { + "name": "warehouseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "laneName": { + "name": "laneName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "good": { + "name": "good", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "cycleCount": { + "name": "cycleCount", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.manualPrinting": { + "name": "manualPrinting", + "schema": "", + "columns": { + "print_id": { + "name": "print_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "line": { + "name": "line", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "printReason": { + "name": "printReason", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "initials": { + "name": "initials", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "additionalComments": { + "name": "additionalComments", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.printerData": { + "name": "printerData", + "schema": "", + "columns": { + "printer_id": { + "name": "printer_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "humanReadableId": { + "name": "humanReadableId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "ipAddress": { + "name": "ipAddress", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "port": { + "name": "port", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "statusText": { + "name": "statusText", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastTimePrinted": { + "name": "lastTimePrinted", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "assigned": { + "name": "assigned", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "remark": { + "name": "remark", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "printDelay": { + "name": "printDelay", + "type": "numeric", + "primaryKey": false, + "notNull": false, + "default": "'90'" + }, + "monitorState": { + "name": "monitorState", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "humanReadableId": { + "name": "humanReadableId", + "columns": [ + { + "expression": "humanReadableId", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.prodlabels": { + "name": "prodlabels", + "schema": "", + "columns": { + "label_id": { + "name": "label_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "printerID": { + "name": "printerID", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "printerName": { + "name": "printerName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "line": { + "name": "line", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "runningNr": { + "name": "runningNr", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'lst'" + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "runningNr": { + "name": "runningNr", + "columns": [ + { + "expression": "runningNr", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.qualityRequest": { + "name": "qualityRequest", + "schema": "", + "columns": { + "request_id": { + "name": "request_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "article": { + "name": "article", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "runningNr": { + "name": "runningNr", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lotNr": { + "name": "lotNr", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "warehouseAtRequest": { + "name": "warehouseAtRequest", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "locationAtRequest": { + "name": "locationAtRequest", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "warehouseMovedTo": { + "name": "warehouseMovedTo", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "locationMovedTo": { + "name": "locationMovedTo", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "durationToMove": { + "name": "durationToMove", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "locationDropOff": { + "name": "locationDropOff", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "palletStatus": { + "name": "palletStatus", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "palletStatusText": { + "name": "palletStatusText", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "palletRequest": { + "name": "palletRequest", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_user": { + "name": "upd_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST'" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.rfidReaders": { + "name": "rfidReaders", + "schema": "", + "columns": { + "rfidReader_id": { + "name": "rfidReader_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "reader": { + "name": "reader", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "readerIP": { + "name": "readerIP", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastHeartBeat": { + "name": "lastHeartBeat", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "lastTrigger": { + "name": "lastTrigger", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "lastTiggerGood": { + "name": "lastTiggerGood", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "lastTagScanned": { + "name": "lastTagScanned", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "reader": { + "name": "reader", + "columns": [ + { + "expression": "reader", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.rfidTags": { + "name": "rfidTags", + "schema": "", + "columns": { + "rfidTag_id": { + "name": "rfidTag_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "tagHex": { + "name": "tagHex", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tag": { + "name": "tag", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "timeStamp": { + "name": "timeStamp", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "counts": { + "name": "counts", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "lastareaIn": { + "name": "lastareaIn", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "runningNumber": { + "name": "runningNumber", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "antenna": { + "name": "antenna", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "tagStrength": { + "name": "tagStrength", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "tagHex": { + "name": "tagHex", + "columns": [ + { + "expression": "tagHex", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.roles": { + "name": "roles", + "schema": "", + "columns": { + "role_id": { + "name": "role_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "role_name": { + "name": "role_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.serverData": { + "name": "serverData", + "schema": "", + "columns": { + "server_id": { + "name": "server_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "sName": { + "name": "sName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "serverDNS": { + "name": "serverDNS", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "plantToken": { + "name": "plantToken", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "idAddress": { + "name": "idAddress", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "greatPlainsPlantCode": { + "name": "greatPlainsPlantCode", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "streetAddress": { + "name": "streetAddress", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cityState": { + "name": "cityState", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "zipcode": { + "name": "zipcode", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "contactEmail": { + "name": "contactEmail", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "contactPhone": { + "name": "contactPhone", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customerTiAcc": { + "name": "customerTiAcc", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lstServerPort": { + "name": "lstServerPort", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "serverLoc": { + "name": "serverLoc", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "oldVersion": { + "name": "oldVersion", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastUpdated": { + "name": "lastUpdated", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "shippingHours": { + "name": "shippingHours", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'[{\"early\": \"06:30\", \"late\": \"23:00\"}]'" + }, + "tiPostTime": { + "name": "tiPostTime", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'[{\"from\": \"24\", \"to\": \"24\"}]'" + }, + "otherSettings": { + "name": "otherSettings", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[{\"specialInstructions\":\"something for ti\",\"active\":false}]'::jsonb" + }, + "isUpgrading": { + "name": "isUpgrading", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + } + }, + "indexes": { + "plantToken": { + "name": "plantToken", + "columns": [ + { + "expression": "plantToken", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.settings": { + "name": "settings", + "schema": "", + "columns": { + "role_id": { + "name": "role_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "moduleName": { + "name": "moduleName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roles": { + "name": "roles", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[\"systemAdmin\"]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "name": { + "name": "name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.siloAdjustments": { + "name": "siloAdjustments", + "schema": "", + "columns": { + "siloAdjust_id": { + "name": "siloAdjust_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "level": { + "name": "level", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "locationID": { + "name": "locationID", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "currentStockLevel": { + "name": "currentStockLevel", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "newLevel": { + "name": "newLevel", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "comment": { + "name": "comment", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "''" + }, + "dateAdjusted": { + "name": "dateAdjusted", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "lastDateAdjusted": { + "name": "lastDateAdjusted", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "commentAddedBy": { + "name": "commentAddedBy", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "commentDate": { + "name": "commentDate", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "commentKey": { + "name": "commentKey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST_Serivce'" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.subModules": { + "name": "subModules", + "schema": "", + "columns": { + "submodule_id": { + "name": "submodule_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "moduleName": { + "name": "moduleName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "link": { + "name": "link", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "roles": { + "name": "roles", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[\"systemAdmin\"]'::jsonb" + }, + "icon": { + "name": "icon", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "subSubModule": { + "name": "subSubModule", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "subModule_name": { + "name": "subModule_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.userRoles": { + "name": "userRoles", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "role_id": { + "name": "role_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "module_id": { + "name": "module_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "user_module_unique": { + "name": "user_module_unique", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "module_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "userRoles_user_id_users_user_id_fk": { + "name": "userRoles_user_id_users_user_id_fk", + "tableFrom": "userRoles", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "user_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "userRoles_role_id_roles_role_id_fk": { + "name": "userRoles_role_id_roles_role_id_fk", + "tableFrom": "userRoles", + "tableTo": "roles", + "columnsFrom": [ + "role_id" + ], + "columnsTo": [ + "role_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "userRoles_module_id_modules_module_id_fk": { + "name": "userRoles_module_id_modules_module_id_fk", + "tableFrom": "userRoles", + "tableTo": "modules", + "columnsFrom": [ + "module_id" + ], + "columnsTo": [ + "module_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.users": { + "name": "users", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "passwordToken": { + "name": "passwordToken", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "passwordTokenExpires": { + "name": "passwordTokenExpires", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "pingcode": { + "name": "pingcode", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'user'" + }, + "lastLogin": { + "name": "lastLogin", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "username": { + "name": "username", + "columns": [ + { + "expression": "username", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": {}, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/database/migrations/meta/0057_snapshot.json b/database/migrations/meta/0057_snapshot.json new file mode 100644 index 0000000..a58171d --- /dev/null +++ b/database/migrations/meta/0057_snapshot.json @@ -0,0 +1,1851 @@ +{ + "id": "34eaf133-016a-4899-b773-4f1a7e22aa8b", + "prevId": "7a287a4b-d0b8-4c3b-a03f-61d24d630e52", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.apiHits": { + "name": "apiHits", + "schema": "", + "columns": { + "apiHit_id": { + "name": "apiHit_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "ip": { + "name": "ip", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "endpoint": { + "name": "endpoint", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "action": { + "name": "action", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastBody": { + "name": "lastBody", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "stats": { + "name": "stats", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "endpoint": { + "name": "endpoint", + "columns": [ + { + "expression": "endpoint", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "ip", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.logs": { + "name": "logs", + "schema": "", + "columns": { + "log_id": { + "name": "log_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "level": { + "name": "level", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST_Serivce'" + }, + "service": { + "name": "service", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'system'" + }, + "message": { + "name": "message", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "checked": { + "name": "checked", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.modules": { + "name": "modules", + "schema": "", + "columns": { + "module_id": { + "name": "module_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "roles": { + "name": "roles", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[\"view\",\"systemAdmin\"]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "module_name": { + "name": "module_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.notifications": { + "name": "notifications", + "schema": "", + "columns": { + "notify_id": { + "name": "notify_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "checkInterval": { + "name": "checkInterval", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'1'" + }, + "timeType": { + "name": "timeType", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'hour'" + }, + "emails": { + "name": "emails", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "lastRan": { + "name": "lastRan", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "notifiySettings": { + "name": "notifiySettings", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'{}'::jsonb" + } + }, + "indexes": { + "notify_name": { + "name": "notify_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ocmeData": { + "name": "ocmeData", + "schema": "", + "columns": { + "ocme_id": { + "name": "ocme_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "sscc": { + "name": "sscc", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "runningNr": { + "name": "runningNr", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "completed": { + "name": "completed", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "lineNum": { + "name": "lineNum", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "pickedUp": { + "name": "pickedUp", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "areaFrom": { + "name": "areaFrom", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "ocme_runningNr": { + "name": "ocme_runningNr", + "columns": [ + { + "expression": "runningNr", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ocmeCycleCounts": { + "name": "ocmeCycleCounts", + "schema": "", + "columns": { + "ocme_id": { + "name": "ocme_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "laneId": { + "name": "laneId", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "warehouseName": { + "name": "warehouseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "laneName": { + "name": "laneName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "good": { + "name": "good", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "cycleCount": { + "name": "cycleCount", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.manualPrinting": { + "name": "manualPrinting", + "schema": "", + "columns": { + "print_id": { + "name": "print_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "line": { + "name": "line", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "printReason": { + "name": "printReason", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "initials": { + "name": "initials", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "additionalComments": { + "name": "additionalComments", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.printerData": { + "name": "printerData", + "schema": "", + "columns": { + "printer_id": { + "name": "printer_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "humanReadableId": { + "name": "humanReadableId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "ipAddress": { + "name": "ipAddress", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "port": { + "name": "port", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "statusText": { + "name": "statusText", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastTimePrinted": { + "name": "lastTimePrinted", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "assigned": { + "name": "assigned", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "remark": { + "name": "remark", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "printDelay": { + "name": "printDelay", + "type": "numeric", + "primaryKey": false, + "notNull": false, + "default": "'90'" + }, + "monitorState": { + "name": "monitorState", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "humanReadableId": { + "name": "humanReadableId", + "columns": [ + { + "expression": "humanReadableId", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.prodlabels": { + "name": "prodlabels", + "schema": "", + "columns": { + "label_id": { + "name": "label_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "printerID": { + "name": "printerID", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "printerName": { + "name": "printerName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "line": { + "name": "line", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "runningNr": { + "name": "runningNr", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'lst'" + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "runningNr": { + "name": "runningNr", + "columns": [ + { + "expression": "runningNr", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.qualityRequest": { + "name": "qualityRequest", + "schema": "", + "columns": { + "request_id": { + "name": "request_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "article": { + "name": "article", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "runningNr": { + "name": "runningNr", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lotNr": { + "name": "lotNr", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "warehouseAtRequest": { + "name": "warehouseAtRequest", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "locationAtRequest": { + "name": "locationAtRequest", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "warehouseMovedTo": { + "name": "warehouseMovedTo", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "locationMovedTo": { + "name": "locationMovedTo", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "durationToMove": { + "name": "durationToMove", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "locationDropOff": { + "name": "locationDropOff", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "palletStatus": { + "name": "palletStatus", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "palletStatusText": { + "name": "palletStatusText", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "palletRequest": { + "name": "palletRequest", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_user": { + "name": "upd_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST'" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.rfidReaders": { + "name": "rfidReaders", + "schema": "", + "columns": { + "rfidReader_id": { + "name": "rfidReader_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "reader": { + "name": "reader", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "readerIP": { + "name": "readerIP", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastHeartBeat": { + "name": "lastHeartBeat", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "lastTrigger": { + "name": "lastTrigger", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "lastTiggerGood": { + "name": "lastTiggerGood", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "lastTagScanned": { + "name": "lastTagScanned", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "reader": { + "name": "reader", + "columns": [ + { + "expression": "reader", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.rfidTags": { + "name": "rfidTags", + "schema": "", + "columns": { + "rfidTag_id": { + "name": "rfidTag_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "tagHex": { + "name": "tagHex", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tag": { + "name": "tag", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "timeStamp": { + "name": "timeStamp", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "counts": { + "name": "counts", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "lastareaIn": { + "name": "lastareaIn", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "runningNumber": { + "name": "runningNumber", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "antenna": { + "name": "antenna", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "tagStrength": { + "name": "tagStrength", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "tagHex": { + "name": "tagHex", + "columns": [ + { + "expression": "tagHex", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.roles": { + "name": "roles", + "schema": "", + "columns": { + "role_id": { + "name": "role_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "role_name": { + "name": "role_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.serverData": { + "name": "serverData", + "schema": "", + "columns": { + "server_id": { + "name": "server_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "sName": { + "name": "sName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "serverDNS": { + "name": "serverDNS", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "plantToken": { + "name": "plantToken", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "idAddress": { + "name": "idAddress", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "greatPlainsPlantCode": { + "name": "greatPlainsPlantCode", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "streetAddress": { + "name": "streetAddress", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cityState": { + "name": "cityState", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "zipcode": { + "name": "zipcode", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "contactEmail": { + "name": "contactEmail", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "contactPhone": { + "name": "contactPhone", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customerTiAcc": { + "name": "customerTiAcc", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lstServerPort": { + "name": "lstServerPort", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "serverLoc": { + "name": "serverLoc", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "oldVersion": { + "name": "oldVersion", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastUpdated": { + "name": "lastUpdated", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "shippingHours": { + "name": "shippingHours", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'[{\"early\": \"06:30\", \"late\": \"23:00\"}]'" + }, + "tiPostTime": { + "name": "tiPostTime", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'[{\"from\": \"24\", \"to\": \"24\"}]'" + }, + "otherSettings": { + "name": "otherSettings", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[{\"specialInstructions\":\"something for ti\",\"active\":false}]'::jsonb" + }, + "isUpgrading": { + "name": "isUpgrading", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + } + }, + "indexes": { + "plantToken": { + "name": "plantToken", + "columns": [ + { + "expression": "plantToken", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.settings": { + "name": "settings", + "schema": "", + "columns": { + "role_id": { + "name": "role_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "moduleName": { + "name": "moduleName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roles": { + "name": "roles", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[\"systemAdmin\"]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "name": { + "name": "name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.siloAdjustments": { + "name": "siloAdjustments", + "schema": "", + "columns": { + "siloAdjust_id": { + "name": "siloAdjust_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "level": { + "name": "level", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "locationID": { + "name": "locationID", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "currentStockLevel": { + "name": "currentStockLevel", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "newLevel": { + "name": "newLevel", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "comment": { + "name": "comment", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "''" + }, + "dateAdjusted": { + "name": "dateAdjusted", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "lastDateAdjusted": { + "name": "lastDateAdjusted", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "commentAddedBy": { + "name": "commentAddedBy", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "commentDate": { + "name": "commentDate", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "commentKey": { + "name": "commentKey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST_Serivce'" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.subModules": { + "name": "subModules", + "schema": "", + "columns": { + "submodule_id": { + "name": "submodule_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "moduleName": { + "name": "moduleName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "link": { + "name": "link", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "roles": { + "name": "roles", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[\"systemAdmin\"]'::jsonb" + }, + "icon": { + "name": "icon", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "subSubModule": { + "name": "subSubModule", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "subModule_name": { + "name": "subModule_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.userRoles": { + "name": "userRoles", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "role_id": { + "name": "role_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "module_id": { + "name": "module_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "user_module_unique": { + "name": "user_module_unique", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "module_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "userRoles_user_id_users_user_id_fk": { + "name": "userRoles_user_id_users_user_id_fk", + "tableFrom": "userRoles", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "user_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "userRoles_role_id_roles_role_id_fk": { + "name": "userRoles_role_id_roles_role_id_fk", + "tableFrom": "userRoles", + "tableTo": "roles", + "columnsFrom": [ + "role_id" + ], + "columnsTo": [ + "role_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "userRoles_module_id_modules_module_id_fk": { + "name": "userRoles_module_id_modules_module_id_fk", + "tableFrom": "userRoles", + "tableTo": "modules", + "columnsFrom": [ + "module_id" + ], + "columnsTo": [ + "module_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.users": { + "name": "users", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "passwordToken": { + "name": "passwordToken", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "passwordTokenExpires": { + "name": "passwordTokenExpires", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "pingcode": { + "name": "pingcode", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'user'" + }, + "lastLogin": { + "name": "lastLogin", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "username": { + "name": "username", + "columns": [ + { + "expression": "username", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": {}, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/database/migrations/meta/0058_snapshot.json b/database/migrations/meta/0058_snapshot.json new file mode 100644 index 0000000..6e47086 --- /dev/null +++ b/database/migrations/meta/0058_snapshot.json @@ -0,0 +1,1852 @@ +{ + "id": "0f0559c8-23f7-4217-bf52-730872ed5367", + "prevId": "34eaf133-016a-4899-b773-4f1a7e22aa8b", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.apiHits": { + "name": "apiHits", + "schema": "", + "columns": { + "apiHit_id": { + "name": "apiHit_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "ip": { + "name": "ip", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "endpoint": { + "name": "endpoint", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "action": { + "name": "action", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastBody": { + "name": "lastBody", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "stats": { + "name": "stats", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 1 + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "endpoint": { + "name": "endpoint", + "columns": [ + { + "expression": "endpoint", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "ip", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.logs": { + "name": "logs", + "schema": "", + "columns": { + "log_id": { + "name": "log_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "level": { + "name": "level", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST_Serivce'" + }, + "service": { + "name": "service", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'system'" + }, + "message": { + "name": "message", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "checked": { + "name": "checked", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.modules": { + "name": "modules", + "schema": "", + "columns": { + "module_id": { + "name": "module_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "roles": { + "name": "roles", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[\"view\",\"systemAdmin\"]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "module_name": { + "name": "module_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.notifications": { + "name": "notifications", + "schema": "", + "columns": { + "notify_id": { + "name": "notify_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "checkInterval": { + "name": "checkInterval", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'1'" + }, + "timeType": { + "name": "timeType", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'hour'" + }, + "emails": { + "name": "emails", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "lastRan": { + "name": "lastRan", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "notifiySettings": { + "name": "notifiySettings", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'{}'::jsonb" + } + }, + "indexes": { + "notify_name": { + "name": "notify_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ocmeData": { + "name": "ocmeData", + "schema": "", + "columns": { + "ocme_id": { + "name": "ocme_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "sscc": { + "name": "sscc", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "runningNr": { + "name": "runningNr", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "completed": { + "name": "completed", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "lineNum": { + "name": "lineNum", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "pickedUp": { + "name": "pickedUp", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "areaFrom": { + "name": "areaFrom", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "ocme_runningNr": { + "name": "ocme_runningNr", + "columns": [ + { + "expression": "runningNr", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ocmeCycleCounts": { + "name": "ocmeCycleCounts", + "schema": "", + "columns": { + "ocme_id": { + "name": "ocme_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "laneId": { + "name": "laneId", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "warehouseName": { + "name": "warehouseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "laneName": { + "name": "laneName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "good": { + "name": "good", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "cycleCount": { + "name": "cycleCount", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.manualPrinting": { + "name": "manualPrinting", + "schema": "", + "columns": { + "print_id": { + "name": "print_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "line": { + "name": "line", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "printReason": { + "name": "printReason", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "initials": { + "name": "initials", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "additionalComments": { + "name": "additionalComments", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.printerData": { + "name": "printerData", + "schema": "", + "columns": { + "printer_id": { + "name": "printer_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "humanReadableId": { + "name": "humanReadableId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "ipAddress": { + "name": "ipAddress", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "port": { + "name": "port", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "statusText": { + "name": "statusText", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastTimePrinted": { + "name": "lastTimePrinted", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "assigned": { + "name": "assigned", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "remark": { + "name": "remark", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "printDelay": { + "name": "printDelay", + "type": "numeric", + "primaryKey": false, + "notNull": false, + "default": "'90'" + }, + "monitorState": { + "name": "monitorState", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "humanReadableId": { + "name": "humanReadableId", + "columns": [ + { + "expression": "humanReadableId", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.prodlabels": { + "name": "prodlabels", + "schema": "", + "columns": { + "label_id": { + "name": "label_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "printerID": { + "name": "printerID", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "printerName": { + "name": "printerName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "line": { + "name": "line", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "runningNr": { + "name": "runningNr", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'lst'" + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "runningNr": { + "name": "runningNr", + "columns": [ + { + "expression": "runningNr", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.qualityRequest": { + "name": "qualityRequest", + "schema": "", + "columns": { + "request_id": { + "name": "request_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "article": { + "name": "article", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "runningNr": { + "name": "runningNr", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lotNr": { + "name": "lotNr", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "warehouseAtRequest": { + "name": "warehouseAtRequest", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "locationAtRequest": { + "name": "locationAtRequest", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "warehouseMovedTo": { + "name": "warehouseMovedTo", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "locationMovedTo": { + "name": "locationMovedTo", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "durationToMove": { + "name": "durationToMove", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "locationDropOff": { + "name": "locationDropOff", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "palletStatus": { + "name": "palletStatus", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "palletStatusText": { + "name": "palletStatusText", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "palletRequest": { + "name": "palletRequest", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_user": { + "name": "upd_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST'" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.rfidReaders": { + "name": "rfidReaders", + "schema": "", + "columns": { + "rfidReader_id": { + "name": "rfidReader_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "reader": { + "name": "reader", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "readerIP": { + "name": "readerIP", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastHeartBeat": { + "name": "lastHeartBeat", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "lastTrigger": { + "name": "lastTrigger", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "lastTiggerGood": { + "name": "lastTiggerGood", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "lastTagScanned": { + "name": "lastTagScanned", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "reader": { + "name": "reader", + "columns": [ + { + "expression": "reader", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.rfidTags": { + "name": "rfidTags", + "schema": "", + "columns": { + "rfidTag_id": { + "name": "rfidTag_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "tagHex": { + "name": "tagHex", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tag": { + "name": "tag", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "timeStamp": { + "name": "timeStamp", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "counts": { + "name": "counts", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "lastareaIn": { + "name": "lastareaIn", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "runningNumber": { + "name": "runningNumber", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "antenna": { + "name": "antenna", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "tagStrength": { + "name": "tagStrength", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "tagHex": { + "name": "tagHex", + "columns": [ + { + "expression": "tagHex", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.roles": { + "name": "roles", + "schema": "", + "columns": { + "role_id": { + "name": "role_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "role_name": { + "name": "role_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.serverData": { + "name": "serverData", + "schema": "", + "columns": { + "server_id": { + "name": "server_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "sName": { + "name": "sName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "serverDNS": { + "name": "serverDNS", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "plantToken": { + "name": "plantToken", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "idAddress": { + "name": "idAddress", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "greatPlainsPlantCode": { + "name": "greatPlainsPlantCode", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "streetAddress": { + "name": "streetAddress", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cityState": { + "name": "cityState", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "zipcode": { + "name": "zipcode", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "contactEmail": { + "name": "contactEmail", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "contactPhone": { + "name": "contactPhone", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customerTiAcc": { + "name": "customerTiAcc", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lstServerPort": { + "name": "lstServerPort", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "serverLoc": { + "name": "serverLoc", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "oldVersion": { + "name": "oldVersion", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastUpdated": { + "name": "lastUpdated", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "shippingHours": { + "name": "shippingHours", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'[{\"early\": \"06:30\", \"late\": \"23:00\"}]'" + }, + "tiPostTime": { + "name": "tiPostTime", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'[{\"from\": \"24\", \"to\": \"24\"}]'" + }, + "otherSettings": { + "name": "otherSettings", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[{\"specialInstructions\":\"something for ti\",\"active\":false}]'::jsonb" + }, + "isUpgrading": { + "name": "isUpgrading", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + } + }, + "indexes": { + "plantToken": { + "name": "plantToken", + "columns": [ + { + "expression": "plantToken", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.settings": { + "name": "settings", + "schema": "", + "columns": { + "role_id": { + "name": "role_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "moduleName": { + "name": "moduleName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roles": { + "name": "roles", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[\"systemAdmin\"]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "name": { + "name": "name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.siloAdjustments": { + "name": "siloAdjustments", + "schema": "", + "columns": { + "siloAdjust_id": { + "name": "siloAdjust_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "level": { + "name": "level", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "locationID": { + "name": "locationID", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "currentStockLevel": { + "name": "currentStockLevel", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "newLevel": { + "name": "newLevel", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "comment": { + "name": "comment", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "''" + }, + "dateAdjusted": { + "name": "dateAdjusted", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "lastDateAdjusted": { + "name": "lastDateAdjusted", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "commentAddedBy": { + "name": "commentAddedBy", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "commentDate": { + "name": "commentDate", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "commentKey": { + "name": "commentKey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST_Serivce'" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.subModules": { + "name": "subModules", + "schema": "", + "columns": { + "submodule_id": { + "name": "submodule_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "moduleName": { + "name": "moduleName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "link": { + "name": "link", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "roles": { + "name": "roles", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[\"systemAdmin\"]'::jsonb" + }, + "icon": { + "name": "icon", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "subSubModule": { + "name": "subSubModule", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "subModule_name": { + "name": "subModule_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.userRoles": { + "name": "userRoles", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "role_id": { + "name": "role_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "module_id": { + "name": "module_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "user_module_unique": { + "name": "user_module_unique", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "module_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "userRoles_user_id_users_user_id_fk": { + "name": "userRoles_user_id_users_user_id_fk", + "tableFrom": "userRoles", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "user_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "userRoles_role_id_roles_role_id_fk": { + "name": "userRoles_role_id_roles_role_id_fk", + "tableFrom": "userRoles", + "tableTo": "roles", + "columnsFrom": [ + "role_id" + ], + "columnsTo": [ + "role_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "userRoles_module_id_modules_module_id_fk": { + "name": "userRoles_module_id_modules_module_id_fk", + "tableFrom": "userRoles", + "tableTo": "modules", + "columnsFrom": [ + "module_id" + ], + "columnsTo": [ + "module_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.users": { + "name": "users", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "passwordToken": { + "name": "passwordToken", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "passwordTokenExpires": { + "name": "passwordTokenExpires", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "pingcode": { + "name": "pingcode", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'user'" + }, + "lastLogin": { + "name": "lastLogin", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "username": { + "name": "username", + "columns": [ + { + "expression": "username", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": {}, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/database/migrations/meta/0059_snapshot.json b/database/migrations/meta/0059_snapshot.json new file mode 100644 index 0000000..8e759ea --- /dev/null +++ b/database/migrations/meta/0059_snapshot.json @@ -0,0 +1,1846 @@ +{ + "id": "84722bdd-e041-45b5-8f8e-cdae02ead575", + "prevId": "0f0559c8-23f7-4217-bf52-730872ed5367", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.apiHits": { + "name": "apiHits", + "schema": "", + "columns": { + "apiHit_id": { + "name": "apiHit_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "ip": { + "name": "ip", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "endpoint": { + "name": "endpoint", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "action": { + "name": "action", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "stats": { + "name": "stats", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 1 + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "endpoint": { + "name": "endpoint", + "columns": [ + { + "expression": "endpoint", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "ip", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.logs": { + "name": "logs", + "schema": "", + "columns": { + "log_id": { + "name": "log_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "level": { + "name": "level", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST_Serivce'" + }, + "service": { + "name": "service", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'system'" + }, + "message": { + "name": "message", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "checked": { + "name": "checked", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.modules": { + "name": "modules", + "schema": "", + "columns": { + "module_id": { + "name": "module_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "roles": { + "name": "roles", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[\"view\",\"systemAdmin\"]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "module_name": { + "name": "module_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.notifications": { + "name": "notifications", + "schema": "", + "columns": { + "notify_id": { + "name": "notify_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "checkInterval": { + "name": "checkInterval", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'1'" + }, + "timeType": { + "name": "timeType", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'hour'" + }, + "emails": { + "name": "emails", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "lastRan": { + "name": "lastRan", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "notifiySettings": { + "name": "notifiySettings", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'{}'::jsonb" + } + }, + "indexes": { + "notify_name": { + "name": "notify_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ocmeData": { + "name": "ocmeData", + "schema": "", + "columns": { + "ocme_id": { + "name": "ocme_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "sscc": { + "name": "sscc", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "runningNr": { + "name": "runningNr", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "completed": { + "name": "completed", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "lineNum": { + "name": "lineNum", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "pickedUp": { + "name": "pickedUp", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "areaFrom": { + "name": "areaFrom", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "ocme_runningNr": { + "name": "ocme_runningNr", + "columns": [ + { + "expression": "runningNr", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ocmeCycleCounts": { + "name": "ocmeCycleCounts", + "schema": "", + "columns": { + "ocme_id": { + "name": "ocme_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "laneId": { + "name": "laneId", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "warehouseName": { + "name": "warehouseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "laneName": { + "name": "laneName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "good": { + "name": "good", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "cycleCount": { + "name": "cycleCount", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.manualPrinting": { + "name": "manualPrinting", + "schema": "", + "columns": { + "print_id": { + "name": "print_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "line": { + "name": "line", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "printReason": { + "name": "printReason", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "initials": { + "name": "initials", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "additionalComments": { + "name": "additionalComments", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.printerData": { + "name": "printerData", + "schema": "", + "columns": { + "printer_id": { + "name": "printer_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "humanReadableId": { + "name": "humanReadableId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "ipAddress": { + "name": "ipAddress", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "port": { + "name": "port", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "statusText": { + "name": "statusText", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastTimePrinted": { + "name": "lastTimePrinted", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "assigned": { + "name": "assigned", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "remark": { + "name": "remark", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "printDelay": { + "name": "printDelay", + "type": "numeric", + "primaryKey": false, + "notNull": false, + "default": "'90'" + }, + "monitorState": { + "name": "monitorState", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "humanReadableId": { + "name": "humanReadableId", + "columns": [ + { + "expression": "humanReadableId", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.prodlabels": { + "name": "prodlabels", + "schema": "", + "columns": { + "label_id": { + "name": "label_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "printerID": { + "name": "printerID", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "printerName": { + "name": "printerName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "line": { + "name": "line", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "runningNr": { + "name": "runningNr", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'lst'" + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "runningNr": { + "name": "runningNr", + "columns": [ + { + "expression": "runningNr", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.qualityRequest": { + "name": "qualityRequest", + "schema": "", + "columns": { + "request_id": { + "name": "request_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "article": { + "name": "article", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "runningNr": { + "name": "runningNr", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lotNr": { + "name": "lotNr", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "warehouseAtRequest": { + "name": "warehouseAtRequest", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "locationAtRequest": { + "name": "locationAtRequest", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "warehouseMovedTo": { + "name": "warehouseMovedTo", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "locationMovedTo": { + "name": "locationMovedTo", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "durationToMove": { + "name": "durationToMove", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "locationDropOff": { + "name": "locationDropOff", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "palletStatus": { + "name": "palletStatus", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "palletStatusText": { + "name": "palletStatusText", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "palletRequest": { + "name": "palletRequest", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_user": { + "name": "upd_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST'" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.rfidReaders": { + "name": "rfidReaders", + "schema": "", + "columns": { + "rfidReader_id": { + "name": "rfidReader_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "reader": { + "name": "reader", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "readerIP": { + "name": "readerIP", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastHeartBeat": { + "name": "lastHeartBeat", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "lastTrigger": { + "name": "lastTrigger", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "lastTiggerGood": { + "name": "lastTiggerGood", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "lastTagScanned": { + "name": "lastTagScanned", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "reader": { + "name": "reader", + "columns": [ + { + "expression": "reader", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.rfidTags": { + "name": "rfidTags", + "schema": "", + "columns": { + "rfidTag_id": { + "name": "rfidTag_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "tagHex": { + "name": "tagHex", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tag": { + "name": "tag", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "timeStamp": { + "name": "timeStamp", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "counts": { + "name": "counts", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "lastareaIn": { + "name": "lastareaIn", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "runningNumber": { + "name": "runningNumber", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "antenna": { + "name": "antenna", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "tagStrength": { + "name": "tagStrength", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "tagHex": { + "name": "tagHex", + "columns": [ + { + "expression": "tagHex", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.roles": { + "name": "roles", + "schema": "", + "columns": { + "role_id": { + "name": "role_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "role_name": { + "name": "role_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.serverData": { + "name": "serverData", + "schema": "", + "columns": { + "server_id": { + "name": "server_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "sName": { + "name": "sName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "serverDNS": { + "name": "serverDNS", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "plantToken": { + "name": "plantToken", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "idAddress": { + "name": "idAddress", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "greatPlainsPlantCode": { + "name": "greatPlainsPlantCode", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "streetAddress": { + "name": "streetAddress", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cityState": { + "name": "cityState", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "zipcode": { + "name": "zipcode", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "contactEmail": { + "name": "contactEmail", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "contactPhone": { + "name": "contactPhone", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customerTiAcc": { + "name": "customerTiAcc", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lstServerPort": { + "name": "lstServerPort", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "serverLoc": { + "name": "serverLoc", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "oldVersion": { + "name": "oldVersion", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastUpdated": { + "name": "lastUpdated", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "shippingHours": { + "name": "shippingHours", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'[{\"early\": \"06:30\", \"late\": \"23:00\"}]'" + }, + "tiPostTime": { + "name": "tiPostTime", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'[{\"from\": \"24\", \"to\": \"24\"}]'" + }, + "otherSettings": { + "name": "otherSettings", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[{\"specialInstructions\":\"something for ti\",\"active\":false}]'::jsonb" + }, + "isUpgrading": { + "name": "isUpgrading", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + } + }, + "indexes": { + "plantToken": { + "name": "plantToken", + "columns": [ + { + "expression": "plantToken", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.settings": { + "name": "settings", + "schema": "", + "columns": { + "role_id": { + "name": "role_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "moduleName": { + "name": "moduleName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roles": { + "name": "roles", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[\"systemAdmin\"]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "name": { + "name": "name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.siloAdjustments": { + "name": "siloAdjustments", + "schema": "", + "columns": { + "siloAdjust_id": { + "name": "siloAdjust_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "level": { + "name": "level", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "locationID": { + "name": "locationID", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "currentStockLevel": { + "name": "currentStockLevel", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "newLevel": { + "name": "newLevel", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "comment": { + "name": "comment", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "''" + }, + "dateAdjusted": { + "name": "dateAdjusted", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "lastDateAdjusted": { + "name": "lastDateAdjusted", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "commentAddedBy": { + "name": "commentAddedBy", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "commentDate": { + "name": "commentDate", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "commentKey": { + "name": "commentKey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST_Serivce'" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.subModules": { + "name": "subModules", + "schema": "", + "columns": { + "submodule_id": { + "name": "submodule_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "moduleName": { + "name": "moduleName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "link": { + "name": "link", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "roles": { + "name": "roles", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[\"systemAdmin\"]'::jsonb" + }, + "icon": { + "name": "icon", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "subSubModule": { + "name": "subSubModule", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "subModule_name": { + "name": "subModule_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.userRoles": { + "name": "userRoles", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "role_id": { + "name": "role_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "module_id": { + "name": "module_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "user_module_unique": { + "name": "user_module_unique", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "module_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "userRoles_user_id_users_user_id_fk": { + "name": "userRoles_user_id_users_user_id_fk", + "tableFrom": "userRoles", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "user_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "userRoles_role_id_roles_role_id_fk": { + "name": "userRoles_role_id_roles_role_id_fk", + "tableFrom": "userRoles", + "tableTo": "roles", + "columnsFrom": [ + "role_id" + ], + "columnsTo": [ + "role_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "userRoles_module_id_modules_module_id_fk": { + "name": "userRoles_module_id_modules_module_id_fk", + "tableFrom": "userRoles", + "tableTo": "modules", + "columnsFrom": [ + "module_id" + ], + "columnsTo": [ + "module_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.users": { + "name": "users", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "passwordToken": { + "name": "passwordToken", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "passwordTokenExpires": { + "name": "passwordTokenExpires", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "pingcode": { + "name": "pingcode", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'user'" + }, + "lastLogin": { + "name": "lastLogin", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "username": { + "name": "username", + "columns": [ + { + "expression": "username", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": {}, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/database/migrations/meta/0060_snapshot.json b/database/migrations/meta/0060_snapshot.json new file mode 100644 index 0000000..badf3b0 --- /dev/null +++ b/database/migrations/meta/0060_snapshot.json @@ -0,0 +1,1852 @@ +{ + "id": "bfc825ff-b7bc-42d2-a8b0-987655c7b0e9", + "prevId": "84722bdd-e041-45b5-8f8e-cdae02ead575", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.apiHits": { + "name": "apiHits", + "schema": "", + "columns": { + "apiHit_id": { + "name": "apiHit_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "ip": { + "name": "ip", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "endpoint": { + "name": "endpoint", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "action": { + "name": "action", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastBody": { + "name": "lastBody", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "stats": { + "name": "stats", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 1 + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "endpoint": { + "name": "endpoint", + "columns": [ + { + "expression": "endpoint", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "ip", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.logs": { + "name": "logs", + "schema": "", + "columns": { + "log_id": { + "name": "log_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "level": { + "name": "level", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST_Serivce'" + }, + "service": { + "name": "service", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'system'" + }, + "message": { + "name": "message", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "checked": { + "name": "checked", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.modules": { + "name": "modules", + "schema": "", + "columns": { + "module_id": { + "name": "module_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "roles": { + "name": "roles", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[\"view\",\"systemAdmin\"]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "module_name": { + "name": "module_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.notifications": { + "name": "notifications", + "schema": "", + "columns": { + "notify_id": { + "name": "notify_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "checkInterval": { + "name": "checkInterval", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'1'" + }, + "timeType": { + "name": "timeType", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'hour'" + }, + "emails": { + "name": "emails", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "lastRan": { + "name": "lastRan", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "notifiySettings": { + "name": "notifiySettings", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'{}'::jsonb" + } + }, + "indexes": { + "notify_name": { + "name": "notify_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ocmeData": { + "name": "ocmeData", + "schema": "", + "columns": { + "ocme_id": { + "name": "ocme_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "sscc": { + "name": "sscc", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "runningNr": { + "name": "runningNr", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "completed": { + "name": "completed", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "lineNum": { + "name": "lineNum", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "pickedUp": { + "name": "pickedUp", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "areaFrom": { + "name": "areaFrom", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "ocme_runningNr": { + "name": "ocme_runningNr", + "columns": [ + { + "expression": "runningNr", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ocmeCycleCounts": { + "name": "ocmeCycleCounts", + "schema": "", + "columns": { + "ocme_id": { + "name": "ocme_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "laneId": { + "name": "laneId", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "warehouseName": { + "name": "warehouseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "laneName": { + "name": "laneName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "good": { + "name": "good", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "cycleCount": { + "name": "cycleCount", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.manualPrinting": { + "name": "manualPrinting", + "schema": "", + "columns": { + "print_id": { + "name": "print_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "line": { + "name": "line", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "printReason": { + "name": "printReason", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "initials": { + "name": "initials", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "additionalComments": { + "name": "additionalComments", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.printerData": { + "name": "printerData", + "schema": "", + "columns": { + "printer_id": { + "name": "printer_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "humanReadableId": { + "name": "humanReadableId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "ipAddress": { + "name": "ipAddress", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "port": { + "name": "port", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "statusText": { + "name": "statusText", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastTimePrinted": { + "name": "lastTimePrinted", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "assigned": { + "name": "assigned", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "remark": { + "name": "remark", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "printDelay": { + "name": "printDelay", + "type": "numeric", + "primaryKey": false, + "notNull": false, + "default": "'90'" + }, + "monitorState": { + "name": "monitorState", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "humanReadableId": { + "name": "humanReadableId", + "columns": [ + { + "expression": "humanReadableId", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.prodlabels": { + "name": "prodlabels", + "schema": "", + "columns": { + "label_id": { + "name": "label_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "printerID": { + "name": "printerID", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "printerName": { + "name": "printerName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "line": { + "name": "line", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "runningNr": { + "name": "runningNr", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'lst'" + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "runningNr": { + "name": "runningNr", + "columns": [ + { + "expression": "runningNr", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.qualityRequest": { + "name": "qualityRequest", + "schema": "", + "columns": { + "request_id": { + "name": "request_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "article": { + "name": "article", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "runningNr": { + "name": "runningNr", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lotNr": { + "name": "lotNr", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "warehouseAtRequest": { + "name": "warehouseAtRequest", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "locationAtRequest": { + "name": "locationAtRequest", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "warehouseMovedTo": { + "name": "warehouseMovedTo", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "locationMovedTo": { + "name": "locationMovedTo", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "durationToMove": { + "name": "durationToMove", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "locationDropOff": { + "name": "locationDropOff", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "palletStatus": { + "name": "palletStatus", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "palletStatusText": { + "name": "palletStatusText", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "palletRequest": { + "name": "palletRequest", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_user": { + "name": "upd_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST'" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.rfidReaders": { + "name": "rfidReaders", + "schema": "", + "columns": { + "rfidReader_id": { + "name": "rfidReader_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "reader": { + "name": "reader", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "readerIP": { + "name": "readerIP", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastHeartBeat": { + "name": "lastHeartBeat", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "lastTrigger": { + "name": "lastTrigger", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "lastTiggerGood": { + "name": "lastTiggerGood", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "lastTagScanned": { + "name": "lastTagScanned", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "reader": { + "name": "reader", + "columns": [ + { + "expression": "reader", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.rfidTags": { + "name": "rfidTags", + "schema": "", + "columns": { + "rfidTag_id": { + "name": "rfidTag_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "tagHex": { + "name": "tagHex", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tag": { + "name": "tag", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "timeStamp": { + "name": "timeStamp", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "counts": { + "name": "counts", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "lastareaIn": { + "name": "lastareaIn", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "runningNumber": { + "name": "runningNumber", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "antenna": { + "name": "antenna", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "tagStrength": { + "name": "tagStrength", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "tagHex": { + "name": "tagHex", + "columns": [ + { + "expression": "tagHex", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.roles": { + "name": "roles", + "schema": "", + "columns": { + "role_id": { + "name": "role_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "role_name": { + "name": "role_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.serverData": { + "name": "serverData", + "schema": "", + "columns": { + "server_id": { + "name": "server_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "sName": { + "name": "sName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "serverDNS": { + "name": "serverDNS", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "plantToken": { + "name": "plantToken", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "idAddress": { + "name": "idAddress", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "greatPlainsPlantCode": { + "name": "greatPlainsPlantCode", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "streetAddress": { + "name": "streetAddress", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cityState": { + "name": "cityState", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "zipcode": { + "name": "zipcode", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "contactEmail": { + "name": "contactEmail", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "contactPhone": { + "name": "contactPhone", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customerTiAcc": { + "name": "customerTiAcc", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lstServerPort": { + "name": "lstServerPort", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "serverLoc": { + "name": "serverLoc", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "oldVersion": { + "name": "oldVersion", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastUpdated": { + "name": "lastUpdated", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "shippingHours": { + "name": "shippingHours", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'[{\"early\": \"06:30\", \"late\": \"23:00\"}]'" + }, + "tiPostTime": { + "name": "tiPostTime", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'[{\"from\": \"24\", \"to\": \"24\"}]'" + }, + "otherSettings": { + "name": "otherSettings", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[{\"specialInstructions\":\"something for ti\",\"active\":false}]'::jsonb" + }, + "isUpgrading": { + "name": "isUpgrading", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + } + }, + "indexes": { + "plantToken": { + "name": "plantToken", + "columns": [ + { + "expression": "plantToken", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.settings": { + "name": "settings", + "schema": "", + "columns": { + "role_id": { + "name": "role_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "moduleName": { + "name": "moduleName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roles": { + "name": "roles", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[\"systemAdmin\"]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "name": { + "name": "name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.siloAdjustments": { + "name": "siloAdjustments", + "schema": "", + "columns": { + "siloAdjust_id": { + "name": "siloAdjust_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "level": { + "name": "level", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "locationID": { + "name": "locationID", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "currentStockLevel": { + "name": "currentStockLevel", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "newLevel": { + "name": "newLevel", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "comment": { + "name": "comment", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "''" + }, + "dateAdjusted": { + "name": "dateAdjusted", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "lastDateAdjusted": { + "name": "lastDateAdjusted", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "commentAddedBy": { + "name": "commentAddedBy", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "commentDate": { + "name": "commentDate", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "commentKey": { + "name": "commentKey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'LST_Serivce'" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.subModules": { + "name": "subModules", + "schema": "", + "columns": { + "submodule_id": { + "name": "submodule_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "moduleName": { + "name": "moduleName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "link": { + "name": "link", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "roles": { + "name": "roles", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[\"systemAdmin\"]'::jsonb" + }, + "icon": { + "name": "icon", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "subSubModule": { + "name": "subSubModule", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "subModule_name": { + "name": "subModule_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.userRoles": { + "name": "userRoles", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "role_id": { + "name": "role_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "module_id": { + "name": "module_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "user_module_unique": { + "name": "user_module_unique", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "module_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "userRoles_user_id_users_user_id_fk": { + "name": "userRoles_user_id_users_user_id_fk", + "tableFrom": "userRoles", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "user_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "userRoles_role_id_roles_role_id_fk": { + "name": "userRoles_role_id_roles_role_id_fk", + "tableFrom": "userRoles", + "tableTo": "roles", + "columnsFrom": [ + "role_id" + ], + "columnsTo": [ + "role_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "userRoles_module_id_modules_module_id_fk": { + "name": "userRoles_module_id_modules_module_id_fk", + "tableFrom": "userRoles", + "tableTo": "modules", + "columnsFrom": [ + "module_id" + ], + "columnsTo": [ + "module_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.users": { + "name": "users", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "passwordToken": { + "name": "passwordToken", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "passwordTokenExpires": { + "name": "passwordTokenExpires", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "pingcode": { + "name": "pingcode", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'user'" + }, + "lastLogin": { + "name": "lastLogin", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "username": { + "name": "username", + "columns": [ + { + "expression": "username", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": {}, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/database/migrations/meta/_journal.json b/database/migrations/meta/_journal.json index d03d055..de64a36 100644 --- a/database/migrations/meta/_journal.json +++ b/database/migrations/meta/_journal.json @@ -372,6 +372,62 @@ "when": 1744685129838, "tag": "0052_dark_human_torch", "breakpoints": true + }, + { + "idx": 53, + "version": "7", + "when": 1747355241210, + "tag": "0053_short_colleen_wing", + "breakpoints": true + }, + { + "idx": 54, + "version": "7", + "when": 1747355689811, + "tag": "0054_careless_ultron", + "breakpoints": true + }, + { + "idx": 55, + "version": "7", + "when": 1747355837326, + "tag": "0055_sudden_frank_castle", + "breakpoints": true + }, + { + "idx": 56, + "version": "7", + "when": 1747355877490, + "tag": "0056_breezy_inertia", + "breakpoints": true + }, + { + "idx": 57, + "version": "7", + "when": 1747355892746, + "tag": "0057_orange_lady_deathstrike", + "breakpoints": true + }, + { + "idx": 58, + "version": "7", + "when": 1747356938396, + "tag": "0058_cultured_argent", + "breakpoints": true + }, + { + "idx": 59, + "version": "7", + "when": 1747357471279, + "tag": "0059_calm_energizer", + "breakpoints": true + }, + { + "idx": 60, + "version": "7", + "when": 1747357513268, + "tag": "0060_daffy_overlord", + "breakpoints": true } ] } \ No newline at end of file diff --git a/database/schema/apiHits.ts b/database/schema/apiHits.ts index 408fa42..3a6f467 100644 --- a/database/schema/apiHits.ts +++ b/database/schema/apiHits.ts @@ -1,21 +1,30 @@ -import {pgTable, text, timestamp} from "drizzle-orm/pg-core"; -import {createSelectSchema} from "drizzle-zod"; +import { + integer, + jsonb, + pgTable, + text, + timestamp, + uniqueIndex, + uuid, +} from "drizzle-orm/pg-core"; +import { createSelectSchema } from "drizzle-zod"; export const apiHits = pgTable( "apiHits", { + apiHit_id: uuid("apiHit_id").defaultRandom().primaryKey(), ip: text("ip"), endpoint: text("endpoint"), action: text("action"), - lastBody: text("lastBody"), - stats: text("stats"), + lastBody: jsonb("lastBody"), + stats: integer("stats").default(1), add_date: timestamp().defaultNow(), upd_date: timestamp().defaultNow(), - } - // (table) => [ - // // uniqueIndex('emailUniqueIndex').on(sql`lower(${table.email})`), - // uniqueIndex("role_name").on(table.name), - // ] + }, + (table) => [ + // uniqueIndex('emailUniqueIndex').on(sql`lower(${table.email})`), + uniqueIndex("endpoint").on(table.endpoint, table.ip), + ] ); // Schema for inserting a user - can be used to validate API requests diff --git a/server/globalUtils/apiHits.ts b/server/globalUtils/apiHits.ts index 393d8ef..1ade53c 100644 --- a/server/globalUtils/apiHits.ts +++ b/server/globalUtils/apiHits.ts @@ -1,12 +1,17 @@ -import type {Context} from "hono"; -import {z, ZodError} from "zod"; +import type { Context } from "hono"; +import { z, ZodError } from "zod"; +import { getConnInfo } from "@hono/node-server/conninfo"; +import { tryCatch } from "./tryCatch.js"; +import { db } from "../../database/dbclient.js"; +import { apiHits } from "../../database/schema/apiHits.js"; +import { sql } from "drizzle-orm"; // Define the request body schema const requestSchema = z.object({ ip: z.string().optional(), endpoint: z.string(), action: z.string().optional(), - lastBody: z.string().optional(), + lastBody: z.array(z.object({})).or(z.object({})).optional(), stats: z.string().optional(), }); @@ -15,8 +20,9 @@ type ApiHitData = z.infer; export const apiHit = async ( c: Context, data: ApiHitData -): Promise<{success: boolean; data?: ApiHitData; errors?: any[]}> => { - // console.log(data); +): Promise<{ success: boolean; data?: ApiHitData; errors?: any[] }> => { + const info = getConnInfo(c); + // console.log(`Your remote address is ${info.remote.address}`); try { // Extract IP from request headers or connection info const forwarded = c.req.header("host"); @@ -24,24 +30,45 @@ export const apiHit = async ( //console.log(forwarded); // Validate the data const checkData = { - ip: forwarded!, + ip: info.remote.address!, endpoint: data?.endpoint, lastBody: data?.lastBody, action: data?.action, - stats: data?.stats, + //stats: data?.stats, }; const validatedData = requestSchema.parse(checkData); + const { data: apitHitData, error } = await tryCatch( + db + .insert(apiHits) + .values(checkData) + .onConflictDoUpdate({ + target: [apiHits.endpoint, apiHits.ip], + set: { + stats: sql`${apiHits.stats} + 1`, + lastBody: data?.lastBody, + action: data?.action, + upd_date: sql`NOW()`, + }, + }) + ); + + if (error) { + console.log(error); + } // Proceed with the validated data - return {success: true, data: validatedData}; + return { success: true, data: validatedData }; } catch (error) { // Explicitly check if the error is an instance of ZodError if (error instanceof ZodError) { - // console.log({success: false, errors: error.errors}); - return {success: false, errors: error.errors}; + console.log({ success: false, errors: error.errors }); + return { success: false, errors: error.errors }; } // Catch other unexpected errors - return {success: false, errors: [{message: "An unknown error occurred"}]}; + return { + success: false, + errors: [{ message: "An unknown error occurred" }], + }; } }; diff --git a/server/services/dataMart/route/fakeEDI.ts b/server/services/dataMart/route/fakeEDI.ts index 1b22510..ff9e140 100644 --- a/server/services/dataMart/route/fakeEDI.ts +++ b/server/services/dataMart/route/fakeEDI.ts @@ -3,6 +3,7 @@ import { responses } from "../../../globalUtils/routeDefs/responses.js"; import { tryCatch } from "../../../globalUtils/tryCatch.js"; import { getINV } from "../controller/getinventory.js"; import { getFakeEDI } from "../controller/fakeEDIUpdate.js"; +import { apiHit } from "../../../globalUtils/apiHits.js"; const app = new OpenAPIHono({ strict: false }); const Body = z.object({ @@ -27,7 +28,7 @@ app.openapi( const address: string = c.req.query("address") ?? ""; // make sure we have a vaid user being accessed thats really logged in - //apiHit(c, { endpoint: `api/logger/logs/id` }); + apiHit(c, { endpoint: "/fakeediupdate" }); const { data, error } = await tryCatch( getFakeEDI(address.toString() ?? "") ); diff --git a/server/services/dataMart/route/getActiveArticles.ts b/server/services/dataMart/route/getActiveArticles.ts index 301e8b8..9da5cf1 100644 --- a/server/services/dataMart/route/getActiveArticles.ts +++ b/server/services/dataMart/route/getActiveArticles.ts @@ -22,7 +22,7 @@ app.openapi( async (c) => { //const body = await c.req.json(); // make sure we have a vaid user being accessed thats really logged in - //apiHit(c, { endpoint: `api/logger/logs/id` }); + apiHit(c, { endpoint: "/getarticles" }); try { return c.json( { diff --git a/server/services/dataMart/route/getCurrentQuerys.ts b/server/services/dataMart/route/getCurrentQuerys.ts index 32bde28..cb3028a 100644 --- a/server/services/dataMart/route/getCurrentQuerys.ts +++ b/server/services/dataMart/route/getCurrentQuerys.ts @@ -1,5 +1,6 @@ import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi"; import { responses } from "../../../globalUtils/routeDefs/responses.js"; +import { apiHit } from "../../../globalUtils/apiHits.js"; const app = new OpenAPIHono({ strict: false }); const current: any = [ @@ -108,7 +109,7 @@ app.openapi( async (c) => { //const body = await c.req.json(); // make sure we have a vaid user being accessed thats really logged in - //apiHit(c, { endpoint: `api/logger/logs/id` }); + apiHit(c, { endpoint: "/getavalibleaquerys" }); return c.json({ success: true, diff --git a/server/services/dataMart/route/getCustomerInv.ts b/server/services/dataMart/route/getCustomerInv.ts index 10951ab..ab39077 100644 --- a/server/services/dataMart/route/getCustomerInv.ts +++ b/server/services/dataMart/route/getCustomerInv.ts @@ -3,6 +3,7 @@ import { responses } from "../../../globalUtils/routeDefs/responses.js"; import { tryCatch } from "../../../globalUtils/tryCatch.js"; import { getINV } from "../controller/getinventory.js"; import { getCurrentCustomerInv } from "../controller/getCustomerInventory.js"; +import { apiHit } from "../../../globalUtils/apiHits.js"; const app = new OpenAPIHono({ strict: false }); const Body = z.object({ @@ -27,7 +28,7 @@ app.openapi( const customer: string = c.req.query("customer") ?? ""; // make sure we have a vaid user being accessed thats really logged in - //apiHit(c, { endpoint: `api/logger/logs/id` }); + apiHit(c, { endpoint: "/getcustomerinventory" }); const { data, error } = await tryCatch( getCurrentCustomerInv(customer ? customer : null) ); diff --git a/server/services/dataMart/route/getDeliveryDateByRange.ts b/server/services/dataMart/route/getDeliveryDateByRange.ts index 85543c2..e96ff6e 100644 --- a/server/services/dataMart/route/getDeliveryDateByRange.ts +++ b/server/services/dataMart/route/getDeliveryDateByRange.ts @@ -2,6 +2,7 @@ import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi"; import { responses } from "../../../globalUtils/routeDefs/responses.js"; import { tryCatch } from "../../../globalUtils/tryCatch.js"; import { getDeliveryByDateRange } from "../controller/getDeliveryByDateRange.js"; +import { apiHit } from "../../../globalUtils/apiHits.js"; const app = new OpenAPIHono({ strict: false }); const Body = z.object({ @@ -26,7 +27,7 @@ app.openapi( const delivery: any = c.req.queries(); // make sure we have a vaid user being accessed thats really logged in - //apiHit(c, { endpoint: `api/logger/logs/id` }); + apiHit(c, { endpoint: "/deliverybydaterange" }); const { data, error } = await tryCatch( getDeliveryByDateRange(delivery ? delivery : null) ); diff --git a/server/services/dataMart/route/getInventory.ts b/server/services/dataMart/route/getInventory.ts index 926c146..2d9f6fb 100644 --- a/server/services/dataMart/route/getInventory.ts +++ b/server/services/dataMart/route/getInventory.ts @@ -2,6 +2,7 @@ import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi"; import { responses } from "../../../globalUtils/routeDefs/responses.js"; import { tryCatch } from "../../../globalUtils/tryCatch.js"; import { getINV } from "../controller/getinventory.js"; +import { apiHit } from "../../../globalUtils/apiHits.js"; const app = new OpenAPIHono({ strict: false }); const Body = z.object({ @@ -27,7 +28,7 @@ app.openapi( c.req.query("includeRunnningNumbers") ?? ""; // make sure we have a vaid user being accessed thats really logged in - //apiHit(c, { endpoint: `api/logger/logs/id` }); + apiHit(c, { endpoint: "/getinventory" }); const { data, error } = await tryCatch( getINV(includeRunnningNumbers?.length > 0 ? true : false) ); diff --git a/server/services/dataMart/route/getOpenOrders.ts b/server/services/dataMart/route/getOpenOrders.ts index fd0396f..925f0f9 100644 --- a/server/services/dataMart/route/getOpenOrders.ts +++ b/server/services/dataMart/route/getOpenOrders.ts @@ -2,6 +2,7 @@ import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi"; import { responses } from "../../../globalUtils/routeDefs/responses.js"; import { tryCatch } from "../../../globalUtils/tryCatch.js"; import { getOpenOrders } from "../controller/getOpenOrders.js"; +import { apiHit } from "../../../globalUtils/apiHits.js"; const app = new OpenAPIHono({ strict: false }); // const Body = z.object({ @@ -26,7 +27,7 @@ app.openapi( const customer: any = c.req.queries(); // make sure we have a vaid user being accessed thats really logged in - //apiHit(c, { endpoint: `api/logger/logs/id` }); + apiHit(c, { endpoint: "/getopenorders" }); const { data, error } = await tryCatch( getOpenOrders(customer ? customer : null) ); diff --git a/server/services/eom/route/invHistory.ts b/server/services/eom/route/invHistory.ts index 661877e..bb7a420 100644 --- a/server/services/eom/route/invHistory.ts +++ b/server/services/eom/route/invHistory.ts @@ -23,7 +23,7 @@ app.openapi( async (c) => { //const body = await c.req.json(); // make sure we have a vaid user being accessed thats really logged in - //apiHit(c, { endpoint: `api/logger/logs/id` }); + apiHit(c, { endpoint: "/histinv" }); try { return c.json({ success: true, message: "", data: [] }, 200); } catch (error) { diff --git a/server/services/eom/route/stats.ts b/server/services/eom/route/stats.ts index 6e11792..9ed3a30 100644 --- a/server/services/eom/route/stats.ts +++ b/server/services/eom/route/stats.ts @@ -23,7 +23,7 @@ app.openapi( async (c) => { //const body = await c.req.json(); // make sure we have a vaid user being accessed thats really logged in - apiHit(c, { endpoint: `api/logger/logs/id` }); + apiHit(c, { endpoint: "/stats" }); try { return c.json({ success: true, message: "", data: [] }, 200); } catch (error) { diff --git a/server/services/logistics/route/consumeMaterial.ts b/server/services/logistics/route/consumeMaterial.ts index 8ccf6bb..a1d26a1 100644 --- a/server/services/logistics/route/consumeMaterial.ts +++ b/server/services/logistics/route/consumeMaterial.ts @@ -4,6 +4,7 @@ import { apiHit } from "../../../globalUtils/apiHits.js"; import { verify } from "hono/jwt"; import { consumeMaterial } from "../controller/materials/consumeMaterial.js"; +import { tryCatch } from "../../../globalUtils/tryCatch.js"; const app = new OpenAPIHono(); @@ -37,7 +38,19 @@ app.openapi( }, }), async (c) => { - apiHit(c, { endpoint: "api/sqlProd/close" }); + const { data, error } = await tryCatch(c.req.json()); + + if (error) { + return c.json( + { + success: false, + message: "Missing data please try again", + error, + }, + 400 + ); + } + apiHit(c, { endpoint: "/consume", lastBody: data }); const authHeader = c.req.header("Authorization"); const token = authHeader?.split("Bearer ")[1] || ""; @@ -45,7 +58,7 @@ app.openapi( const payload = await verify(token, process.env.JWT_SECRET!); try { //return apiReturn(c, true, access?.message, access?.data, 200); - const data = await c.req.json(); + const consume = await consumeMaterial(data, payload); return c.json( { success: consume?.success, message: consume?.message }, diff --git a/server/services/logistics/route/dm/bulkOrdersIn.ts b/server/services/logistics/route/dm/bulkOrdersIn.ts index 862a240..810926c 100644 --- a/server/services/logistics/route/dm/bulkOrdersIn.ts +++ b/server/services/logistics/route/dm/bulkOrdersIn.ts @@ -3,6 +3,7 @@ import { responses } from "../../../../globalUtils/routeDefs/responses.js"; import { ordersIn } from "../../controller/dm/ordersIn/ordersIn.js"; import { verify } from "hono/jwt"; import { tryCatch } from "../../../../globalUtils/tryCatch.js"; +import { apiHit } from "../../../../globalUtils/apiHits.js"; const app = new OpenAPIHono(); @@ -31,7 +32,7 @@ app.openapi( responses: responses(), }), async (c) => { - //apiHit(c, { endpoint: "api/sqlProd/close" }); + apiHit(c, { endpoint: "/postbulkorders" }); const body = await c.req.parseBody(); const authHeader = c.req.header("Authorization"); const token = authHeader?.split("Bearer ")[1] || ""; diff --git a/server/services/logistics/route/dm/forecastIn.ts b/server/services/logistics/route/dm/forecastIn.ts index b9a78a0..6a37c52 100644 --- a/server/services/logistics/route/dm/forecastIn.ts +++ b/server/services/logistics/route/dm/forecastIn.ts @@ -4,6 +4,7 @@ import { ordersIn } from "../../controller/dm/ordersIn/ordersIn.js"; import { verify } from "hono/jwt"; import { forecastIn } from "../../controller/dm/forecast/forecastIn.js"; import { tryCatch } from "../../../../globalUtils/tryCatch.js"; +import { apiHit } from "../../../../globalUtils/apiHits.js"; const app = new OpenAPIHono(); @@ -32,7 +33,7 @@ app.openapi( responses: responses(), }), async (c) => { - //apiHit(c, { endpoint: "api/sqlProd/close" }); + apiHit(c, { endpoint: "/postforecastin" }); const body = await c.req.parseBody(); const authHeader = c.req.header("Authorization"); const token = authHeader?.split("Bearer ")[1] || ""; diff --git a/server/services/logistics/route/dm/getStandardForecastTemplate.ts b/server/services/logistics/route/dm/getStandardForecastTemplate.ts index 90ff079..80f994b 100644 --- a/server/services/logistics/route/dm/getStandardForecastTemplate.ts +++ b/server/services/logistics/route/dm/getStandardForecastTemplate.ts @@ -4,6 +4,7 @@ import { responses } from "../../../../globalUtils/routeDefs/responses.js"; import { standardTemplate } from "../../controller/dm/ordersIn/createTemplate.js"; import { tryCatch } from "../../../../globalUtils/tryCatch.js"; import { standardForCastTemplate } from "../../controller/dm/forecast/createTemplate.js"; +import { apiHit } from "../../../../globalUtils/apiHits.js"; const app = new OpenAPIHono(); @@ -32,7 +33,7 @@ app.openapi( responses: responses(), }), async (c: any) => { - //apiHit(c, { endpoint: "api/sqlProd/close" }); + apiHit(c, { endpoint: "/bulkforcasttemplate" }); const defaultFilename = `bulkForcastTemplate-${format( new Date(Date.now()), "M-d-yyyy" diff --git a/server/services/logistics/route/dm/getStandardTemplate.ts b/server/services/logistics/route/dm/getStandardTemplate.ts index 1a9e9c6..5ee9d3d 100644 --- a/server/services/logistics/route/dm/getStandardTemplate.ts +++ b/server/services/logistics/route/dm/getStandardTemplate.ts @@ -3,6 +3,7 @@ import { format } from "date-fns"; import { responses } from "../../../../globalUtils/routeDefs/responses.js"; import { standardTemplate } from "../../controller/dm/ordersIn/createTemplate.js"; import { tryCatch } from "../../../../globalUtils/tryCatch.js"; +import { apiHit } from "../../../../globalUtils/apiHits.js"; const app = new OpenAPIHono(); @@ -31,7 +32,7 @@ app.openapi( responses: responses(), }), async (c: any) => { - //apiHit(c, { endpoint: "api/sqlProd/close" }); + apiHit(c, { endpoint: "/bulkorderstemplate" }); const defaultFilename = `bulkOrdersInTemplate-${format( new Date(Date.now()), "M-d-yyyy" diff --git a/server/services/logistics/route/getCycleCountChecks.ts b/server/services/logistics/route/getCycleCountChecks.ts index 6d2db34..b65fee1 100644 --- a/server/services/logistics/route/getCycleCountChecks.ts +++ b/server/services/logistics/route/getCycleCountChecks.ts @@ -2,6 +2,7 @@ import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi"; import { responses } from "../../../globalUtils/routeDefs/responses.js"; import { tryCatch } from "../../../globalUtils/tryCatch.js"; import { getCycleCountCheck } from "../controller/warehouse/cycleCountChecks/getCycleCountCheck.js"; +import { apiHit } from "../../../globalUtils/apiHits.js"; const app = new OpenAPIHono(); @@ -30,7 +31,7 @@ app.openapi( responses: responses(), }), async (c: any) => { - //apiHit(c, { endpoint: "api/sqlProd/close" }); + apiHit(c, { endpoint: "/cyclecountcheck" }); const { data: body, error: be } = await tryCatch(c.req.json()); if (be) { diff --git a/server/services/logistics/route/getCycleCountLanes.ts b/server/services/logistics/route/getCycleCountLanes.ts index 161f7e9..52cac97 100644 --- a/server/services/logistics/route/getCycleCountLanes.ts +++ b/server/services/logistics/route/getCycleCountLanes.ts @@ -3,6 +3,7 @@ import { responses } from "../../../globalUtils/routeDefs/responses.js"; import { tryCatch } from "../../../globalUtils/tryCatch.js"; import { lanesToExcel } from "../controller/warehouse/cycleCountChecks/exportCycleCountData.js"; import { format } from "date-fns"; +import { apiHit } from "../../../globalUtils/apiHits.js"; const app = new OpenAPIHono(); @@ -31,7 +32,7 @@ app.openapi( responses: responses(), }), async (c: any) => { - //apiHit(c, { endpoint: "api/sqlProd/close" }); + apiHit(c, { endpoint: "/getcyclecount" }); const defaultFilename = `cycleCount-${format( new Date(Date.now()), "M-d-yyyy" diff --git a/server/services/logistics/route/getOutbound.ts b/server/services/logistics/route/getOutbound.ts index 14785ab..04342db 100644 --- a/server/services/logistics/route/getOutbound.ts +++ b/server/services/logistics/route/getOutbound.ts @@ -3,6 +3,7 @@ import { responses } from "../../../globalUtils/routeDefs/responses.js"; import { tryCatch } from "../../../globalUtils/tryCatch.js"; import { getCycleCountCheck } from "../controller/warehouse/cycleCountChecks/getCycleCountCheck.js"; import { getPPOO } from "../controller/warehouse/ppoo/getPPOO.js"; +import { apiHit } from "../../../globalUtils/apiHits.js"; const app = new OpenAPIHono(); @@ -31,7 +32,7 @@ app.openapi( responses: responses(), }), async (c: any) => { - //apiHit(c, { endpoint: "api/sqlProd/close" }); + apiHit(c, { endpoint: "/outbound" }); const body = await c.req.json(); diff --git a/server/services/logistics/route/getPPOO.ts b/server/services/logistics/route/getPPOO.ts index a6f5b7a..3cba75f 100644 --- a/server/services/logistics/route/getPPOO.ts +++ b/server/services/logistics/route/getPPOO.ts @@ -3,6 +3,7 @@ import { responses } from "../../../globalUtils/routeDefs/responses.js"; import { tryCatch } from "../../../globalUtils/tryCatch.js"; import { getCycleCountCheck } from "../controller/warehouse/cycleCountChecks/getCycleCountCheck.js"; import { getPPOO } from "../controller/warehouse/ppoo/getPPOO.js"; +import { apiHit } from "../../../globalUtils/apiHits.js"; const app = new OpenAPIHono(); @@ -31,7 +32,7 @@ app.openapi( responses: responses(), }), async (c: any) => { - //apiHit(c, { endpoint: "api/sqlProd/close" }); + apiHit(c, { endpoint: "/getppoo" }); const { data: ppoo, error } = await tryCatch(getPPOO()); diff --git a/server/services/logistics/route/returnMaterial.ts b/server/services/logistics/route/returnMaterial.ts index 31d2054..219263e 100644 --- a/server/services/logistics/route/returnMaterial.ts +++ b/server/services/logistics/route/returnMaterial.ts @@ -3,6 +3,7 @@ import { authMiddleware } from "../../auth/middleware/authMiddleware.js"; import { apiHit } from "../../../globalUtils/apiHits.js"; import { verify } from "hono/jwt"; import { returnMaterial } from "../controller/materials/returnMaterial.js"; +import { tryCatch } from "../../../globalUtils/tryCatch.js"; const app = new OpenAPIHono(); @@ -36,7 +37,19 @@ app.openapi( }, }), async (c) => { - apiHit(c, { endpoint: "api/sqlProd/close" }); + const { data, error } = await tryCatch(c.req.json()); + + if (error) { + return c.json( + { + success: false, + message: "Missing data please try again", + error, + }, + 400 + ); + } + apiHit(c, { endpoint: "/return", lastBody: data }); const authHeader = c.req.header("Authorization"); const token = authHeader?.split("Bearer ")[1] || ""; @@ -44,7 +57,7 @@ app.openapi( const payload = await verify(token, process.env.JWT_SECRET!); try { //return apiReturn(c, true, access?.message, access?.data, 200); - const data = await c.req.json(); + const consume = await returnMaterial(data, payload); return c.json( { success: consume?.success, message: consume?.message }, diff --git a/server/services/logistics/route/siloAdjustments/createSiloAdjustment.ts b/server/services/logistics/route/siloAdjustments/createSiloAdjustment.ts index a953cf7..5a0b5f6 100644 --- a/server/services/logistics/route/siloAdjustments/createSiloAdjustment.ts +++ b/server/services/logistics/route/siloAdjustments/createSiloAdjustment.ts @@ -3,6 +3,8 @@ import { verify } from "hono/jwt"; import { authMiddleware } from "../../../auth/middleware/authMiddleware.js"; import { responses } from "../../../../globalUtils/routeDefs/responses.js"; import { createSiloAdjustment } from "../../controller/siloAdjustments/createSiloAdjustment.js"; +import { apiHit } from "../../../../globalUtils/apiHits.js"; +import { tryCatch } from "../../../../globalUtils/tryCatch.js"; const app = new OpenAPIHono(); @@ -23,7 +25,19 @@ app.openapi( responses: responses(), }), async (c) => { - //apiHit(c, { endpoint: "api/sqlProd/close" }); + const { data, error } = await tryCatch(c.req.json()); + + if (error) { + return c.json( + { + success: false, + message: "Missing data please try again", + error, + }, + 400 + ); + } + apiHit(c, { endpoint: "/createsiloadjustment", lastBody: data }); const authHeader = c.req.header("Authorization"); const token = authHeader?.split("Bearer ")[1] || ""; @@ -31,7 +45,6 @@ app.openapi( const payload = await verify(token, process.env.JWT_SECRET!); try { //return apiReturn(c, true, access?.message, access?.data, 200); - const data = await c.req.json(); const createSiloAdj = await createSiloAdjustment( data, payload.user diff --git a/server/services/logistics/route/siloAdjustments/getSiloAdjustments.ts b/server/services/logistics/route/siloAdjustments/getSiloAdjustments.ts index 32fd585..e4bed66 100644 --- a/server/services/logistics/route/siloAdjustments/getSiloAdjustments.ts +++ b/server/services/logistics/route/siloAdjustments/getSiloAdjustments.ts @@ -4,6 +4,7 @@ import { tryCatch } from "../../../../globalUtils/tryCatch.js"; import { getOpenOrders } from "../../../dataMart/controller/getOpenOrders.js"; import axios from "axios"; import { getSiloAdjustments } from "../../controller/siloAdjustments/getSiloAdjustments.js"; +import { apiHit } from "../../../../globalUtils/apiHits.js"; const app = new OpenAPIHono({ strict: false }); // const Body = z.object({ @@ -26,6 +27,7 @@ app.openapi( }), async (c: any) => { const customer: any = c.req.queries(); + apiHit(c, { endpoint: "/getsilosdjustment" }); // make sure we have a vaid user being accessed thats really logged in //apiHit(c, { endpoint: `api/logger/logs/id` }); diff --git a/server/services/logistics/route/siloAdjustments/getStockData.ts b/server/services/logistics/route/siloAdjustments/getStockData.ts index 2eac371..28cddad 100644 --- a/server/services/logistics/route/siloAdjustments/getStockData.ts +++ b/server/services/logistics/route/siloAdjustments/getStockData.ts @@ -2,6 +2,7 @@ import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi"; import { authMiddleware } from "../../../auth/middleware/authMiddleware.js"; import { responses } from "../../../../globalUtils/routeDefs/responses.js"; import { getStockSiloData } from "../../controller/siloAdjustments/getCurrentStockSiloData.js"; +import { apiHit } from "../../../../globalUtils/apiHits.js"; const app = new OpenAPIHono(); @@ -21,7 +22,7 @@ app.openapi( responses: responses(), }), async (c: any) => { - //apiHit(c, { endpoint: "api/sqlProd/close" }); + apiHit(c, { endpoint: "/getstocksilo" }); try { //return apiReturn(c, true, access?.message, access?.data, 200); diff --git a/server/services/logistics/route/siloAdjustments/postComment.ts b/server/services/logistics/route/siloAdjustments/postComment.ts index 9390a41..bedd559 100644 --- a/server/services/logistics/route/siloAdjustments/postComment.ts +++ b/server/services/logistics/route/siloAdjustments/postComment.ts @@ -4,6 +4,7 @@ import { authMiddleware } from "../../../auth/middleware/authMiddleware.js"; import { responses } from "../../../../globalUtils/routeDefs/responses.js"; import { createSiloAdjustment } from "../../controller/siloAdjustments/createSiloAdjustment.js"; import { postSiloComment } from "../../controller/siloAdjustments/postComment.js"; +import { apiHit } from "../../../../globalUtils/apiHits.js"; const app = new OpenAPIHono(); @@ -42,7 +43,7 @@ app.openapi( responses: responses(), }), async (c: any) => { - //apiHit(c, { endpoint: "api/sqlProd/close" }); + apiHit(c, { endpoint: "/postcomment" }); const authHeader = c.req.header("Authorization"); const token = authHeader?.split("Bearer ")[1] || ""; const { adjId } = c.req.valid("param"); diff --git a/server/services/notifications/routes/getActiveNotifications.ts b/server/services/notifications/routes/getActiveNotifications.ts index 530481e..04ae043 100644 --- a/server/services/notifications/routes/getActiveNotifications.ts +++ b/server/services/notifications/routes/getActiveNotifications.ts @@ -2,6 +2,7 @@ import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi"; import { responses } from "../../../globalUtils/routeDefs/responses.js"; import { getAllJobs } from "../utils/processNotifications.js"; +import { apiHit } from "../../../globalUtils/apiHits.js"; const app = new OpenAPIHono({ strict: false }); @@ -15,6 +16,7 @@ app.openapi( responses: responses(), }), async (c) => { + apiHit(c, { endpoint: "/activenotifications" }); const jobs = getAllJobs(); return c.json({ success: true, diff --git a/server/services/notifications/routes/getNotifications.ts b/server/services/notifications/routes/getNotifications.ts index da53f90..cad1b68 100644 --- a/server/services/notifications/routes/getNotifications.ts +++ b/server/services/notifications/routes/getNotifications.ts @@ -4,6 +4,7 @@ import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi"; import { responses } from "../../../globalUtils/routeDefs/responses.js"; import { getNotifications } from "../controller/getNotifications.js"; import { tryCatch } from "../../../globalUtils/tryCatch.js"; +import { apiHit } from "../../../globalUtils/apiHits.js"; const app = new OpenAPIHono({ strict: false }); @@ -18,7 +19,7 @@ app.openapi( responses: responses(), }), async (c: any) => { - //apiHit(c, { endpoint: `api/logger/logs` }); + apiHit(c, { endpoint: "/notifications" }); const { data, error } = await tryCatch(getNotifications()); if (error) { diff --git a/server/services/notifications/routes/manualTiggerTi.ts b/server/services/notifications/routes/manualTiggerTi.ts index a81d2f5..c0f0eb4 100644 --- a/server/services/notifications/routes/manualTiggerTi.ts +++ b/server/services/notifications/routes/manualTiggerTi.ts @@ -3,6 +3,7 @@ import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi"; import { responses } from "../../../globalUtils/routeDefs/responses.js"; import runTiImport from "../controller/notifications/tiIntergration.js"; +import { apiHit } from "../../../globalUtils/apiHits.js"; const app = new OpenAPIHono({ strict: false }); @@ -16,6 +17,7 @@ app.openapi( responses: responses(), }), async (c) => { + apiHit(c, { endpoint: "/tiTrigger" }); const tiImport = await runTiImport(); return c.json({ success: tiImport?.success, diff --git a/server/services/notifications/routes/qualityBlocking.ts b/server/services/notifications/routes/qualityBlocking.ts index 97ba258..d2c075b 100644 --- a/server/services/notifications/routes/qualityBlocking.ts +++ b/server/services/notifications/routes/qualityBlocking.ts @@ -8,6 +8,7 @@ import { tryCatch } from "../../../globalUtils/tryCatch.js"; import { notifications } from "../../../../database/schema/notifications.js"; import { db } from "../../../../database/dbclient.js"; import { eq } from "drizzle-orm"; +import { apiHit } from "../../../globalUtils/apiHits.js"; const app = new OpenAPIHono({ strict: false }); @@ -24,7 +25,7 @@ app.openapi( /** * get the blocking notification stuff */ - + apiHit(c, { endpoint: "/blockingTrigger" }); const { data, error } = await tryCatch( db .select() diff --git a/server/services/notifications/routes/sendMail.ts b/server/services/notifications/routes/sendMail.ts index 67fdce6..b71ef0e 100644 --- a/server/services/notifications/routes/sendMail.ts +++ b/server/services/notifications/routes/sendMail.ts @@ -4,6 +4,7 @@ import { responses } from "../../../globalUtils/routeDefs/responses.js"; import { authMiddleware } from "../../auth/middleware/authMiddleware.js"; import { sendEmail } from "../controller/sendMail.js"; import { tryCatch } from "../../../globalUtils/tryCatch.js"; +import { apiHit } from "../../../globalUtils/apiHits.js"; const app = new OpenAPIHono({ strict: false }); @@ -41,6 +42,7 @@ app.openapi( const { data: bodyData, error: bodyError } = await tryCatch( c.req.json() ); + apiHit(c, { endpoint: "/sendmail", lastBody: bodyData }); if (bodyError) { return c.json( { diff --git a/server/services/ocme/route/cycleCount.ts b/server/services/ocme/route/cycleCount.ts index 7326da7..e27fb1a 100644 --- a/server/services/ocme/route/cycleCount.ts +++ b/server/services/ocme/route/cycleCount.ts @@ -30,10 +30,9 @@ app.openapi( responses: responses(), }), async (c) => { - apiHit(c, { endpoint: "api/auth/register" }); // make sure we have a vaid user being accessed thats really logged in const body = await c.req.json(); - + apiHit(c, { endpoint: "/cycleCount", lastBody: body }); const authHeader = c.req.header("Authorization"); const token = authHeader?.split("Bearer ")[1] || ""; diff --git a/server/services/ocme/route/getInfo.ts b/server/services/ocme/route/getInfo.ts index 35da0b4..8c16a3f 100644 --- a/server/services/ocme/route/getInfo.ts +++ b/server/services/ocme/route/getInfo.ts @@ -16,7 +16,7 @@ app.openapi( }), async (c) => { // make sure we have a vaid user being accessed thats really logged in - apiHit(c, { endpoint: "api/auth/register" }); + apiHit(c, { endpoint: "/getInfo" }); try { return c.json( { success: true, message: "Ocme Info", data: await getInfo() }, diff --git a/server/services/ocme/route/getShipmentPallets.ts b/server/services/ocme/route/getShipmentPallets.ts index 32e727d..6839dda 100644 --- a/server/services/ocme/route/getShipmentPallets.ts +++ b/server/services/ocme/route/getShipmentPallets.ts @@ -5,110 +5,114 @@ import { getShipmentPallets } from "../controller/getShipmentPallets.js"; const app = new OpenAPIHono(); const ShipmentID = z.object({ - shipmentID: z.string().optional().openapi({ example: "14558" }), + shipmentID: z.string().optional().openapi({ example: "14558" }), }); app.openapi( - createRoute({ - tags: ["ocme"], - summary: "Post New running number to be picked up.", - method: "post", - path: "/GetShipmentPallets", - request: { - body: { - content: { - "application/json": { schema: ShipmentID }, + createRoute({ + tags: ["ocme"], + summary: "Post New running number to be picked up.", + method: "post", + path: "/GetShipmentPallets", + request: { + body: { + content: { + "application/json": { schema: ShipmentID }, + }, + }, }, - }, - }, - responses: { - 200: { - content: { - "application/json": { - schema: z.object({ - success: z.boolean().openapi({ example: true }), - message: z.string().openapi({ example: "Starter" }), - // data: z - // .array(z.object({sscc: z.string().optional()})) - // .optional() - // .openapi({example: []}), - }), - }, + responses: { + 200: { + content: { + "application/json": { + schema: z.object({ + success: z.boolean().openapi({ example: true }), + message: z.string().openapi({ example: "Starter" }), + // data: z + // .array(z.object({sscc: z.string().optional()})) + // .optional() + // .openapi({example: []}), + }), + }, + }, + description: "Response message", + }, + 400: { + content: { + "application/json": { + schema: z.object({ + success: z.boolean().openapi({ example: false }), + message: z + .string() + .optional() + .openapi({ example: "Internal Server error" }), + data: z + .array(z.object({})) + .optional() + .openapi({ example: [] }), + }), + }, + }, + description: "Internal Server Error", + }, + // 401: { + // content: { + // "application/json": { + // schema: z.object({message: z.string().optional().openapi({example: "Unauthenticated"})}), + // }, + // }, + // description: "Unauthorized", + // }, + // 500: { + // content: { + // "application/json": { + // schema: z.object({message: z.string().optional().openapi({example: "Internal Server error"})}), + // }, + // }, + // description: "Internal Server Error", + // }, }, - description: "Response message", - }, - 400: { - content: { - "application/json": { - schema: z.object({ - success: z.boolean().openapi({ example: false }), - message: z - .string() - .optional() - .openapi({ example: "Internal Server error" }), - data: z.array(z.object({})).optional().openapi({ example: [] }), - }), - }, - }, - description: "Internal Server Error", - }, - // 401: { - // content: { - // "application/json": { - // schema: z.object({message: z.string().optional().openapi({example: "Unauthenticated"})}), - // }, - // }, - // description: "Unauthorized", - // }, - // 500: { - // content: { - // "application/json": { - // schema: z.object({message: z.string().optional().openapi({example: "Internal Server error"})}), - // }, - // }, - // description: "Internal Server Error", - // }, - }, - }), - async (c) => { - // make sure we have a vaid user being accessed thats really logged in - try { - const data = await c.req.json(); - apiHit(c, { endpoint: "api/ocme/getshipmentpallets", lastBody: data }); + }), + async (c) => { + // make sure we have a vaid user being accessed thats really logged in + try { + const data = await c.req.json(); + apiHit(c, { endpoint: "/getshipmentpallets", lastBody: data }); - console.log; + console.log; - if (!data.shipmentID) { - return c.json( - { - success: false, - message: "You are missing the shipment id please try again.", - data: [], - }, - 400 - ); - } + if (!data.shipmentID) { + return c.json( + { + success: false, + message: + "You are missing the shipment id please try again.", + data: [], + }, + 400 + ); + } - const shiptmentData = await getShipmentPallets(data.shipmentID); + const shiptmentData = await getShipmentPallets(data.shipmentID); - return c.json( - { - success: shiptmentData.success, - message: shiptmentData.message, - data: shiptmentData.data ?? [], - }, - 200 - ); - } catch (error) { - return c.json( - { - success: false, - message: "There was an error getting the shipment data.", - data: error, - }, - 400 - ); + return c.json( + { + success: shiptmentData.success, + message: shiptmentData.message, + data: shiptmentData.data ?? [], + }, + 200 + ); + } catch (error) { + return c.json( + { + success: false, + message: "There was an error getting the shipment data.", + data: error, + }, + 400 + ); + } } - } ); export default app; diff --git a/server/services/ocme/route/pickedUp.ts b/server/services/ocme/route/pickedUp.ts index 856a8e4..2d1b923 100644 --- a/server/services/ocme/route/pickedUp.ts +++ b/server/services/ocme/route/pickedUp.ts @@ -6,109 +6,112 @@ import { pickedup } from "../controller/pickedup.js"; const app = new OpenAPIHono(); const PostRunningNr = z.object({ - sscc: z.string().optional().openapi({ example: "00090103830005710997" }), - runningNr: z.string().optional().openapi({ example: "localhost" }), - areaFrom: z - .string() - .optional() - .openapi({ example: "The server we are going to connect to" }), - completed: z.boolean().optional().openapi({ example: true }), - all: z.boolean().optional().openapi({ example: false }), + sscc: z.string().optional().openapi({ example: "00090103830005710997" }), + runningNr: z.string().optional().openapi({ example: "localhost" }), + areaFrom: z + .string() + .optional() + .openapi({ example: "The server we are going to connect to" }), + completed: z.boolean().optional().openapi({ example: true }), + all: z.boolean().optional().openapi({ example: false }), }); app.openapi( - createRoute({ - tags: ["ocme"], - summary: "Picks up a pallet in the system.", - method: "patch", - description: - "removes the pallet(s) from showing as needed to be picked up, we clear everything related to the pallet number to reduce the risk of a mix, passing `all` will just clear everything that is pending.", - path: "/pickedUp", - request: { - body: { - content: { - "application/json": { schema: PostRunningNr }, + createRoute({ + tags: ["ocme"], + summary: "Picks up a pallet in the system.", + method: "patch", + description: + "removes the pallet(s) from showing as needed to be picked up, we clear everything related to the pallet number to reduce the risk of a mix, passing `all` will just clear everything that is pending.", + path: "/pickedUp", + request: { + body: { + content: { + "application/json": { schema: PostRunningNr }, + }, + }, }, - }, - }, - responses: { - 200: { - content: { - "application/json": { - schema: z.object({ - success: z.boolean().openapi({ example: true }), - message: z.string().openapi({ example: "Starter" }), - // data: z - // .array(z.object({sscc: z.string().optional()})) - // .optional() - // .openapi({example: []}), - }), - }, + responses: { + 200: { + content: { + "application/json": { + schema: z.object({ + success: z.boolean().openapi({ example: true }), + message: z.string().openapi({ example: "Starter" }), + // data: z + // .array(z.object({sscc: z.string().optional()})) + // .optional() + // .openapi({example: []}), + }), + }, + }, + description: "Response message", + }, + 400: { + content: { + "application/json": { + schema: z.object({ + success: z.boolean().openapi({ example: false }), + message: z + .string() + .optional() + .openapi({ example: "Internal Server error" }), + data: z + .array(z.object({})) + .optional() + .openapi({ example: [] }), + }), + }, + }, + description: "Internal Server Error", + }, + // 401: { + // content: { + // "application/json": { + // schema: z.object({message: z.string().optional().openapi({example: "Unauthenticated"})}), + // }, + // }, + // description: "Unauthorized", + // }, + 500: { + content: { + "application/json": { + schema: z.object({ + message: z + .string() + .optional() + .openapi({ example: "Internal Server error" }), + }), + }, + }, + description: "Internal Server Error", + }, }, - description: "Response message", - }, - 400: { - content: { - "application/json": { - schema: z.object({ - success: z.boolean().openapi({ example: false }), - message: z - .string() - .optional() - .openapi({ example: "Internal Server error" }), - data: z.array(z.object({})).optional().openapi({ example: [] }), - }), - }, - }, - description: "Internal Server Error", - }, - // 401: { - // content: { - // "application/json": { - // schema: z.object({message: z.string().optional().openapi({example: "Unauthenticated"})}), - // }, - // }, - // description: "Unauthorized", - // }, - 500: { - content: { - "application/json": { - schema: z.object({ - message: z - .string() - .optional() - .openapi({ example: "Internal Server error" }), - }), - }, - }, - description: "Internal Server Error", - }, - }, - }), - async (c) => { - // make sure we have a vaid user being accessed thats really logged in - try { - const data = await c.req.json(); - apiHit(c, { endpoint: "api/ocme/pickedup", lastBody: data }); - const postPallet = await pickedup(data); - return c.json( - { - success: postPallet.success, - message: postPallet.message, - data: postPallet.data, - }, - 200 - ); - } catch (error) { - return c.json( - { - success: false, - message: "There was an error getting ocmeInfo data", - data: error, - }, - 400 - ); + }), + async (c) => { + // make sure we have a vaid user being accessed thats really logged in + try { + const data = await c.req.json(); + apiHit(c, { endpoint: "/pickedup", lastBody: data }); + const postPallet = await pickedup(data); + return c.json( + { + success: postPallet.success, + message: postPallet.message, + data: postPallet.data, + }, + 200 + ); + } catch (error) { + return c.json( + { + success: false, + message: "There was an error getting ocmeInfo data", + data: error, + }, + 400 + ); + } } - } ); export default app; diff --git a/server/services/ocme/route/postRunningNumber.ts b/server/services/ocme/route/postRunningNumber.ts index e04c242..da1cf1f 100644 --- a/server/services/ocme/route/postRunningNumber.ts +++ b/server/services/ocme/route/postRunningNumber.ts @@ -85,7 +85,7 @@ app.openapi( try { const data = await c.req.json(); apiHit(c, { - endpoint: "api/ocme/postRunningNumber", + endpoint: "/postRunningNumber", lastBody: data, }); const postPallet: any = await postLabelData(data); diff --git a/server/services/ocme/route/postSSCC.ts b/server/services/ocme/route/postSSCC.ts index 7e4ab4b..6abe924 100644 --- a/server/services/ocme/route/postSSCC.ts +++ b/server/services/ocme/route/postSSCC.ts @@ -6,101 +6,104 @@ import { apiHit } from "../../../globalUtils/apiHits.js"; const app = new OpenAPIHono(); const PostRunningNr = z.object({ - sscc: z.string().optional().openapi({ example: "00090103830005710997" }), - runningNr: z.string().optional().openapi({ example: "localhost" }), - areaFrom: z - .string() - .optional() - .openapi({ example: "The server we are going to connect to" }), - completed: z.boolean().optional().openapi({ example: true }), + sscc: z.string().optional().openapi({ example: "00090103830005710997" }), + runningNr: z.string().optional().openapi({ example: "localhost" }), + areaFrom: z + .string() + .optional() + .openapi({ example: "The server we are going to connect to" }), + completed: z.boolean().optional().openapi({ example: true }), }); app.openapi( - createRoute({ - tags: ["ocme"], - summary: "Post New running number to be picked up.", - method: "post", - path: "/postSSCC", - request: { - body: { - content: { - "application/json": { schema: PostRunningNr }, + createRoute({ + tags: ["ocme"], + summary: "Post New running number to be picked up.", + method: "post", + path: "/postSSCC", + request: { + body: { + content: { + "application/json": { schema: PostRunningNr }, + }, + }, }, - }, - }, - responses: { - 200: { - content: { - "application/json": { - schema: z.object({ - success: z.boolean().openapi({ example: true }), - message: z.string().openapi({ example: "Starter" }), - // data: z - // .array(z.object({sscc: z.string().optional()})) - // .optional() - // .openapi({example: []}), - }), - }, + responses: { + 200: { + content: { + "application/json": { + schema: z.object({ + success: z.boolean().openapi({ example: true }), + message: z.string().openapi({ example: "Starter" }), + // data: z + // .array(z.object({sscc: z.string().optional()})) + // .optional() + // .openapi({example: []}), + }), + }, + }, + description: "Response message", + }, + 400: { + content: { + "application/json": { + schema: z.object({ + success: z.boolean().openapi({ example: false }), + message: z + .string() + .optional() + .openapi({ example: "Internal Server error" }), + data: z + .array(z.object({})) + .optional() + .openapi({ example: [] }), + }), + }, + }, + description: "Internal Server Error", + }, + // 401: { + // content: { + // "application/json": { + // schema: z.object({message: z.string().optional().openapi({example: "Unauthenticated"})}), + // }, + // }, + // description: "Unauthorized", + // }, + // 500: { + // content: { + // "application/json": { + // schema: z.object({message: z.string().optional().openapi({example: "Internal Server error"})}), + // }, + // }, + // description: "Internal Server Error", + // }, }, - description: "Response message", - }, - 400: { - content: { - "application/json": { - schema: z.object({ - success: z.boolean().openapi({ example: false }), - message: z - .string() - .optional() - .openapi({ example: "Internal Server error" }), - data: z.array(z.object({})).optional().openapi({ example: [] }), - }), - }, - }, - description: "Internal Server Error", - }, - // 401: { - // content: { - // "application/json": { - // schema: z.object({message: z.string().optional().openapi({example: "Unauthenticated"})}), - // }, - // }, - // description: "Unauthorized", - // }, - // 500: { - // content: { - // "application/json": { - // schema: z.object({message: z.string().optional().openapi({example: "Internal Server error"})}), - // }, - // }, - // description: "Internal Server Error", - // }, - }, - }), - async (c) => { - // make sure we have a vaid user being accessed thats really logged in - try { - const data = await c.req.json(); - apiHit(c, { endpoint: "api/ocme/postRunningNumber", lastBody: data }); - const postPallet = await postLabelData(data); - return c.json( - { - success: postPallet.success, - message: postPallet.message, - data: postPallet.data ?? [], - }, - 200 - ); - } catch (error) { - return c.json( - { - success: false, - message: "There was an error getting ocmeInfo data", - data: error, - }, - 400 - ); + }), + async (c) => { + // make sure we have a vaid user being accessed thats really logged in + try { + const data = await c.req.json(); + apiHit(c, { endpoint: "/postRunningNumber", lastBody: data }); + const postPallet = await postLabelData(data); + return c.json( + { + success: postPallet.success, + message: postPallet.message, + data: postPallet.data ?? [], + }, + 200 + ); + } catch (error) { + return c.json( + { + success: false, + message: "There was an error getting ocmeInfo data", + data: error, + }, + 400 + ); + } } - } ); export default app; diff --git a/server/services/ocme/route/triggerCamera.ts b/server/services/ocme/route/triggerCamera.ts index 8745e5d..1410469 100644 --- a/server/services/ocme/route/triggerCamera.ts +++ b/server/services/ocme/route/triggerCamera.ts @@ -16,7 +16,7 @@ app.openapi( }), async (c) => { // make sure we have a vaid user being accessed thats really logged in - apiHit(c, { endpoint: "api/auth/register" }); + apiHit(c, { endpoint: "/manualCameraTrigger" }); const manualTrigger: any = await triggerScanner(); console.log(manualTrigger); return c.json({ diff --git a/server/services/ocp/routes/labeling/bookIn.ts b/server/services/ocp/routes/labeling/bookIn.ts index a12739e..903d4f3 100644 --- a/server/services/ocp/routes/labeling/bookIn.ts +++ b/server/services/ocp/routes/labeling/bookIn.ts @@ -5,6 +5,7 @@ import { tryCatch } from "../../../../globalUtils/tryCatch.js"; import { labelingProcess } from "../../controller/labeling/labelProcess.js"; import { bookInLabel } from "../../controller/labeling/bookIn.js"; import { createSSCC } from "../../../../globalUtils/createSSCC.js"; +import { apiHit } from "../../../../globalUtils/apiHits.js"; const app = new OpenAPIHono({ strict: false }); @@ -21,6 +22,7 @@ app.openapi( const { data: bodyData, error: bodyError } = await tryCatch( c.req.json() ); + apiHit(c, { endpoint: "/bookin", lastBody: bodyData }); if (bodyError) { return c.json({ diff --git a/server/services/ocp/routes/labeling/getLabels.ts b/server/services/ocp/routes/labeling/getLabels.ts index 4252293..c2648ad 100644 --- a/server/services/ocp/routes/labeling/getLabels.ts +++ b/server/services/ocp/routes/labeling/getLabels.ts @@ -3,6 +3,7 @@ import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi"; import { responses } from "../../../../globalUtils/routeDefs/responses.js"; import { tryCatch } from "../../../../globalUtils/tryCatch.js"; import { getLabels } from "../../controller/labeling/getLabels.js"; +import { apiHit } from "../../../../globalUtils/apiHits.js"; const app = new OpenAPIHono({ strict: false }); @@ -19,6 +20,7 @@ app.openapi( const { data: labelData, error: labelError } = await tryCatch( getLabels(hours ?? "2") ); + apiHit(c, { endpoint: "/getLabels" }); if (labelError) { return c.json({ diff --git a/server/services/ocp/routes/labeling/manualPrint.ts b/server/services/ocp/routes/labeling/manualPrint.ts index e89292f..b69f158 100644 --- a/server/services/ocp/routes/labeling/manualPrint.ts +++ b/server/services/ocp/routes/labeling/manualPrint.ts @@ -3,6 +3,7 @@ import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi"; import { responses } from "../../../../globalUtils/routeDefs/responses.js"; import { tryCatch } from "../../../../globalUtils/tryCatch.js"; import { labelingProcess } from "../../controller/labeling/labelProcess.js"; +import { apiHit } from "../../../../globalUtils/apiHits.js"; const app = new OpenAPIHono({ strict: false }); @@ -19,6 +20,7 @@ app.openapi( const { data: bodyData, error: bodyError } = await tryCatch( c.req.json() ); + apiHit(c, { endpoint: "/manualprintandfollow", lastBody: bodyData }); if (bodyError) { return c.json({ diff --git a/server/services/ocp/routes/labeling/manualPrintLog.ts b/server/services/ocp/routes/labeling/manualPrintLog.ts index 9b10e2c..309d479 100644 --- a/server/services/ocp/routes/labeling/manualPrintLog.ts +++ b/server/services/ocp/routes/labeling/manualPrintLog.ts @@ -34,7 +34,7 @@ app.openapi( }), async (c) => { const { data: body, error } = await tryCatch(c.req.json()); - + apiHit(c, { endpoint: "/manuallabellog", lastBody: body }); if (error) { return c.json( { diff --git a/server/services/ocp/routes/lots/getLots.ts b/server/services/ocp/routes/lots/getLots.ts index 4305083..74913e9 100644 --- a/server/services/ocp/routes/lots/getLots.ts +++ b/server/services/ocp/routes/lots/getLots.ts @@ -3,6 +3,7 @@ import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi"; import { responses } from "../../../../globalUtils/routeDefs/responses.js"; import { tryCatch } from "../../../../globalUtils/tryCatch.js"; import { getLots } from "../../controller/lots/lots.js"; +import { apiHit } from "../../../../globalUtils/apiHits.js"; const app = new OpenAPIHono({ strict: false }); @@ -16,7 +17,7 @@ app.openapi( }), async (c: any) => { const { data: lotData, error: lotError } = await tryCatch(getLots()); - + apiHit(c, { endpoint: "/getlots" }); if (lotError) { return c.json({ success: false, diff --git a/server/services/ocp/routes/printers/autoLabelerStart.ts b/server/services/ocp/routes/printers/autoLabelerStart.ts index 9967c6e..bb8ab27 100644 --- a/server/services/ocp/routes/printers/autoLabelerStart.ts +++ b/server/services/ocp/routes/printers/autoLabelerStart.ts @@ -4,6 +4,7 @@ import { authMiddleware } from "../../../auth/middleware/authMiddleware.js"; import { responses } from "../../../../globalUtils/routeDefs/responses.js"; import { tryCatch } from "../../../../globalUtils/tryCatch.js"; import { printerCycle } from "../../controller/printers/printerCycle.js"; +import { apiHit } from "../../../../globalUtils/apiHits.js"; const app = new OpenAPIHono({ strict: false }); @@ -22,6 +23,7 @@ app.openapi( }), async (c) => { const { data, error } = await tryCatch(printerCycle()); + apiHit(c, { endpoint: "/startsprintercycle" }); const dataError: any = error; if (error) { return c.json({ diff --git a/server/services/ocp/routes/printers/autoLabelerStop.ts b/server/services/ocp/routes/printers/autoLabelerStop.ts index f651d0e..a6b6f1a 100644 --- a/server/services/ocp/routes/printers/autoLabelerStop.ts +++ b/server/services/ocp/routes/printers/autoLabelerStop.ts @@ -4,6 +4,7 @@ import { authMiddleware } from "../../../auth/middleware/authMiddleware.js"; import { responses } from "../../../../globalUtils/routeDefs/responses.js"; import { tryCatch } from "../../../../globalUtils/tryCatch.js"; import { stopPrinterCycle } from "../../controller/printers/printerCycle.js"; +import { apiHit } from "../../../../globalUtils/apiHits.js"; const app = new OpenAPIHono({ strict: false }); @@ -22,6 +23,7 @@ app.openapi( }), async (c) => { const { data, error } = await tryCatch(stopPrinterCycle()); + apiHit(c, { endpoint: "/stopprintercycle" }); const dataError: any = error; if (error) { return c.json({ diff --git a/server/services/ocp/routes/printers/getPritners.ts b/server/services/ocp/routes/printers/getPritners.ts index 240b37c..91c426d 100644 --- a/server/services/ocp/routes/printers/getPritners.ts +++ b/server/services/ocp/routes/printers/getPritners.ts @@ -3,6 +3,7 @@ import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi"; import { responses } from "../../../../globalUtils/routeDefs/responses.js"; import { tryCatch } from "../../../../globalUtils/tryCatch.js"; import { getPrinters } from "../../controller/printers/getPrinters.js"; +import { apiHit } from "../../../../globalUtils/apiHits.js"; const app = new OpenAPIHono({ strict: false }); const CreateLog = z.object({ @@ -32,6 +33,7 @@ app.openapi( const { data: printData, error: printError } = await tryCatch( getPrinters() ); + apiHit(c, { endpoint: "/getprinters" }); if (printError) { return c.json({ diff --git a/server/services/ocp/routes/printers/startCycle.ts b/server/services/ocp/routes/printers/startCycle.ts index 9967c6e..bb8ab27 100644 --- a/server/services/ocp/routes/printers/startCycle.ts +++ b/server/services/ocp/routes/printers/startCycle.ts @@ -4,6 +4,7 @@ import { authMiddleware } from "../../../auth/middleware/authMiddleware.js"; import { responses } from "../../../../globalUtils/routeDefs/responses.js"; import { tryCatch } from "../../../../globalUtils/tryCatch.js"; import { printerCycle } from "../../controller/printers/printerCycle.js"; +import { apiHit } from "../../../../globalUtils/apiHits.js"; const app = new OpenAPIHono({ strict: false }); @@ -22,6 +23,7 @@ app.openapi( }), async (c) => { const { data, error } = await tryCatch(printerCycle()); + apiHit(c, { endpoint: "/startsprintercycle" }); const dataError: any = error; if (error) { return c.json({ diff --git a/server/services/ocp/routes/printers/stopCycle.ts b/server/services/ocp/routes/printers/stopCycle.ts index f651d0e..a6b6f1a 100644 --- a/server/services/ocp/routes/printers/stopCycle.ts +++ b/server/services/ocp/routes/printers/stopCycle.ts @@ -4,6 +4,7 @@ import { authMiddleware } from "../../../auth/middleware/authMiddleware.js"; import { responses } from "../../../../globalUtils/routeDefs/responses.js"; import { tryCatch } from "../../../../globalUtils/tryCatch.js"; import { stopPrinterCycle } from "../../controller/printers/printerCycle.js"; +import { apiHit } from "../../../../globalUtils/apiHits.js"; const app = new OpenAPIHono({ strict: false }); @@ -22,6 +23,7 @@ app.openapi( }), async (c) => { const { data, error } = await tryCatch(stopPrinterCycle()); + apiHit(c, { endpoint: "/stopprintercycle" }); const dataError: any = error; if (error) { return c.json({ diff --git a/server/services/ocp/routes/printers/updatePrinters.ts b/server/services/ocp/routes/printers/updatePrinters.ts index be83d5a..134fa7e 100644 --- a/server/services/ocp/routes/printers/updatePrinters.ts +++ b/server/services/ocp/routes/printers/updatePrinters.ts @@ -3,6 +3,7 @@ import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi"; import { responses } from "../../../../globalUtils/routeDefs/responses.js"; import { tryCatch } from "../../../../globalUtils/tryCatch.js"; import { updatePrinters } from "../../controller/printers/updatePrinters.js"; +import { apiHit } from "../../../../globalUtils/apiHits.js"; const app = new OpenAPIHono({ strict: false }); const CreateLog = z.object({ @@ -32,6 +33,7 @@ app.openapi( const { data: printData, error: printError } = await tryCatch( updatePrinters() ); + apiHit(c, { endpoint: "/updateprinters" }); if (printError) { return c.json({ diff --git a/server/services/ocp/routes/specialProcesses/dyco/closeConnection.ts b/server/services/ocp/routes/specialProcesses/dyco/closeConnection.ts index 90fed16..74d8158 100644 --- a/server/services/ocp/routes/specialProcesses/dyco/closeConnection.ts +++ b/server/services/ocp/routes/specialProcesses/dyco/closeConnection.ts @@ -4,6 +4,7 @@ import { responses } from "../../../../../globalUtils/routeDefs/responses.js"; import { authMiddleware } from "../../../../auth/middleware/authMiddleware.js"; import { tryCatch } from "../../../../../globalUtils/tryCatch.js"; import { closeDyco } from "../../../controller/specialProcesses/dyco/plcConnection.js"; +import { apiHit } from "../../../../../globalUtils/apiHits.js"; const app = new OpenAPIHono({ strict: false }); @@ -23,7 +24,7 @@ app.openapi( }), async (c) => { //const body = await c.req.json(); - //apiHit(c, {endpoint: `api/logger/logs/id`}); + apiHit(c, { endpoint: `dycodisconnect` }); // const authHeader = c.req.header("Authorization"); // const token = authHeader?.split("Bearer ")[1] || ""; diff --git a/server/services/ocp/routes/specialProcesses/dyco/connection.ts b/server/services/ocp/routes/specialProcesses/dyco/connection.ts index f08b0fb..e47803f 100644 --- a/server/services/ocp/routes/specialProcesses/dyco/connection.ts +++ b/server/services/ocp/routes/specialProcesses/dyco/connection.ts @@ -4,6 +4,7 @@ import { responses } from "../../../../../globalUtils/routeDefs/responses.js"; import { authMiddleware } from "../../../../auth/middleware/authMiddleware.js"; import { tryCatch } from "../../../../../globalUtils/tryCatch.js"; import { dycoConnect } from "../../../controller/specialProcesses/dyco/plcConnection.js"; +import { apiHit } from "../../../../../globalUtils/apiHits.js"; const app = new OpenAPIHono({ strict: false }); @@ -22,7 +23,7 @@ app.openapi( }), async (c) => { //const body = await c.req.json(); - //apiHit(c, {endpoint: `api/logger/logs/id`}); + apiHit(c, { endpoint: `dycoconnect` }); // const authHeader = c.req.header("Authorization"); // const token = authHeader?.split("Bearer ")[1] || ""; @@ -37,6 +38,7 @@ app.openapi( // } const { data, error } = await tryCatch(dycoConnect()); + const dataError: any = error; if (error) { return c.json({ diff --git a/server/services/quality/route/getRequest.ts b/server/services/quality/route/getRequest.ts index afc17a9..db77c2e 100644 --- a/server/services/quality/route/getRequest.ts +++ b/server/services/quality/route/getRequest.ts @@ -3,6 +3,7 @@ import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi"; import { responses } from "../../../globalUtils/routeDefs/responses.js"; import { getRequest } from "../controller/getRequests.js"; import { tryCatch } from "../../../globalUtils/tryCatch.js"; +import { apiHit } from "../../../globalUtils/apiHits.js"; const app = new OpenAPIHono({ strict: false }); @@ -16,7 +17,7 @@ app.openapi( }), async (c) => { const { data, error } = await tryCatch(getRequest()); - + apiHit(c, { endpoint: "/getrequest" }); if (error) { return c.json({ success: false, diff --git a/server/services/quality/route/postNewRequest.ts b/server/services/quality/route/postNewRequest.ts index 427787d..025019d 100644 --- a/server/services/quality/route/postNewRequest.ts +++ b/server/services/quality/route/postNewRequest.ts @@ -6,6 +6,7 @@ import { tryCatch } from "../../../globalUtils/tryCatch.js"; import { authMiddleware } from "../../auth/middleware/authMiddleware.js"; import { addNewPallet } from "../controller/addNewPallet.js"; import { verify } from "hono/jwt"; +import { apiHit } from "../../../globalUtils/apiHits.js"; const app = new OpenAPIHono({ strict: false }); const Body = z.object({ @@ -36,7 +37,7 @@ app.openapi( const user: any = payload.user; const { data: b, error: e } = await tryCatch(c.req.json()); - + apiHit(c, { endpoint: "/newrequest", lastBody: b }); if (e) { return c.json({ success: false, diff --git a/server/services/rfid/route/addReader.ts b/server/services/rfid/route/addReader.ts index 6fb4adb..1e94d48 100644 --- a/server/services/rfid/route/addReader.ts +++ b/server/services/rfid/route/addReader.ts @@ -1,15 +1,16 @@ -import {z, createRoute, OpenAPIHono} from "@hono/zod-openapi"; -import {addReader} from "../controller/addReader.js"; -import {authMiddleware} from "../../auth/middleware/authMiddleware.js"; -import {responses} from "../../../globalUtils/routeDefs/responses.js"; -import type {User} from "../../../types/users.js"; -import {verify} from "hono/jwt"; +import { z, createRoute, OpenAPIHono } from "@hono/zod-openapi"; +import { addReader } from "../controller/addReader.js"; +import { authMiddleware } from "../../auth/middleware/authMiddleware.js"; +import { responses } from "../../../globalUtils/routeDefs/responses.js"; +import type { User } from "../../../types/users.js"; +import { verify } from "hono/jwt"; +import { apiHit } from "../../../globalUtils/apiHits.js"; const app = new OpenAPIHono(); export const ReaderBody = z.object({ - reader: z.string().openapi({example: "wrapper1"}), - readerIP: z.string().openapi({example: "192.168.1.52"}), + reader: z.string().openapi({ example: "wrapper1" }), + readerIP: z.string().openapi({ example: "192.168.1.52" }), }); app.openapi( @@ -21,14 +22,14 @@ app.openapi( middleware: authMiddleware, description: "Adding in a new reader to add to the network.", request: { - body: {content: {"application/json": {schema: ReaderBody}}}, + body: { content: { "application/json": { schema: ReaderBody } } }, }, responses: responses(), }), async (c) => { const body = await c.req.json(); const authHeader = c.req.header("Authorization"); - + apiHit(c, { endpoint: "/addreader", lastBody: body }); const token = authHeader?.split("Bearer ")[1] || ""; let user: User; @@ -36,14 +37,26 @@ app.openapi( const payload = await verify(token, process.env.JWT_SECRET!); user = payload.user as User; } catch (error) { - return c.json({message: "Unauthorized"}, 401); + return c.json({ message: "Unauthorized" }, 401); } try { const addingReader = await addReader(body, user); - return c.json({success: addingReader.success, message: addingReader.message}, 200); + return c.json( + { + success: addingReader.success, + message: addingReader.message, + }, + 200 + ); } catch (error) { - return c.json({success: false, message: `${body.name} encountered an error while trying to be added`}, 400); + return c.json( + { + success: false, + message: `${body.name} encountered an error while trying to be added`, + }, + 400 + ); } } ); diff --git a/server/services/rfid/route/manualTagEnter.ts b/server/services/rfid/route/manualTagEnter.ts index b11dc15..e9822a4 100644 --- a/server/services/rfid/route/manualTagEnter.ts +++ b/server/services/rfid/route/manualTagEnter.ts @@ -1,13 +1,14 @@ //http://usday1vms006:4000/api/v1/zebra/wrapper1 -import {z, createRoute, OpenAPIHono} from "@hono/zod-openapi"; -import {responses} from "../../../globalUtils/routeDefs/responses.js"; -import {authMiddleware} from "../../auth/middleware/authMiddleware.js"; -import {manualTag} from "../controller/tags/manualTag.js"; +import { z, createRoute, OpenAPIHono } from "@hono/zod-openapi"; +import { responses } from "../../../globalUtils/routeDefs/responses.js"; +import { authMiddleware } from "../../auth/middleware/authMiddleware.js"; +import { manualTag } from "../controller/tags/manualTag.js"; +import { apiHit } from "../../../globalUtils/apiHits.js"; const app = new OpenAPIHono(); const RequestBody = z.object({ - tagNumber: z.string().openapi({example: "2541"}), + tagNumber: z.string().openapi({ example: "2541" }), }); app.openapi( @@ -18,20 +19,37 @@ app.openapi( path: "/manualtag", middleware: authMiddleware, request: { - body: {content: {"application/json": {schema: RequestBody}}}, + body: { content: { "application/json": { schema: RequestBody } } }, }, responses: responses(), }), async (c) => { const body = (await c.req.json()) ?? - c.json({success: false, message: `Please check that you are sending over a json object`}, 400); + c.json( + { + success: false, + message: `Please check that you are sending over a json object`, + }, + 400 + ); + apiHit(c, { endpoint: "/manualtag" }); try { const tag = await manualTag(body.tag, body.area); - return c.json({success: tag.success, message: tag.message, data: tag.data}, 200); + return c.json( + { success: tag.success, message: tag.message, data: tag.data }, + 200 + ); } catch (error) { - return c.json({success: true, message: `There was an error with entering a new tag`, error}, 400); + return c.json( + { + success: true, + message: `There was an error with entering a new tag`, + error, + }, + 400 + ); } } ); diff --git a/server/services/rfid/route/manualTagRead.ts b/server/services/rfid/route/manualTagRead.ts index 91eda36..6266e98 100644 --- a/server/services/rfid/route/manualTagRead.ts +++ b/server/services/rfid/route/manualTagRead.ts @@ -1,21 +1,22 @@ //http://usday1vms006:4000/api/v1/zebra/wrapper1 -import {z, createRoute, OpenAPIHono} from "@hono/zod-openapi"; -import {responses} from "../../../globalUtils/routeDefs/responses.js"; -import {readTags} from "../controller/readTags.js"; +import { z, createRoute, OpenAPIHono } from "@hono/zod-openapi"; +import { responses } from "../../../globalUtils/routeDefs/responses.js"; +import { readTags } from "../controller/readTags.js"; +import { apiHit } from "../../../globalUtils/apiHits.js"; const app = new OpenAPIHono(); const ParamsSchema = z.object({ reader: z - .string() - .min(3) - .openapi({ - param: { - name: "reader", - in: "path", - }, - example: "1212121", - }), + .string() + .min(3) + .openapi({ + param: { + name: "reader", + in: "path", + }, + example: "1212121", + }), }); app.openapi( @@ -30,10 +31,16 @@ app.openapi( responses: responses(), }), async (c) => { - const {reader} = c.req.valid("param"); + const { reader } = c.req.valid("param"); const manualTrigger = await readTags(reader); - - return c.json({success: true, message: `A Manaul trigger was done on ${reader}`}, 200); + apiHit(c, { endpoint: `/manualtrigger/${reader}` }); + return c.json( + { + success: true, + message: `A Manaul trigger was done on ${reader}`, + }, + 200 + ); } ); diff --git a/server/services/rfid/route/mgtEvents.ts b/server/services/rfid/route/mgtEvents.ts index ef3d31a..6646e2b 100644 --- a/server/services/rfid/route/mgtEvents.ts +++ b/server/services/rfid/route/mgtEvents.ts @@ -4,6 +4,7 @@ import { readTags } from "../controller/readTags.js"; import { createLog } from "../../logger/logger.js"; import { responses } from "../../../globalUtils/routeDefs/responses.js"; import { newHeartBeat } from "../controller/readerControl.js"; +import { apiHit } from "../../../globalUtils/apiHits.js"; const app = new OpenAPIHono(); let lastGpiTimestamp = 0; @@ -35,7 +36,7 @@ app.openapi( async (c) => { const { reader } = c.req.valid("param"); const body = await c.req.json(); - + apiHit(c, { endpoint: `/mgtevents/${reader}` }); if (body.type === "heartbeat") { const heart = await newHeartBeat(reader); return c.json( diff --git a/server/services/rfid/route/tagInfo.ts b/server/services/rfid/route/tagInfo.ts index dff9640..56e2316 100644 --- a/server/services/rfid/route/tagInfo.ts +++ b/server/services/rfid/route/tagInfo.ts @@ -8,6 +8,7 @@ import { badRead, goodRead } from "../controller/readerControl.js"; import { createLog } from "../../logger/logger.js"; import { tryCatch } from "../../../globalUtils/tryCatch.js"; import { stopRead } from "../controller/readTags.js"; +import { apiHit } from "../../../globalUtils/apiHits.js"; const app = new OpenAPIHono(); @@ -40,7 +41,7 @@ app.openapi( createLog("info", "rfid", "rfid", `${reader} is sending us data.`); let tagdata: any = []; const { data: body, error: bodyError } = await tryCatch(c.req.json()); - + apiHit(c, { endpoint: `/taginfo/${reader}`, lastBody: body }); if (bodyError) { return c.json({ success: false, message: "missing data" }, 400); } diff --git a/server/services/rfid/route/updateReader.ts b/server/services/rfid/route/updateReader.ts index 5b982ee..26e6423 100644 --- a/server/services/rfid/route/updateReader.ts +++ b/server/services/rfid/route/updateReader.ts @@ -1,16 +1,17 @@ -import {z, createRoute, OpenAPIHono} from "@hono/zod-openapi"; -import {addReader} from "../controller/addReader.js"; -import {authMiddleware} from "../../auth/middleware/authMiddleware.js"; -import {responses} from "../../../globalUtils/routeDefs/responses.js"; -import type {User} from "../../../types/users.js"; -import {verify} from "hono/jwt"; +import { z, createRoute, OpenAPIHono } from "@hono/zod-openapi"; +import { addReader } from "../controller/addReader.js"; +import { authMiddleware } from "../../auth/middleware/authMiddleware.js"; +import { responses } from "../../../globalUtils/routeDefs/responses.js"; +import type { User } from "../../../types/users.js"; +import { verify } from "hono/jwt"; +import { apiHit } from "../../../globalUtils/apiHits.js"; const app = new OpenAPIHono(); export const ReaderBody = z.object({ - reader: z.string().openapi({example: "wrapper1"}), - readerIP: z.string().openapi({example: "192.168.1.52"}), - active: z.boolean().optional().openapi({example: true}), + reader: z.string().openapi({ example: "wrapper1" }), + readerIP: z.string().openapi({ example: "192.168.1.52" }), + active: z.boolean().optional().openapi({ example: true }), }); app.openapi( @@ -22,14 +23,14 @@ app.openapi( middleware: authMiddleware, description: "Updates the reader data..", request: { - body: {content: {"application/json": {schema: ReaderBody}}}, + body: { content: { "application/json": { schema: ReaderBody } } }, }, responses: responses(), }), async (c) => { const body = await c.req.json(); const authHeader = c.req.header("Authorization"); - + apiHit(c, { endpoint: `/updatereader`, lastBody: body }); const token = authHeader?.split("Bearer ")[1] || ""; let user: User; @@ -37,14 +38,26 @@ app.openapi( const payload = await verify(token, process.env.JWT_SECRET!); user = payload.user as User; } catch (error) { - return c.json({message: "Unauthorized"}, 401); + return c.json({ message: "Unauthorized" }, 401); } try { const addingReader = await addReader(body, user); - return c.json({success: addingReader.success, message: addingReader.message}, 200); + return c.json( + { + success: addingReader.success, + message: addingReader.message, + }, + 200 + ); } catch (error) { - return c.json({success: false, message: `${body.name} encountered an error while trying to be added`}, 400); + return c.json( + { + success: false, + message: `${body.name} encountered an error while trying to be added`, + }, + 400 + ); } } ); diff --git a/server/services/server/route/modules/addModule.ts b/server/services/server/route/modules/addModule.ts index 50d2c9d..dbdf933 100644 --- a/server/services/server/route/modules/addModule.ts +++ b/server/services/server/route/modules/addModule.ts @@ -1,16 +1,23 @@ -import {z, createRoute, OpenAPIHono} from "@hono/zod-openapi"; -import type {User} from "../../../../types/users.js"; -import {verify} from "hono/jwt"; -import {authMiddleware} from "../../../auth/middleware/authMiddleware.js"; -import {addModule} from "../../controller/module/addModule.js"; +import { z, createRoute, OpenAPIHono } from "@hono/zod-openapi"; +import type { User } from "../../../../types/users.js"; +import { verify } from "hono/jwt"; +import { authMiddleware } from "../../../auth/middleware/authMiddleware.js"; +import { addModule } from "../../controller/module/addModule.js"; +import { apiHit } from "../../../../globalUtils/apiHits.js"; // Define the response schema const responseSchema = z.object({ message: z.string().optional(), - module_id: z.string().openapi({example: "6c922c6c-7de3-4ec4-acb0-f068abdc"}).optional(), - name: z.string().openapi({example: "Production"}).optional(), - active: z.boolean().openapi({example: true}).optional(), - roles: z.string().openapi({example: `["viewer","technician"]`}).optional(), + module_id: z + .string() + .openapi({ example: "6c922c6c-7de3-4ec4-acb0-f068abdc" }) + .optional(), + name: z.string().openapi({ example: "Production" }).optional(), + active: z.boolean().openapi({ example: true }).optional(), + roles: z + .string() + .openapi({ example: `["viewer","technician"]` }) + .optional(), }); const app = new OpenAPIHono(); @@ -29,7 +36,7 @@ const app = new OpenAPIHono(); // }); const AddModule = z.object({ - name: z.string().openapi({example: "production"}), + name: z.string().openapi({ example: "production" }), }); app.openapi( @@ -42,21 +49,26 @@ app.openapi( request: { body: { content: { - "application/json": {schema: AddModule}, + "application/json": { schema: AddModule }, }, }, }, responses: { 200: { content: { - "application/json": {schema: responseSchema}, + "application/json": { schema: responseSchema }, }, description: "Response message", }, 400: { content: { "application/json": { - schema: z.object({message: z.string().optional().openapi({example: "Internal Server error"})}), + schema: z.object({ + message: z + .string() + .optional() + .openapi({ example: "Internal Server error" }), + }), }, }, description: "Internal Server Error", @@ -64,7 +76,12 @@ app.openapi( 401: { content: { "application/json": { - schema: z.object({message: z.string().optional().openapi({example: "Unauthenticated"})}), + schema: z.object({ + message: z + .string() + .optional() + .openapi({ example: "Unauthenticated" }), + }), }, }, description: "Unauthorized", @@ -72,7 +89,12 @@ app.openapi( 500: { content: { "application/json": { - schema: z.object({message: z.string().optional().openapi({example: "Internal Server error"})}), + schema: z.object({ + message: z + .string() + .optional() + .openapi({ example: "Internal Server error" }), + }), }, }, description: "Internal Server Error", @@ -92,16 +114,26 @@ app.openapi( const payload = await verify(token, process.env.JWT_SECRET!); user = payload.user as User; } catch (error) { - return c.json({message: "Unauthorized"}, 401); + return c.json({ message: "Unauthorized" }, 401); } // now pass all the data over to update the user info try { const data = await c?.req.json(); + apiHit(c, { endpoint: `/modules`, lastBody: data }); await addModule(data, user.user_id ?? ""); - return c.json({success: true, message: "New setting was added"}, 200); + return c.json( + { success: true, message: "New setting was added" }, + 200 + ); } catch (error) { - return c.json({message: "Please make sure you are not missing your data.", error}, 400); + return c.json( + { + message: "Please make sure you are not missing your data.", + error, + }, + 400 + ); } } ); diff --git a/server/services/server/route/modules/getModules.ts b/server/services/server/route/modules/getModules.ts index a2426d0..f79dc83 100644 --- a/server/services/server/route/modules/getModules.ts +++ b/server/services/server/route/modules/getModules.ts @@ -2,6 +2,7 @@ import { z, createRoute, OpenAPIHono } from "@hono/zod-openapi"; import { modules } from "../../../../../database/schema/modules.js"; import { db } from "../../../../../database/dbclient.js"; import { desc } from "drizzle-orm"; +import { apiHit } from "../../../../globalUtils/apiHits.js"; // Define the request body schema const requestSchema = z.object({ @@ -45,6 +46,7 @@ app.openapi( }), async (c) => { //console.log("system modules"); + apiHit(c, { endpoint: `/getmodules`, action: "just modules" }); let module: any = []; try { module = await db.select().from(modules).orderBy(modules.name); // .where(eq(modules.active, true)); diff --git a/server/services/server/route/modules/getSubModules.ts b/server/services/server/route/modules/getSubModules.ts index efb3041..916af54 100644 --- a/server/services/server/route/modules/getSubModules.ts +++ b/server/services/server/route/modules/getSubModules.ts @@ -2,6 +2,7 @@ import { z, createRoute, OpenAPIHono } from "@hono/zod-openapi"; import { modules } from "../../../../../database/schema/modules.js"; import { db } from "../../../../../database/dbclient.js"; import { subModules } from "../../../../../database/schema/subModules.js"; +import { apiHit } from "../../../../globalUtils/apiHits.js"; // Define the request body schema const requestSchema = z.object({ @@ -45,6 +46,7 @@ app.openapi( }), async (c) => { //console.log("system modules"); + apiHit(c, { endpoint: `/submodules` }); let module: any = []; try { module = await db diff --git a/server/services/server/route/modules/updateModules.ts b/server/services/server/route/modules/updateModules.ts index 8f2fd97..3fae646 100644 --- a/server/services/server/route/modules/updateModules.ts +++ b/server/services/server/route/modules/updateModules.ts @@ -1,31 +1,38 @@ -import {z, createRoute, OpenAPIHono} from "@hono/zod-openapi"; -import type {User} from "../../../../types/users.js"; -import {verify} from "hono/jwt"; -import {updateModule} from "../../controller/module/updateModule.js"; -import {authMiddleware} from "../../../auth/middleware/authMiddleware.js"; +import { z, createRoute, OpenAPIHono } from "@hono/zod-openapi"; +import type { User } from "../../../../types/users.js"; +import { verify } from "hono/jwt"; +import { updateModule } from "../../controller/module/updateModule.js"; +import { authMiddleware } from "../../../auth/middleware/authMiddleware.js"; +import { apiHit } from "../../../../globalUtils/apiHits.js"; // Define the response schema const responseSchema = z.object({ message: z.string().optional(), - module_id: z.string().openapi({example: "6c922c6c-7de3-4ec4-acb0-f068abdc"}).optional(), - name: z.string().openapi({example: "Production"}).optional(), - active: z.boolean().openapi({example: true}).optional(), - roles: z.string().openapi({example: `["viewer","technician"]`}).optional(), + module_id: z + .string() + .openapi({ example: "6c922c6c-7de3-4ec4-acb0-f068abdc" }) + .optional(), + name: z.string().openapi({ example: "Production" }).optional(), + active: z.boolean().openapi({ example: true }).optional(), + roles: z + .string() + .openapi({ example: `["viewer","technician"]` }) + .optional(), }); const app = new OpenAPIHono(); const ParamsSchema = z.object({ id: z - .string() - .min(3) - .openapi({ - param: { - name: "id", - in: "path", - }, - example: "1212121", - }), + .string() + .min(3) + .openapi({ + param: { + name: "id", + in: "path", + }, + example: "1212121", + }), }); app.openapi( @@ -41,14 +48,19 @@ app.openapi( responses: { 200: { content: { - "application/json": {schema: responseSchema}, + "application/json": { schema: responseSchema }, }, description: "Response message", }, 400: { content: { "application/json": { - schema: z.object({message: z.string().optional().openapi({example: "Internal Server error"})}), + schema: z.object({ + message: z + .string() + .optional() + .openapi({ example: "Internal Server error" }), + }), }, }, description: "Internal Server Error", @@ -56,7 +68,12 @@ app.openapi( 401: { content: { "application/json": { - schema: z.object({message: z.string().optional().openapi({example: "Unauthenticated"})}), + schema: z.object({ + message: z + .string() + .optional() + .openapi({ example: "Unauthenticated" }), + }), }, }, description: "Unauthorized", @@ -64,7 +81,12 @@ app.openapi( 500: { content: { "application/json": { - schema: z.object({message: z.string().optional().openapi({example: "Internal Server error"})}), + schema: z.object({ + message: z + .string() + .optional() + .openapi({ example: "Internal Server error" }), + }), }, }, description: "Internal Server Error", @@ -72,7 +94,7 @@ app.openapi( }, }), async (c) => { - const {id} = c.req.valid("param"); + const { id } = c.req.valid("param"); // make sure we have a vaid user being accessed thats really logged in const authHeader = c.req.header("Authorization"); @@ -84,16 +106,30 @@ app.openapi( const payload = await verify(token, process.env.JWT_SECRET!); user = payload.user as User; } catch (error) { - return c.json({message: "Unauthorized"}, 401); + return c.json({ message: "Unauthorized" }, 401); } // now pass all the data over to update the user info try { const data = await c?.req.json(); + apiHit(c, { + endpoint: `/modules/${id}`, + action: "just update modules", + lastBody: data, + }); await updateModule(data, id ?? ""); - return c.json({success: true, message: "New setting was added"}, 200); + return c.json( + { success: true, message: "New setting was added" }, + 200 + ); } catch (error) { - return c.json({message: "Please make sure you are not missing your data.", error}, 400); + return c.json( + { + message: "Please make sure you are not missing your data.", + error, + }, + 400 + ); } return c.json({ diff --git a/server/services/server/route/modules/updateSubModules.ts b/server/services/server/route/modules/updateSubModules.ts index dddb27b..2216f7c 100644 --- a/server/services/server/route/modules/updateSubModules.ts +++ b/server/services/server/route/modules/updateSubModules.ts @@ -4,6 +4,7 @@ import { verify } from "hono/jwt"; import { authMiddleware } from "../../../auth/middleware/authMiddleware.js"; import { updateSubModule } from "../../controller/module/updateSubModule.js"; +import { apiHit } from "../../../../globalUtils/apiHits.js"; // Define the response schema const responseSchema = z.object({ @@ -112,6 +113,11 @@ app.openapi( // now pass all the data over to update the user info try { const data = await c?.req.json(); + apiHit(c, { + endpoint: `/submodules/${id}`, + action: "just updates submodules", + lastBody: data, + }); await updateSubModule(data, id ?? ""); return c.json({ success: true, message: "Module Updated" }, 200); } catch (error) { diff --git a/server/services/server/route/servers/getServers.ts b/server/services/server/route/servers/getServers.ts index 01532b0..48e6b39 100644 --- a/server/services/server/route/servers/getServers.ts +++ b/server/services/server/route/servers/getServers.ts @@ -1,8 +1,9 @@ -import {z, createRoute, OpenAPIHono} from "@hono/zod-openapi"; -import {db} from "../../../../../database/dbclient.js"; -import {authMiddleware} from "../../../auth/middleware/authMiddleware.js"; -import {serverData} from "../../../../../database/schema/serverData.js"; -import {eq} from "drizzle-orm"; +import { z, createRoute, OpenAPIHono } from "@hono/zod-openapi"; +import { db } from "../../../../../database/dbclient.js"; +import { authMiddleware } from "../../../auth/middleware/authMiddleware.js"; +import { serverData } from "../../../../../database/schema/serverData.js"; +import { eq } from "drizzle-orm"; +import { apiHit } from "../../../../globalUtils/apiHits.js"; // Define the request body schema const requestSchema = z.object({ @@ -15,10 +16,16 @@ const requestSchema = z.object({ // Define the response schema const responseSchema = z.object({ message: z.string().optional(), - module_id: z.string().openapi({example: "6c922c6c-7de3-4ec4-acb0-f068abdc"}).optional(), - name: z.string().openapi({example: "Production"}).optional(), - active: z.boolean().openapi({example: true}).optional(), - roles: z.string().openapi({example: `["viewer","technician"]`}).optional(), + module_id: z + .string() + .openapi({ example: "6c922c6c-7de3-4ec4-acb0-f068abdc" }) + .optional(), + name: z.string().openapi({ example: "Production" }).optional(), + active: z.boolean().openapi({ example: true }).optional(), + roles: z + .string() + .openapi({ example: `["viewer","technician"]` }) + .optional(), }); const app = new OpenAPIHono(); @@ -33,7 +40,7 @@ app.openapi( responses: { 200: { content: { - "application/json": {schema: responseSchema}, + "application/json": { schema: responseSchema }, }, description: "Response message", }, @@ -41,16 +48,22 @@ app.openapi( }), async (c) => { //console.log("system modules"); + apiHit(c, { endpoint: `/servers` }); let servers: any = []; try { - servers = await db.select().from(serverData).where(eq(serverData.active, true)); + servers = await db + .select() + .from(serverData) + .where(eq(serverData.active, true)); } catch (error) { console.log(error); servers = []; } // sort the servers by there name - servers = servers.sort((a: any, b: any) => a.sName.localeCompare(b.sName)); + servers = servers.sort((a: any, b: any) => + a.sName.localeCompare(b.sName) + ); // Return response with the received data diff --git a/server/services/server/route/servers/serverContorl.ts b/server/services/server/route/servers/serverContorl.ts index e8e8796..fac342d 100644 --- a/server/services/server/route/servers/serverContorl.ts +++ b/server/services/server/route/servers/serverContorl.ts @@ -4,6 +4,7 @@ import { responses } from "../../../../globalUtils/routeDefs/responses.js"; import { tryCatch } from "../../../../globalUtils/tryCatch.js"; import hasCorrectRole from "../../../auth/middleware/roleCheck.js"; import { serviceControl } from "../../controller/server/serviceControl.js"; +import { apiHit } from "../../../../globalUtils/apiHits.js"; // Define the request body schema const requestSchema = z.object({ @@ -33,7 +34,7 @@ app.openapi( }), async (c) => { const { data, error } = await tryCatch(c.req.json()); - + //apiHit(c, { endpoint: `/serviceprocess`, lastBody: data }); if (error) { return c.json({ success: false, diff --git a/server/services/server/route/settings/addSetting.ts b/server/services/server/route/settings/addSetting.ts index 2e0c44e..cf216cc 100644 --- a/server/services/server/route/settings/addSetting.ts +++ b/server/services/server/route/settings/addSetting.ts @@ -1,19 +1,22 @@ -import {createRoute, OpenAPIHono, z} from "@hono/zod-openapi"; -import {addSetting} from "../../controller/settings/addSetting.js"; +import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi"; +import { addSetting } from "../../controller/settings/addSetting.js"; -import {verify} from "hono/jwt"; -import type {User} from "../../../../types/users.js"; -import {authMiddleware} from "../../../auth/middleware/authMiddleware.js"; -import {responses} from "../../../../globalUtils/routeDefs/responses.js"; +import { verify } from "hono/jwt"; +import type { User } from "../../../../types/users.js"; +import { authMiddleware } from "../../../auth/middleware/authMiddleware.js"; +import { responses } from "../../../../globalUtils/routeDefs/responses.js"; +import { apiHit } from "../../../../globalUtils/apiHits.js"; const app = new OpenAPIHono(); const AddSetting = z.object({ - name: z.string().openapi({example: "server"}), - value: z.string().openapi({example: "localhost"}), - description: z.string().openapi({example: "The server we are going to connect to"}), - roles: z.string().openapi({example: "admin"}), - module: z.string().openapi({example: "production"}), + name: z.string().openapi({ example: "server" }), + value: z.string().openapi({ example: "localhost" }), + description: z + .string() + .openapi({ example: "The server we are going to connect to" }), + roles: z.string().openapi({ example: "admin" }), + module: z.string().openapi({ example: "production" }), }); app.openapi( @@ -26,7 +29,7 @@ app.openapi( request: { body: { content: { - "application/json": {schema: AddSetting}, + "application/json": { schema: AddSetting }, }, }, }, @@ -43,16 +46,26 @@ app.openapi( const payload = await verify(token, process.env.JWT_SECRET!); user = payload.user as User; } catch (error) { - return c.json({message: "Unauthorized"}, 401); + return c.json({ message: "Unauthorized" }, 401); } // now pass all the data over to update the user info try { const data = await c?.req.json(); + apiHit(c, { endpoint: `/addsettings`, lastBody: data }); await addSetting(data, user.user_id ?? ""); - return c.json({success: true, message: "New setting was added"}, 200); + return c.json( + { success: true, message: "New setting was added" }, + 200 + ); } catch (error) { - return c.json({message: "Please make sure you are not missing your data.", error}, 400); + return c.json( + { + message: "Please make sure you are not missing your data.", + error, + }, + 400 + ); } } ); diff --git a/server/services/server/route/settings/getSettings.ts b/server/services/server/route/settings/getSettings.ts index fccc636..87c7433 100644 --- a/server/services/server/route/settings/getSettings.ts +++ b/server/services/server/route/settings/getSettings.ts @@ -1,8 +1,9 @@ -import {createRoute, OpenAPIHono, z} from "@hono/zod-openapi"; +import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi"; -import type {User} from "../../../../types/users.js"; -import {verify} from "hono/jwt"; -import {getSettings} from "../../controller/settings/getSettings.js"; +import type { User } from "../../../../types/users.js"; +import { verify } from "hono/jwt"; +import { getSettings } from "../../controller/settings/getSettings.js"; +import { apiHit } from "../../../../globalUtils/apiHits.js"; const app = new OpenAPIHono(); @@ -17,8 +18,8 @@ app.openapi( content: { "application/json": { schema: z.object({ - success: z.boolean().openapi({example: true}), - message: z.string().openapi({example: "Starter"}), + success: z.boolean().openapi({ example: true }), + message: z.string().openapi({ example: "Starter" }), }), }, }, @@ -27,7 +28,12 @@ app.openapi( 400: { content: { "application/json": { - schema: z.object({message: z.string().optional().openapi({example: "Internal Server error"})}), + schema: z.object({ + message: z + .string() + .optional() + .openapi({ example: "Internal Server error" }), + }), }, }, description: "Internal Server Error", @@ -35,7 +41,12 @@ app.openapi( 401: { content: { "application/json": { - schema: z.object({message: z.string().optional().openapi({example: "Unauthenticated"})}), + schema: z.object({ + message: z + .string() + .optional() + .openapi({ example: "Unauthenticated" }), + }), }, }, description: "Unauthorized", @@ -43,7 +54,12 @@ app.openapi( 500: { content: { "application/json": { - schema: z.object({message: z.string().optional().openapi({example: "Internal Server error"})}), + schema: z.object({ + message: z + .string() + .optional() + .openapi({ example: "Internal Server error" }), + }), }, }, description: "Internal Server Error", @@ -52,13 +68,19 @@ app.openapi( }), async (c) => { // make sure we have a vaid user being accessed thats really logged in - + apiHit(c, { endpoint: `/settings` }); // now pass all the data over to update the user info try { const data = await getSettings(); - return c.json({success: true, message: "All Current Settings", data}, 200); + return c.json( + { success: true, message: "All Current Settings", data }, + 200 + ); } catch (error) { - return c.json({message: "There was an error getting the settings.", error}, 400); + return c.json( + { message: "There was an error getting the settings.", error }, + 400 + ); } } ); diff --git a/server/services/server/route/settings/updateSetting.ts b/server/services/server/route/settings/updateSetting.ts index 7be8fd3..97c7681 100644 --- a/server/services/server/route/settings/updateSetting.ts +++ b/server/services/server/route/settings/updateSetting.ts @@ -1,13 +1,14 @@ -import {createRoute, OpenAPIHono, z} from "@hono/zod-openapi"; -import type {User} from "../../../../types/users.js"; -import {verify} from "hono/jwt"; -import {updateSetting} from "../../controller/settings/updateSetting.js"; +import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi"; +import type { User } from "../../../../types/users.js"; +import { verify } from "hono/jwt"; +import { updateSetting } from "../../controller/settings/updateSetting.js"; +import { apiHit } from "../../../../globalUtils/apiHits.js"; const app = new OpenAPIHono(); const UpdateSetting = z.object({ - name: z.string().openapi({example: "server"}), - value: z.string().openapi({example: "localhost"}), + name: z.string().openapi({ example: "server" }), + value: z.string().openapi({ example: "localhost" }), }); app.openapi( @@ -19,7 +20,7 @@ app.openapi( request: { body: { content: { - "application/json": {schema: UpdateSetting}, + "application/json": { schema: UpdateSetting }, }, }, }, @@ -28,8 +29,8 @@ app.openapi( content: { "application/json": { schema: z.object({ - success: z.boolean().openapi({example: true}), - message: z.string().openapi({example: "Starter"}), + success: z.boolean().openapi({ example: true }), + message: z.string().openapi({ example: "Starter" }), }), }, }, @@ -38,7 +39,12 @@ app.openapi( 400: { content: { "application/json": { - schema: z.object({message: z.string().optional().openapi({example: "Internal Server error"})}), + schema: z.object({ + message: z + .string() + .optional() + .openapi({ example: "Internal Server error" }), + }), }, }, description: "Internal Server Error", @@ -46,7 +52,12 @@ app.openapi( 401: { content: { "application/json": { - schema: z.object({message: z.string().optional().openapi({example: "Unauthenticated"})}), + schema: z.object({ + message: z + .string() + .optional() + .openapi({ example: "Unauthenticated" }), + }), }, }, description: "Unauthorized", @@ -54,7 +65,12 @@ app.openapi( 500: { content: { "application/json": { - schema: z.object({message: z.string().optional().openapi({example: "Internal Server error"})}), + schema: z.object({ + message: z + .string() + .optional() + .openapi({ example: "Internal Server error" }), + }), }, }, description: "Internal Server Error", @@ -66,11 +82,17 @@ app.openapi( const authHeader = c.req.header("Authorization"); if (authHeader?.includes("Basic")) { - return c.json({message: "You are a Basic user! Please login to get a token"}, 401); + return c.json( + { + message: + "You are a Basic user! Please login to get a token", + }, + 401 + ); } if (!authHeader) { - return c.json({message: "Unauthorized"}, 401); + return c.json({ message: "Unauthorized" }, 401); } const token = authHeader?.split("Bearer ")[1] || ""; @@ -80,16 +102,27 @@ app.openapi( const payload = await verify(token, process.env.JWT_SECRET!); user = payload.user as User; } catch (error) { - return c.json({message: "Unauthorized"}, 401); + return c.json({ message: "Unauthorized" }, 401); } // now pass all the data over to update the user info try { const data = await c?.req.json(); + apiHit(c, { endpoint: `/updatesettings`, lastBody: data }); await updateSetting(data, user.user_id ?? ""); - return c.json({success: true, message: "The Setting was just updated", data}, 200); + return c.json( + { + success: true, + message: "The Setting was just updated", + data, + }, + 200 + ); } catch (error) { - return c.json({message: "There was an error updating the settings.", error}, 400); + return c.json( + { message: "There was an error updating the settings.", error }, + 400 + ); } } ); diff --git a/server/services/server/route/updates/updateServer.ts b/server/services/server/route/updates/updateServer.ts index d463995..445e368 100644 --- a/server/services/server/route/updates/updateServer.ts +++ b/server/services/server/route/updates/updateServer.ts @@ -4,6 +4,7 @@ import { processAllServers, updateServer, } from "../../../../scripts/updateServers.js"; +import { apiHit } from "../../../../globalUtils/apiHits.js"; // Define the request body schema const requestSchema = z.object({ @@ -80,7 +81,7 @@ app.openapi( async (c) => { const { server } = c.req.valid("param"); const body = await c.req.json(); - + apiHit(c, { endpoint: `/update/${server}`, lastBody: body }); // fire off the update we wont make this way if (body.all) { const update = await processAllServers(body.devDir);