feat(settings): final migration of settings and edits added

This commit is contained in:
2025-11-25 14:36:06 -06:00
parent 3193e07e47
commit 7e15e5d7bc
11 changed files with 760 additions and 522 deletions

View File

@@ -0,0 +1,20 @@
meta {
name: Update Setting
type: http
seq: 4
}
post {
url: {{url}}/lst/api/system/settings/:token
body: none
auth: inherit
}
params:path {
token:
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -219,9 +219,9 @@ const main = async () => {
addListeners();
//userMigrate();
// some temp fixes
// above 230 remove these
// above 235 remove these
manualFixes();
settingsMigrate();
//settingsMigrate();
}, 5 * 1000);
// setTimeout(() => {

View File

@@ -5,66 +5,31 @@ import { Router } from "express";
import https from "https";
import { db } from "../../../../pkg/db/db.js";
import { serverData } from "../../../../pkg/db/schema/servers.js";
import { settings } from "../../../../pkg/db/schema/settings.js";
import { createLogger } from "../../../../pkg/logger/logger.js";
import { tryCatch } from "../../../../pkg/utils/tryCatch.js";
const router = Router();
router.patch("/:token", async (req: Request, res: Response) => {
const log = createLogger({ module: "admin", subModule: "update server" });
router.patch("/:id", async (req: Request, res: Response) => {
const log = createLogger({ module: "admin", subModule: "update setting" });
// when a server is updated and is posted from localhost or 127.0.0.1 we also want to post it to the test server so we can see it from there, we want to insert with update on conflict.
const token = req.params.token;
const id = req.params.id;
const updates: Record<string, any> = {};
if (req.body?.name !== undefined) {
updates.name = req.body.name;
}
if (req.body?.serverDNS !== undefined) {
updates.serverDNS = req.body.serverDNS;
if (req.body?.value !== undefined) {
updates.value = req.body.value;
}
if (req.body?.ipAddress !== undefined) {
updates.ipAddress = req.body.ipAddress;
if (req.body?.description !== undefined) {
updates.description = req.body.description;
}
if (req.body?.greatPlainsPlantCode !== undefined) {
updates.greatPlainsPlantCode = req.body.greatPlainsPlantCode;
}
if (req.body?.lstServerPort !== undefined) {
updates.lstServerPort = req.body.lstServerPort;
}
if (req.body?.serverLoc !== undefined) {
updates.serverLoc = req.body.serverLoc;
}
if (req.body?.streetAddress !== undefined) {
updates.streetAddress = req.body.streetAddress;
}
if (req.body?.cityState !== undefined) {
updates.cityState = req.body.cityState;
}
if (req.body?.zipcode !== undefined) {
updates.zipcode = req.body.zipcode;
}
if (req.body?.contactEmail !== undefined) {
updates.contactEmail = req.body.contactEmail;
}
if (req.body?.contactPhone !== undefined) {
updates.contactPhone = req.body.contactPhone;
}
if (req.body?.customerTiAcc !== undefined) {
updates.customerTiAcc = req.body.customerTiAcc;
}
if (req.body?.active !== undefined) {
updates.active = req.body.active;
if (req.body?.moduleName !== undefined) {
updates.moduleName = req.body.moduleName;
}
updates.upd_user = req.user!.username || "lst_user";
@@ -73,65 +38,12 @@ router.patch("/:token", async (req: Request, res: Response) => {
try {
if (Object.keys(updates).length > 0) {
await db
.update(serverData)
.update(settings)
.set(updates)
.where(eq(serverData.plantToken, token));
.where(eq(settings.settings_id, id));
}
if (req.hostname === "localhost" && process.env.MAIN_SERVER) {
log.info({}, "Running in dev server about to add in a new server");
const axiosInstance = axios.create({
httpsAgent: new https.Agent({ rejectUnauthorized: false }),
baseURL: process.env.MAIN_SERVER,
withCredentials: true,
});
const loginRes = (await axiosInstance.post(
`${process.env.MAIN_SERVER}/lst/api/auth/sign-in/username`,
{
username: process.env.MAIN_SERVER_USERNAME,
password: process.env.MAIN_SERVER_PASSWORD,
},
{
headers: { "Content-Type": "application/json" },
},
)) as any;
const setCookie = loginRes?.headers["set-cookie"][0];
//console.log(setCookie.split(";")[0].replace("__Secure-", ""));
if (!setCookie) {
throw new Error("Did not receive a Set-Cookie header from login");
}
const { data, error } = await tryCatch(
axios.patch(
`${process.env.MAIN_SERVER}/lst/api/admin/server/${token}`,
updates,
{
headers: {
"Content-Type": "application/json",
Cookie: setCookie.split(";")[0],
},
withCredentials: true,
},
),
);
if (error) {
console.log(error);
log.error(
{ stack: error },
"There was an error adding the server to Main Server",
);
}
log.info(
{ stack: data?.data },
"A new Server was just added to the server.",
);
}
res.status(200).json({ message: `${token} Server was just updated` });
res.status(200).json({ message: `Setting was just updated` });
} catch (error) {
console.log(error);
res.status(400).json({ message: "Error Server updated", error });

View File

@@ -65,8 +65,6 @@ export const addListeners = async () => {
// all the migration stuff that will need to be moved later build 230 and above will need to remove
export const manualFixes = async () => {
const fixQuery = `ALTER TABLE "serverData" ADD CONSTRAINT "serverData_name_unique" UNIQUE("name");`;
const log = createLogger({ module: "utils", subModule: "manual fixes" });
const client = new Client({
connectionString: `postgresql://${process.env.DATABASE_USER}:${process.env.DATABASE_PASSWORD}@${process.env.DATABASE_HOST}:${process.env.DATABASE_PORT}/${process.env.DATABASE_DB}`,
@@ -74,12 +72,16 @@ export const manualFixes = async () => {
await client.connect();
try {
log.info({}, "Running the manual fix");
await client.query(fixQuery);
} catch (e) {
log.info({ error: e }, "Fix was not completed");
}
/**
* The fix to correct the constraint on the server data
*/
// const fixQuery = `ALTER TABLE "serverData" ADD CONSTRAINT "serverData_name_unique" UNIQUE("name");`;
// try {
// log.info({}, "Running the manual fix");
// await client.query(fixQuery);
// } catch (e) {
// log.info({ error: e }, "Fix was not completed");
// }
};
export const settingsMigrate = async () => {

View File

@@ -0,0 +1,18 @@
import { keepPreviousData, queryOptions } from "@tanstack/react-query";
import axios from "axios";
export function getSettings() {
return queryOptions({
queryKey: ["getSettings"],
queryFn: () => fetchSession(),
staleTime: 5000,
refetchOnWindowFocus: true,
placeholderData: keepPreviousData,
});
}
const fetchSession = async () => {
const { data } = await axios.get("/lst/api/system/settings");
return data.data;
};

View File

@@ -0,0 +1,26 @@
import { createColumnHelper } from "@tanstack/react-table";
import { ArrowDown, ArrowUp } from "lucide-react";
import { Button } from "@/components/ui/button";
export const GenericColumn = ({ columnName }: { columnName: string }) => {
const columnHelper = createColumnHelper();
return columnHelper.accessor(`${columnName}`, {
header: ({ column }) => {
return (
<Button
variant="ghost"
onClick={() => column.toggleSorting(column.getIsSorted() === "asc")}
>
<span className="flex flex-row gap-2">{`${columnName.toUpperCase()}`}</span>
{column.getIsSorted() === "asc" ? (
<ArrowUp className="ml-2 h-4 w-4" />
) : (
<ArrowDown className="ml-2 h-4 w-4" />
)}
</Button>
);
},
cell: (i) => i.getValue(),
});
};

View File

@@ -1,6 +1,7 @@
import {
flexRender,
getCoreRowModel,
getFilteredRowModel,
getPaginationRowModel,
getSortedRowModel,
type SortingState,
@@ -26,6 +27,9 @@ export default function TableNoExpand({
columns: any;
}) {
const [sorting, setSorting] = useState<SortingState>([]);
// const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>(
// []
// )
const table = useReactTable({
data,
columns,
@@ -33,11 +37,14 @@ export default function TableNoExpand({
getPaginationRowModel: getPaginationRowModel(),
onSortingChange: setSorting,
getSortedRowModel: getSortedRowModel(),
getFilteredRowModel: getFilteredRowModel(),
//renderSubComponent: ({ row }: { row: any }) => <ExpandedRow row={row} />,
//getRowCanExpand: () => true,
filterFns: {},
state: {
sorting,
//columnFilters
},
});
return (

View File

@@ -1,7 +1,31 @@
import { createFileRoute, Link, Outlet } from "@tanstack/react-router";
import {
createFileRoute,
Link,
Outlet,
redirect,
} from "@tanstack/react-router";
import { checkUserAccess } from "@/lib/authClient";
export const Route = createFileRoute("/_app/_adminLayout/admin/_system")({
component: RouteComponent,
beforeLoad: async () => {
const auth = await checkUserAccess({
allowedRoles: ["systemAdmin", "admin"],
moduleName: "system", // optional
});
if (!auth) {
throw redirect({
to: "/login",
search: {
// Use the current location to power a redirect after login
// (Do not use `router.state.resolvedLocation` as it can
// potentially lag behind the actual current location)
redirect: location.pathname + location.search,
},
});
}
},
});
function RouteComponent() {

View File

@@ -1,11 +1,230 @@
import { createFileRoute } from '@tanstack/react-router'
import { useMutation, useQuery } from "@tanstack/react-query";
import { createFileRoute } from "@tanstack/react-router";
import { createColumnHelper } from "@tanstack/react-table";
import axios from "axios";
import { ArrowDown, ArrowUp } from "lucide-react";
import { useEffect, useRef, useState } from "react";
import { toast } from "sonner";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { getSettings } from "@/lib/querys/admin/getSettings";
import TableNoExpand from "@/lib/tableStuff/TableNoExpand";
type Settings = {
settings_id: string;
name: string;
active: boolean;
value: string;
description: string;
moduleName: string;
roles: string[];
};
const updateSettings = async (
id: string,
data: Record<string, string | number | boolean | null>,
) => {
console.log(id, data);
try {
const res = await axios.patch(`/lst/api/system/settings/${id}`, data, {
withCredentials: true,
});
toast.success(`Setting just updated`);
return res;
} catch (err) {
toast.error("Error in updating the settings");
return err;
}
};
export const Route = createFileRoute(
'/_app/_adminLayout/admin/_system/settings',
"/_app/_adminLayout/admin/_system/settings",
)({
component: RouteComponent,
})
component: RouteComponent,
});
function RouteComponent() {
return <div>Hello "/_app/_adminLayout/admin/_system/settings"!</div>
const { data, isLoading, refetch } = useQuery(getSettings());
const columnHelper = createColumnHelper<Settings>();
const submitting = useRef(false);
const updateSetting = useMutation({
mutationFn: ({
id,
field,
value,
}: {
id: string;
field: string;
value: string | number | boolean | null;
}) => updateSettings(id, { [field]: value }),
onSuccess: () => {
// refetch or update cache
refetch();
},
});
const columns = [
columnHelper.accessor("name", {
header: ({ column }) => {
return (
<Button
variant="ghost"
onClick={() => column.toggleSorting(column.getIsSorted() === "asc")}
>
<span className="flex flex-row gap-2">Name</span>
{column.getIsSorted() === "asc" ? (
<ArrowUp className="ml-2 h-4 w-4" />
) : (
<ArrowDown className="ml-2 h-4 w-4" />
)}
</Button>
);
},
cell: (i) => i.getValue(),
}),
columnHelper.accessor("description", {
header: ({ column }) => {
return (
<Button
variant="ghost"
onClick={() => column.toggleSorting(column.getIsSorted() === "asc")}
>
<span className="flex flex-row gap-2">Description</span>
{column.getIsSorted() === "asc" ? (
<ArrowUp className="ml-2 h-4 w-4" />
) : (
<ArrowDown className="ml-2 h-4 w-4" />
)}
</Button>
);
},
cell: (i) => i.getValue(),
}),
columnHelper.accessor("value", {
header: ({ column }) => {
return (
<Button
variant="ghost"
onClick={() => column.toggleSorting(column.getIsSorted() === "asc")}
>
<span className="flex flex-row gap-2">Value</span>
{column.getIsSorted() === "asc" ? (
<ArrowUp className="ml-2 h-4 w-4" />
) : (
<ArrowDown className="ml-2 h-4 w-4" />
)}
</Button>
);
},
cell: ({ row, getValue }) => {
const initialValue = String(getValue() ?? "");
const [localValue, setLocalValue] = useState(initialValue);
const id = row.original.settings_id;
const field = "value";
useEffect(() => setLocalValue(initialValue), [initialValue]);
const handleSubmit = (newValue: string) => {
if (newValue !== initialValue) {
setLocalValue(newValue);
updateSetting.mutate({ id, field, value: newValue });
}
};
return (
<Input
value={localValue}
onChange={(e) => setLocalValue(e.currentTarget.value)}
onBlur={(e) => {
if (!submitting.current) {
submitting.current = true;
handleSubmit(e.currentTarget.value.trim());
setTimeout(() => (submitting.current = false), 100); // reset after slight delay
}
}}
onKeyDown={(e) => {
if (e.key === "Enter") {
e.preventDefault();
submitting.current = true;
handleSubmit(e.currentTarget.value.trim());
e.currentTarget.blur(); // will trigger blur, but we ignore it
setTimeout(() => (submitting.current = false), 100);
}
}}
/>
);
},
}),
columnHelper.accessor("moduleName", {
header: ({ column }) => {
return (
<Button
variant="ghost"
onClick={() => column.toggleSorting(column.getIsSorted() === "asc")}
>
<span className="flex flex-row gap-2">Module Name</span>
{column.getIsSorted() === "asc" ? (
<ArrowUp className="ml-2 h-4 w-4" />
) : (
<ArrowDown className="ml-2 h-4 w-4" />
)}
</Button>
);
},
cell: ({ row, getValue }) => {
const initialValue = String(getValue() ?? "");
const [localValue, setLocalValue] = useState(initialValue);
const id = row.original.settings_id;
const field = "moduleName";
useEffect(() => setLocalValue(initialValue), [initialValue]);
const handleSubmit = (newValue: string) => {
if (newValue !== initialValue) {
setLocalValue(newValue);
updateSetting.mutate({ id, field, value: newValue });
}
};
return (
<Input
value={localValue}
onChange={(e) => setLocalValue(e.currentTarget.value)}
onBlur={(e) => {
if (!submitting.current) {
submitting.current = true;
handleSubmit(e.currentTarget.value.trim());
setTimeout(() => (submitting.current = false), 100); // reset after slight delay
}
}}
onKeyDown={(e) => {
if (e.key === "Enter") {
e.preventDefault();
submitting.current = true;
handleSubmit(e.currentTarget.value.trim());
e.currentTarget.blur(); // will trigger blur, but we ignore it
setTimeout(() => (submitting.current = false), 100);
}
}}
/>
);
},
}),
];
if (isLoading)
return (
<div>
<span>Loading settings data</span>
</div>
);
return (
<div className="m-2">
<TableNoExpand data={data} columns={columns} />
</div>
);
}

View File

@@ -6,11 +6,13 @@ process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
import axios from "axios";
import { Client } from "pg";
import { db } from "../../../../../database/dbclient.js";
import { settings } from "../../../../../database/schema/settings.js";
import { tryCatch } from "../../../../globalUtils/tryCatch.js";
import type { Settings } from "../../../../types/settings.js";
import { createLog } from "../../../logger/logger.js";
export let serverSettings: Settings[];
export let serverSettings: Settings[] = [];
export const getSettings = async () => {
const settingsType = process.env.LST_USE_GO;
createLog(
@@ -22,7 +24,7 @@ export const getSettings = async () => {
//if (settingsType !== "true") {
try {
// serverSettings = (await db.select().from(settings)) as any;
//serverSettings = (await db.select().from(settings)) as any;
const dbUrl = String(process.env.DATABASE_URL).replace("lst_db", "lst");
const client = new Client({
connectionString: dbUrl,
@@ -30,33 +32,37 @@ export const getSettings = async () => {
await client.connect();
try {
const s = await client.query("SELECT * FROM settings");
if (serverSettings.length === 0) {
try {
const s = await client.query("SELECT * FROM settings");
serverSettings = s.rows;
} catch (e) {
console.log(e);
serverSettings = s.rows;
} catch (e) {
console.log(e);
}
// const { data, error } = (await tryCatch(
// axios.get(
// `http://localhost:${process.env.VITE_SERVER_PORT}/lst/api/system/settings`,
// ),
// )) as any;
// if (error) {
// createLog(
// "error",
// "lst",
// "server",
// "There was an error getting the settings",
// );
// throw new Error("There was an error getting the settings");
// }
//serverSettings = data.data.data;
} else {
return serverSettings;
}
//.where(sql`${userRole} = ANY(roles)`);
// const { data, error } = (await tryCatch(
// axios.get(
// `http://localhost:${process.env.VITE_SERVER_PORT}/lst/api/system/settings`,
// ),
// )) as any;
// if (error) {
// createLog(
// "error",
// "lst",
// "server",
// "There was an error getting the settings",
// );
// throw new Error("There was an error getting the settings");
// }
//serverSettings = data.data.data;
} catch (error) {
console.log(error);
createLog(
"error",
"lst",

View File

@@ -1,381 +1,385 @@
{
"servers": [
{
"sName": "Test",
"serverDNS": "usmcd1vms036",
"plantToken": "test3",
"idAdress": "10.193.0.56",
"greatPlainsPlantCode": "1",
"streetAddress": "289 GA-155 S",
"cityState": "McDonough, GA",
"zipcode": "30253",
"contactEmail": "noreply@alpla.com",
"contactPhone": "770-914-1407",
"customerTiAcc": "ALPLA01INTGROUP",
"lstServerPort": "3000",
"active": true,
"serverLoc": "E:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [{ "specialInstructions": "" }]
},
{
"sName": "Bethlehem",
"serverDNS": "usbet1vms006",
"plantToken": "usbet1",
"idAddress": "10.204.0.26",
"greatPlainsPlantCode": "75",
"streetAddress": "2120 Spillman Dr",
"cityState": "Bethlehem, PA",
"zipcode": "18015",
"contactEmail": "ShippingReceivingBethlehem@groups.alpla.com",
"contactPhone": "6103902380",
"customerTiAcc": "ALPL01BETHINT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "E:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [
{
"specialInstructions": "PLEASE CONTACT ShippingReceivingBethlehem@groups.alpla.com WITH ANY QUESTIONS"
}
]
},
{
"sName": "Huston",
"serverDNS": "ushou1vms006",
"plantToken": "ushou1",
"idAddress": "10.195.0.26",
"greatPlainsPlantCode": "20",
"streetAddress": "5800 Armour Dr",
"cityState": "Houston, TX",
"zipcode": "77020",
"contactEmail": "blake.matthes@alpla.com",
"contactPhone": "6366970253",
"customerTiAcc": "ALPL01HOUSINT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "E:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [{ "specialInstructions": "" }]
},
{
"sName": "Bowling Green 1",
"serverDNS": "usbow1vms006",
"plantToken": "usbow1",
"idAddress": "10.25.0.26",
"greatPlainsPlantCode": "55",
"streetAddress": "215 Technology Way",
"cityState": "Bowling Green, KY",
"zipcode": "42101",
"contactEmail": "ShippingReceivingBowlingGreen1@groups.alpla.com",
"contactPhone": "(270) 495-6647",
"customerTiAcc": "ALPL01BG1INT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "E:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"00:00\", \"late\": \"23:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [
{
"specialInstructions": "Please be sure to schedule a pick up appointment and bring 2 load bars to secure the load."
}
]
},
{
"sName": "Iowa ISBM",
"serverDNS": "usiow1vms006",
"plantToken": "usiow2",
"idAddress": "10.75.0.26",
"greatPlainsPlantCode": "31",
"streetAddress": "2670 INDEPENDENCE RD",
"cityState": "Iowa CIty, IA",
"zipcode": "52240",
"contactEmail": "Dalina.Lacy@alpla.com",
"contactPhone": "",
"customerTiAcc": "ALPL01IA2INT",
"lstServerPort": "3001",
"active": true,
"serverLoc": "D:\\LST\\lstv2_2",
"oldVersion": "D:\\LST\\lst_backend_2",
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [{ "specialInstructions": "[header]" }]
},
{
"sName": "Kansas City",
"serverDNS": "usksc1vms006",
"plantToken": "usksc1",
"idAddress": "10.42.9.26",
"greatPlainsPlantCode": "85",
"streetAddress": "1800 E 94th St Suite 300",
"cityState": "Kansas City, MO",
"zipcode": "64131",
"contactEmail": "blake.matthes@alpla.com",
"contactPhone": "6366970253",
"customerTiAcc": "ALPL01KCINT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "E:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [{ "specialInstructions": "" }]
},
{
"sName": "Bowling Green 2",
"serverDNS": "usbow2vms006",
"plantToken": "usbow2",
"idAddress": "10.106.0.26",
"greatPlainsPlantCode": "56",
"streetAddress": "377 Southwood Ct",
"cityState": "Bowling Green, KY",
"zipcode": "42101",
"contactEmail": "blake.matthes@alpla.com",
"contactPhone": "6366970253",
"customerTiAcc": "ALPL01BG2INT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "E:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [{ "specialInstructions": "" }]
},
{
"sName": "MCDonough",
"serverDNS": "usmcd1vms006",
"plantToken": "usmcd1",
"idAddress": "10.193.0.26",
"greatPlainsPlantCode": "10",
"streetAddress": "289 GA-155 S",
"cityState": "McDonough, GA",
"zipcode": "30253",
"contactEmail": "shippingreceivingmcdonough@groups.alpla.com",
"contactPhone": "4049663122",
"customerTiAcc": "ALPL01MCDINT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "E:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [{ "specialInstructions": "" }]
},
{
"sName": "Dayton",
"serverDNS": "usday1vms006",
"plantToken": "usday1",
"idAddress": "10.44.0.26",
"greatPlainsPlantCode": "80",
"streetAddress": "2700 Concorde Dr Suite 200",
"cityState": "Vandalia, OH",
"zipcode": "45377",
"contactEmail": "Daniel.Deshields@alpla.com",
"contactPhone": "4846667452",
"customerTiAcc": "ALPL01DAYTONINT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "E:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"00:00\", \"late\": \"23:59\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [{ "specialInstructions": "" }]
},
{
"sName": "Salt Lake City",
"serverDNS": "usslc1vms006",
"plantToken": "usslc1",
"idAddress": "10.202.0.26",
"greatPlainsPlantCode": "70",
"streetAddress": "4324 Commercial Way Suite A",
"cityState": "Salt Lake City, UT",
"zipcode": "84104",
"contactEmail": "ShippingReceivingSaltLake@groups.alpla.com",
"contactPhone": "801-673-2143",
"customerTiAcc": "ALPL01SLCINT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "E:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"07:00\", \"late\": \"17:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [{ "specialInstructions": "Copy of bol" }]
},
{
"sName": "Lima",
"serverDNS": "uslim1vms006",
"plantToken": "uslim1",
"idAddress": "10.53.0.26",
"greatPlainsPlantCode": "50",
"streetAddress": "3320 Fort Shawnee Industrial Dr",
"cityState": "Lima, OH",
"zipcode": "45806",
"contactEmail": "shippingreceivinglima@groups.alpla.com",
"contactPhone": "",
"customerTiAcc": "ALPL01LIMAINT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "E:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"13:00\", \"late\": \"15:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [{ "specialInstructions": "" }]
},
{
"sName": "Florence",
"serverDNS": "usflo1vms006",
"plantToken": "usflo1",
"idAddress": "10.203.0.26",
"greatPlainsPlantCode": "22",
"streetAddress": "7080 New Buffington Rd",
"cityState": "Florence, KY",
"zipcode": "41042",
"contactEmail": "blake.matthes@alpla.com",
"contactPhone": "6366970253",
"customerTiAcc": "ALPL01FLORINT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "E:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [{ "specialInstructions": "" }]
},
{
"sName": "Iowa EBM",
"serverDNS": "usiow1vms006",
"plantToken": "usiow1",
"idAddress": "10.75.0.26",
"greatPlainsPlantCode": "30",
"streetAddress": "2258 Heinz Rd",
"cityState": "Iowa CIty, IA",
"zipcode": "52240",
"contactEmail": "shippingreceivingiowa1@groups.alpla.com",
"contactPhone": "3193378057",
"customerTiAcc": "ALPL01IA1INT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "D:\\LST\\lstv2",
"oldVersion": "D:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [{ "specialInstructions": "" }]
},
{
"sName": "Jefferson city",
"serverDNS": "usjci1vms006",
"plantToken": "usjci1",
"idAddress": "10.167.0.26",
"greatPlainsPlantCode": "40",
"streetAddress": "2662 Militia Dr",
"cityState": "Jefferson City, MO",
"zipcode": "65101",
"contactEmail": "blake.matthes@alpla.com",
"contactPhone": "6366970253",
"customerTiAcc": "ALPL01JCINT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "E:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [{ "specialInstructions": "" }]
},
{
"sName": "Sherman",
"serverDNS": "usshe1vms006",
"plantToken": "usshe1",
"idAddress": "10.205.0.26",
"greatPlainsPlantCode": "21",
"streetAddress": "3000 Howe Dr",
"cityState": "Sherman, TX",
"zipcode": "75092",
"contactEmail": "blake.matthes@alpla.com",
"contactPhone": "6366970253",
"customerTiAcc": "ALPL01SHERMANINT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "E:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [{ "specialInstructions": "" }]
},
{
"sName": "West Bend",
"serverDNS": "usweb1vms006",
"plantToken": "usweb1",
"idAddress": "10.80.0.26",
"greatPlainsPlantCode": "65",
"streetAddress": "825 Rail Way",
"cityState": "West Bend, WI",
"zipcode": "53095",
"contactEmail": "shippingreceivingwestbend@groups.alpla.com",
"contactPhone": "262-808-4211",
"customerTiAcc": "ALPL01WBINT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "E:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [
{
"specialInstructions": "This is a FTL load. The driver will need 2 adjustable load locks to secure the load. The driver will not be loaded without them. Please reference ALPLA pickup [header]",
"active": false
}
]
},
{
"sName": "St Peters",
"serverDNS": "usstp1vms006",
"plantToken": "usstp1",
"idAddress": "10.37.0.26",
"greatPlainsPlantCode": "45",
"streetAddress": "9 Cermak Blvd",
"cityState": "St. Peters, MO",
"zipcode": "63376",
"contactEmail": "Shippingreceivingstpeters@groups.alpla.com",
"contactPhone": "6365771018",
"customerTiAcc": "ALPL01STPINT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "D:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"00:01\", \"late\": \"23:59\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [
{ "specialInstructions": "Loadbars/Straps required." }
]
},
{
"sName": "Marked Tree",
"serverDNS": "usmar1vms006",
"plantToken": "usmar1",
"idAddress": "10.206.9.26",
"greatPlainsPlantCode": "90",
"streetAddress": "301 Industrial St",
"cityState": "Marked Tree, AR",
"zipcode": "72365",
"contactEmail": "Shippingreceivingstpeters@groups.alpla.com",
"contactPhone": "6365771018",
"customerTiAcc": "ALPL01MARINT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "E:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [
{ "specialInstructions": "Loadbars/Straps required." }
]
}
]
"servers": [
{
"sName": "Test",
"serverDNS": "usmcd1vms036",
"plantToken": "test3",
"idAdress": "10.193.0.56",
"greatPlainsPlantCode": "1",
"streetAddress": "289 GA-155 S",
"cityState": "McDonough, GA",
"zipcode": "30253",
"contactEmail": "noreply@alpla.com",
"contactPhone": "770-914-1407",
"customerTiAcc": "ALPLA01INTGROUP",
"lstServerPort": "3000",
"active": true,
"serverLoc": "E:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [{ "specialInstructions": "" }]
},
{
"sName": "Bethlehem",
"serverDNS": "usbet1vms006",
"plantToken": "usbet1",
"idAddress": "10.204.0.26",
"greatPlainsPlantCode": "75",
"streetAddress": "2120 Spillman Dr",
"cityState": "Bethlehem, PA",
"zipcode": "18015",
"contactEmail": "ShippingReceivingBethlehem@groups.alpla.com",
"contactPhone": "6103902380",
"customerTiAcc": "ALPL01BETHINT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "E:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [
{
"specialInstructions": "PLEASE CONTACT ShippingReceivingBethlehem@groups.alpla.com WITH ANY QUESTIONS"
}
]
},
{
"sName": "Huston",
"serverDNS": "ushou1vms006",
"plantToken": "ushou1",
"idAddress": "10.195.0.26",
"greatPlainsPlantCode": "20",
"streetAddress": "5800 Armour Dr",
"cityState": "Houston, TX",
"zipcode": "77020",
"contactEmail": "blake.matthes@alpla.com",
"contactPhone": "6366970253",
"customerTiAcc": "ALPL01HOUSINT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "E:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [{ "specialInstructions": "" }]
},
{
"sName": "Bowling Green 1",
"serverDNS": "usbow1vms006",
"plantToken": "usbow1",
"idAddress": "10.25.0.26",
"greatPlainsPlantCode": "55",
"streetAddress": "215 Technology Way",
"cityState": "Bowling Green, KY",
"zipcode": "42101",
"contactEmail": "ShippingReceivingBowlingGreen1@groups.alpla.com",
"contactPhone": "(270) 495-6647",
"customerTiAcc": "ALPL01BG1INT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "E:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"00:00\", \"late\": \"23:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [
{
"specialInstructions": "Please contact ShippingReceivingBowlingGreen1@groups.alpla.com to schedule a pick up appointment and bring 2 load bars to secure the load."
},
{
"destinationInstructions": [
{
"customerID": 96,
"instructions": "Delivery appointments must be scheduled at least 48 hours in advance—no same day appointments.&#10; Delivery appointments can be scheduled via RMlmwdockscheduling@LyonsMagnus.com&#10; Phone #- 559-268-5966 ext 1158."
}
]
}
]
},
{
"sName": "Iowa ISBM",
"serverDNS": "usiow1vms006",
"plantToken": "usiow2",
"idAddress": "10.75.0.26",
"greatPlainsPlantCode": "31",
"streetAddress": "2670 INDEPENDENCE RD",
"cityState": "Iowa CIty, IA",
"zipcode": "52240",
"contactEmail": "Dalina.Lacy@alpla.com",
"contactPhone": "",
"customerTiAcc": "ALPL01IA2INT",
"lstServerPort": "3001",
"active": true,
"serverLoc": "D:\\LST\\lstv2_2",
"oldVersion": "D:\\LST\\lst_backend_2",
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [{ "specialInstructions": "[header]" }]
},
{
"sName": "Kansas City",
"serverDNS": "usksc1vms006",
"plantToken": "usksc1",
"idAddress": "10.42.9.26",
"greatPlainsPlantCode": "85",
"streetAddress": "1800 E 94th St Suite 300",
"cityState": "Kansas City, MO",
"zipcode": "64131",
"contactEmail": "blake.matthes@alpla.com",
"contactPhone": "6366970253",
"customerTiAcc": "ALPL01KCINT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "E:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [{ "specialInstructions": "" }]
},
{
"sName": "Bowling Green 2",
"serverDNS": "usbow2vms006",
"plantToken": "usbow2",
"idAddress": "10.106.0.26",
"greatPlainsPlantCode": "56",
"streetAddress": "377 Southwood Ct",
"cityState": "Bowling Green, KY",
"zipcode": "42101",
"contactEmail": "blake.matthes@alpla.com",
"contactPhone": "6366970253",
"customerTiAcc": "ALPL01BG2INT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "E:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [{ "specialInstructions": "" }]
},
{
"sName": "MCDonough",
"serverDNS": "usmcd1vms006",
"plantToken": "usmcd1",
"idAddress": "10.193.0.26",
"greatPlainsPlantCode": "10",
"streetAddress": "289 GA-155 S",
"cityState": "McDonough, GA",
"zipcode": "30253",
"contactEmail": "shippingreceivingmcdonough@groups.alpla.com",
"contactPhone": "4049663122",
"customerTiAcc": "ALPL01MCDINT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "E:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [{ "specialInstructions": "" }]
},
{
"sName": "Dayton",
"serverDNS": "usday1vms006",
"plantToken": "usday1",
"idAddress": "10.44.0.26",
"greatPlainsPlantCode": "80",
"streetAddress": "2700 Concorde Dr Suite 200",
"cityState": "Vandalia, OH",
"zipcode": "45377",
"contactEmail": "Daniel.Deshields@alpla.com",
"contactPhone": "4846667452",
"customerTiAcc": "ALPL01DAYTONINT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "E:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"00:00\", \"late\": \"23:59\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [{ "specialInstructions": "" }]
},
{
"sName": "Salt Lake City",
"serverDNS": "usslc1vms006",
"plantToken": "usslc1",
"idAddress": "10.202.0.26",
"greatPlainsPlantCode": "70",
"streetAddress": "4324 Commercial Way Suite A",
"cityState": "Salt Lake City, UT",
"zipcode": "84104",
"contactEmail": "ShippingReceivingSaltLake@groups.alpla.com",
"contactPhone": "801-673-2143",
"customerTiAcc": "ALPL01SLCINT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "E:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"07:00\", \"late\": \"17:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [{ "specialInstructions": "Copy of bol" }]
},
{
"sName": "Lima",
"serverDNS": "uslim1vms006",
"plantToken": "uslim1",
"idAddress": "10.53.0.26",
"greatPlainsPlantCode": "50",
"streetAddress": "3320 Fort Shawnee Industrial Dr",
"cityState": "Lima, OH",
"zipcode": "45806",
"contactEmail": "shippingreceivinglima@groups.alpla.com",
"contactPhone": "",
"customerTiAcc": "ALPL01LIMAINT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "E:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"13:00\", \"late\": \"15:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [{ "specialInstructions": "" }]
},
{
"sName": "Florence",
"serverDNS": "usflo1vms006",
"plantToken": "usflo1",
"idAddress": "10.203.0.26",
"greatPlainsPlantCode": "22",
"streetAddress": "7080 New Buffington Rd",
"cityState": "Florence, KY",
"zipcode": "41042",
"contactEmail": "blake.matthes@alpla.com",
"contactPhone": "6366970253",
"customerTiAcc": "ALPL01FLORINT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "E:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [{ "specialInstructions": "" }]
},
{
"sName": "Iowa EBM",
"serverDNS": "usiow1vms006",
"plantToken": "usiow1",
"idAddress": "10.75.0.26",
"greatPlainsPlantCode": "30",
"streetAddress": "2258 Heinz Rd",
"cityState": "Iowa CIty, IA",
"zipcode": "52240",
"contactEmail": "shippingreceivingiowa1@groups.alpla.com",
"contactPhone": "3193378057",
"customerTiAcc": "ALPL01IA1INT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "D:\\LST\\lstv2",
"oldVersion": "D:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [{ "specialInstructions": "" }]
},
{
"sName": "Jefferson city",
"serverDNS": "usjci1vms006",
"plantToken": "usjci1",
"idAddress": "10.167.0.26",
"greatPlainsPlantCode": "40",
"streetAddress": "2662 Militia Dr",
"cityState": "Jefferson City, MO",
"zipcode": "65101",
"contactEmail": "blake.matthes@alpla.com",
"contactPhone": "6366970253",
"customerTiAcc": "ALPL01JCINT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "E:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [{ "specialInstructions": "" }]
},
{
"sName": "Sherman",
"serverDNS": "usshe1vms006",
"plantToken": "usshe1",
"idAddress": "10.205.0.26",
"greatPlainsPlantCode": "21",
"streetAddress": "3000 Howe Dr",
"cityState": "Sherman, TX",
"zipcode": "75092",
"contactEmail": "blake.matthes@alpla.com",
"contactPhone": "6366970253",
"customerTiAcc": "ALPL01SHERMANINT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "E:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [{ "specialInstructions": "" }]
},
{
"sName": "West Bend",
"serverDNS": "usweb1vms006",
"plantToken": "usweb1",
"idAddress": "10.80.0.26",
"greatPlainsPlantCode": "65",
"streetAddress": "825 Rail Way",
"cityState": "West Bend, WI",
"zipcode": "53095",
"contactEmail": "shippingreceivingwestbend@groups.alpla.com",
"contactPhone": "262-808-4211",
"customerTiAcc": "ALPL01WBINT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "E:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [
{
"specialInstructions": "This is a FTL load. The driver will need 2 adjustable load locks to secure the load. The driver will not be loaded without them. Please reference ALPLA pickup [header]",
"active": false
}
]
},
{
"sName": "St Peters",
"serverDNS": "usstp1vms006",
"plantToken": "usstp1",
"idAddress": "10.37.0.26",
"greatPlainsPlantCode": "45",
"streetAddress": "9 Cermak Blvd",
"cityState": "St. Peters, MO",
"zipcode": "63376",
"contactEmail": "Shippingreceivingstpeters@groups.alpla.com",
"contactPhone": "6365771018",
"customerTiAcc": "ALPL01STPINT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "D:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"00:01\", \"late\": \"23:59\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [{ "specialInstructions": "Loadbars/Straps required." }]
},
{
"sName": "Marked Tree",
"serverDNS": "usmar1vms006",
"plantToken": "usmar1",
"idAddress": "10.206.9.26",
"greatPlainsPlantCode": "90",
"streetAddress": "301 Industrial St",
"cityState": "Marked Tree, AR",
"zipcode": "72365",
"contactEmail": "Shippingreceivingstpeters@groups.alpla.com",
"contactPhone": "6365771018",
"customerTiAcc": "ALPL01MARINT",
"lstServerPort": "3000",
"active": true,
"serverLoc": "E:\\LST\\lstv2",
"oldVersion": "E:\\LST\\lst_backend",
"shippingHours": "[{\"early\": \"06:30\", \"late\": \"23:00\"}]",
"tiPostTime": "[{\"from\": \"24\", \"to\": \"24\"}]",
"otherSettings": [{ "specialInstructions": "Loadbars/Straps required." }]
}
]
}