Compare commits
15 Commits
feature/IO
...
feature/IO
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
771573409f | ||
|
|
cb9ccb7e77 | ||
|
|
a5d00d562c | ||
|
|
bdeeea0406 | ||
|
|
297d8afa8a | ||
|
|
3a12597c45 | ||
|
|
72c96f14eb | ||
|
|
de9d47272c | ||
|
|
3fd51f0140 | ||
|
|
84ec68f142 | ||
|
|
22af37e8f1 | ||
|
|
86affddc24 | ||
|
|
57fdffff09 | ||
|
|
281e50a43e | ||
|
|
237c575bab |
@@ -1,6 +1,6 @@
|
||||
import { useSplitClient } from "@splitsoftware/splitio-react";
|
||||
import { Button, Result } from "antd";
|
||||
import LogRocket from "logrocket";
|
||||
//import LogRocket from "logrocket";
|
||||
import { lazy, Suspense, useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
@@ -101,13 +101,13 @@ export function App({
|
||||
client.setAttribute("imexshopid", bodyshop.imexshopid);
|
||||
|
||||
if (client.getTreatment("LogRocket_Tracking") === "on") {
|
||||
console.log("LR Start");
|
||||
LogRocket.init(
|
||||
InstanceRenderMgr({
|
||||
imex: "gvfvfw/bodyshopapp",
|
||||
rome: "rome-online/rome-online"
|
||||
})
|
||||
);
|
||||
// console.log("LR Start");
|
||||
// LogRocket.init(
|
||||
// InstanceRenderMgr({
|
||||
// imex: "gvfvfw/bodyshopapp",
|
||||
// rome: "rome-online/rome-online"
|
||||
// })
|
||||
// );
|
||||
}
|
||||
}
|
||||
}, [bodyshop, client, currentUser.authorized]);
|
||||
|
||||
@@ -435,9 +435,9 @@ export function BillEnterModalLinesComponent({
|
||||
rules: [{ required: true }]
|
||||
}),
|
||||
formInput: () => (
|
||||
<Select
|
||||
showSearch
|
||||
style={{ minWidth: "3rem" }}
|
||||
<Select
|
||||
showSearch
|
||||
style={{ minWidth: "3rem" }}
|
||||
disabled={disabled}
|
||||
tabIndex={0}
|
||||
options={
|
||||
@@ -461,7 +461,7 @@ export function BillEnterModalLinesComponent({
|
||||
name: [field.name, "location"]
|
||||
}),
|
||||
formInput: () => (
|
||||
<Select
|
||||
<Select
|
||||
disabled={disabled}
|
||||
tabIndex={0}
|
||||
options={bodyshop.md_parts_locations.map((loc) => ({ value: loc, label: loc }))}
|
||||
@@ -495,7 +495,9 @@ export function BillEnterModalLinesComponent({
|
||||
{Enhanced_Payroll.treatment === "on" ? (
|
||||
<Space>
|
||||
{t("joblines.fields.assigned_team", { name: employeeTeamName?.name })}
|
||||
{`${jobline.mod_lb_hrs} units/${t(`joblines.fields.lbr_types.${jobline.mod_lbr_ty}`)}`}
|
||||
{jobline
|
||||
? `${jobline.mod_lb_hrs} units/${t(`joblines.fields.lbr_types.${jobline.mod_lbr_ty}`)}`
|
||||
: null}
|
||||
</Space>
|
||||
) : null}
|
||||
|
||||
@@ -506,10 +508,7 @@ export function BillEnterModalLinesComponent({
|
||||
rules={[{ required: true }]}
|
||||
name={[record.name, "lbr_adjustment", "mod_lbr_ty"]}
|
||||
>
|
||||
<Select
|
||||
allowClear
|
||||
options={CiecaSelect(false, true)}
|
||||
/>
|
||||
<Select allowClear options={CiecaSelect(false, true)} />
|
||||
</Form.Item>
|
||||
|
||||
{Enhanced_Payroll.treatment === "on" ? (
|
||||
|
||||
@@ -67,22 +67,25 @@ export function JobLinesUpsertModalComponent({ bodyshop, open, jobLine, handleCa
|
||||
</LayoutFormRow>
|
||||
<LayoutFormRow grow>
|
||||
<Form.Item label={t("joblines.fields.mod_lbr_ty")} name="mod_lbr_ty">
|
||||
<Select allowClear options={[
|
||||
{ value: "LAA", label: t("joblines.fields.lbr_types.LAA") },
|
||||
{ value: "LAB", label: t("joblines.fields.lbr_types.LAB") },
|
||||
{ value: "LAD", label: t("joblines.fields.lbr_types.LAD") },
|
||||
{ value: "LAE", label: t("joblines.fields.lbr_types.LAE") },
|
||||
{ value: "LAF", label: t("joblines.fields.lbr_types.LAF") },
|
||||
{ value: "LAG", label: t("joblines.fields.lbr_types.LAG") },
|
||||
{ value: "LAM", label: t("joblines.fields.lbr_types.LAM") },
|
||||
{ value: "LAR", label: t("joblines.fields.lbr_types.LAR") },
|
||||
{ value: "LAS", label: t("joblines.fields.lbr_types.LAS") },
|
||||
{ value: "LAU", label: t("joblines.fields.lbr_types.LAU") },
|
||||
{ value: "LA1", label: t("joblines.fields.lbr_types.LA1") },
|
||||
{ value: "LA2", label: t("joblines.fields.lbr_types.LA2") },
|
||||
{ value: "LA3", label: t("joblines.fields.lbr_types.LA3") },
|
||||
{ value: "LA4", label: t("joblines.fields.lbr_types.LA4") }
|
||||
]} />
|
||||
<Select
|
||||
allowClear
|
||||
options={[
|
||||
{ value: "LAA", label: t("joblines.fields.lbr_types.LAA") },
|
||||
{ value: "LAB", label: t("joblines.fields.lbr_types.LAB") },
|
||||
{ value: "LAD", label: t("joblines.fields.lbr_types.LAD") },
|
||||
{ value: "LAE", label: t("joblines.fields.lbr_types.LAE") },
|
||||
{ value: "LAF", label: t("joblines.fields.lbr_types.LAF") },
|
||||
{ value: "LAG", label: t("joblines.fields.lbr_types.LAG") },
|
||||
{ value: "LAM", label: t("joblines.fields.lbr_types.LAM") },
|
||||
{ value: "LAR", label: t("joblines.fields.lbr_types.LAR") },
|
||||
{ value: "LAS", label: t("joblines.fields.lbr_types.LAS") },
|
||||
{ value: "LAU", label: t("joblines.fields.lbr_types.LAU") },
|
||||
{ value: "LA1", label: t("joblines.fields.lbr_types.LA1") },
|
||||
{ value: "LA2", label: t("joblines.fields.lbr_types.LA2") },
|
||||
{ value: "LA3", label: t("joblines.fields.lbr_types.LA3") },
|
||||
{ value: "LA4", label: t("joblines.fields.lbr_types.LA4") }
|
||||
]}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item label={t("joblines.fields.op_code_desc")} name="op_code_desc">
|
||||
<Input />
|
||||
@@ -128,21 +131,27 @@ export function JobLinesUpsertModalComponent({ bodyshop, open, jobLine, handleCa
|
||||
</LayoutFormRow>
|
||||
<LayoutFormRow>
|
||||
<Form.Item label={t("joblines.fields.part_type")} name="part_type">
|
||||
<Select allowClear options={[
|
||||
{ value: "PAA", label: t("joblines.fields.part_types.PAA") },
|
||||
{ value: "PAC", label: t("joblines.fields.part_types.PAC") },
|
||||
{ value: "PAE", label: t("joblines.fields.part_types.PAE") },
|
||||
{ value: "PAL", label: t("joblines.fields.part_types.PAL") },
|
||||
{ value: "PAM", label: t("joblines.fields.part_types.PAM") },
|
||||
{ value: "PAN", label: t("joblines.fields.part_types.PAN") },
|
||||
{ value: "PAO", label: t("joblines.fields.part_types.PAO") },
|
||||
{ value: "PAR", label: t("joblines.fields.part_types.PAR") },
|
||||
{ value: "PAS", label: t("joblines.fields.part_types.PAS") }
|
||||
]} />
|
||||
<Select
|
||||
allowClear
|
||||
options={[
|
||||
{ value: "PAA", label: t("joblines.fields.part_types.PAA") },
|
||||
{ value: "PAC", label: t("joblines.fields.part_types.PAC") },
|
||||
{ value: "PAE", label: t("joblines.fields.part_types.PAE") },
|
||||
{ value: "PAL", label: t("joblines.fields.part_types.PAL") },
|
||||
{ value: "PAM", label: t("joblines.fields.part_types.PAM") },
|
||||
{ value: "PAN", label: t("joblines.fields.part_types.PAN") },
|
||||
{ value: "PAO", label: t("joblines.fields.part_types.PAO") },
|
||||
{ value: "PAR", label: t("joblines.fields.part_types.PAR") },
|
||||
{ value: "PAS", label: t("joblines.fields.part_types.PAS") }
|
||||
]}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item label={t("joblines.fields.oem_partno")} name="oem_partno">
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item label={t("joblines.fields.alt_partno")} name="alt_partno">
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("joblines.fields.part_qty")}
|
||||
name="part_qty"
|
||||
|
||||
@@ -80,14 +80,14 @@ const ModelInfoToolTip = ({ metadata, cardSettings }) =>
|
||||
<Col span={24}>
|
||||
<EllipsesToolTip
|
||||
title={
|
||||
metadata.v_model_yr || metadata.v_make_desc || metadata.v_model_desc
|
||||
? `${metadata.v_model_yr || ""} ${metadata.v_make_desc || ""} ${metadata.v_model_desc || ""}`
|
||||
metadata.v_model_yr || metadata.v_make_desc || metadata.v_model_desc || metadata.v_color
|
||||
? `${metadata.v_model_yr || ""} ${metadata.v_color || ""} ${metadata.v_make_desc || ""} ${metadata.v_model_desc || ""}`
|
||||
: null
|
||||
}
|
||||
kiosk={cardSettings.kiosk}
|
||||
>
|
||||
{metadata.v_model_yr || metadata.v_make_desc || metadata.v_model_desc ? (
|
||||
`${metadata.v_model_yr || ""} ${metadata.v_make_desc || ""} ${metadata.v_model_desc || ""}`
|
||||
{metadata.v_model_yr || metadata.v_make_desc || metadata.v_model_desc || metadata.v_color ? (
|
||||
`${metadata.v_model_yr || ""} ${metadata.v_color || ""} ${metadata.v_make_desc || ""} ${metadata.v_model_desc || ""}`
|
||||
) : (
|
||||
<span> </span>
|
||||
)}
|
||||
|
||||
@@ -140,13 +140,11 @@ const productionListColumnsData = ({ technician, state, activeStatuses, data, bo
|
||||
sortOrder: state.sortedInfo.columnKey === "vehicle" && state.sortedInfo.order,
|
||||
render: (text, record) =>
|
||||
technician ? (
|
||||
<>{`${record.v_model_yr || ""} ${record.v_make_desc || ""} ${record.v_model_desc || ""} ${
|
||||
record.v_color || ""
|
||||
} ${record.plate_no || ""}`}</>
|
||||
<>{`${record.v_model_yr || ""} ${record.v_color || ""}${record.v_make_desc || ""} ${record.v_model_desc || ""} ${record.plate_no || ""}`}</>
|
||||
) : (
|
||||
<Link to={`/manage/vehicles/${record.vehicleid}`}>{`${record.v_model_yr || ""} ${record.v_make_desc || ""} ${
|
||||
record.v_model_desc || ""
|
||||
} ${record.v_color || ""} ${record.plate_no || ""}`}</Link>
|
||||
<Link
|
||||
to={`/manage/vehicles/${record.vehicleid}`}
|
||||
>{`${record.v_model_yr || ""} ${record.v_color || ""} ${record.v_make_desc || ""} ${record.v_model_desc || ""} ${record.plate_no || ""}`}</Link>
|
||||
)
|
||||
},
|
||||
{
|
||||
@@ -621,7 +619,7 @@ const productionListColumnsData = ({ technician, state, activeStatuses, data, bo
|
||||
sortOrder: state.sortedInfo.columnKey === "dms_id" && state.sortedInfo.order
|
||||
}
|
||||
]
|
||||
: []),
|
||||
: [])
|
||||
];
|
||||
};
|
||||
export default productionListColumnsData;
|
||||
|
||||
@@ -48,7 +48,7 @@ export function ScheduleVerifyIntegrity({ currentUser }) {
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
if (currentUser.email === "patrick@imex.prod")
|
||||
if (currentUser.email === "allan@imex.prod" || currentUser.email === "dave@imex.prod")
|
||||
return (
|
||||
<Button loading={loading} onClick={handleVerify}>
|
||||
Developer Use Only - Verify Schedule Integrity
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { getAnalytics, logEvent } from "@firebase/analytics";
|
||||
//import { getAnalytics, logEvent } from "@firebase/analytics";
|
||||
import { initializeApp } from "@firebase/app";
|
||||
import { getAuth, updatePassword, updateProfile } from "@firebase/auth";
|
||||
import { getFirestore } from "@firebase/firestore";
|
||||
import { getMessaging, getToken, onMessage } from "@firebase/messaging";
|
||||
import { store } from "../redux/store";
|
||||
//import { store } from "../redux/store";
|
||||
//import * as amplitude from '@amplitude/analytics-browser';
|
||||
// import posthog from 'posthog-js'
|
||||
|
||||
@@ -12,7 +12,7 @@ initializeApp(config);
|
||||
|
||||
export const auth = getAuth();
|
||||
export const firestore = getFirestore();
|
||||
export const analytics = getAnalytics();
|
||||
//export const analytics = getAnalytics();
|
||||
|
||||
//export default firebase;
|
||||
export const getCurrentUser = () => {
|
||||
@@ -72,34 +72,36 @@ onMessage(messaging, (payload) => {
|
||||
// ...
|
||||
});
|
||||
|
||||
export const logImEXEvent = (eventName, additionalParams, stateProp = null) => {
|
||||
try {
|
||||
const state = stateProp || store.getState();
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
export const logImEXEvent = (eventName, additionalParams, _stateProp = null) => {
|
||||
// Disabled as a part of IO-3712.
|
||||
// try {
|
||||
// const state = stateProp || store.getState();
|
||||
|
||||
const eventParams = {
|
||||
shop: (state.user && state.user.bodyshop && state.user.bodyshop.shopname) || null,
|
||||
user: (state.user && state.user.currentUser && state.user.currentUser.email) || null,
|
||||
partsManagementOnly: state?.user?.partsManagementOnly,
|
||||
...additionalParams
|
||||
};
|
||||
// axios.post("/ioevent", {
|
||||
// useremail: (state.user && state.user.currentUser && state.user.currentUser.email) || null,
|
||||
// bodyshopid: (state.user && state.user.bodyshop && state.user.bodyshop.id) || null,
|
||||
// operationName: eventName,
|
||||
// variables: additionalParams,
|
||||
// dbevent: false,
|
||||
// env: `master-AIO|${import.meta.env.VITE_APP_GIT_SHA_DATE}`
|
||||
// });
|
||||
// console.log(
|
||||
// "%c[Analytics]",
|
||||
// "background-color: green ;font-weight:bold;",
|
||||
// eventName,
|
||||
// eventParams
|
||||
// );
|
||||
logEvent(analytics, eventName, eventParams);
|
||||
//amplitude.track(eventName, eventParams);
|
||||
//posthog.capture(eventName, eventParams);
|
||||
} finally {
|
||||
//If it fails, just keep going.
|
||||
}
|
||||
// const eventParams = {
|
||||
// shop: (state.user && state.user.bodyshop && state.user.bodyshop.shopname) || null,
|
||||
// user: (state.user && state.user.currentUser && state.user.currentUser.email) || null,
|
||||
// partsManagementOnly: state?.user?.partsManagementOnly,
|
||||
// ...additionalParams
|
||||
// };
|
||||
// // axios.post("/ioevent", {
|
||||
// // useremail: (state.user && state.user.currentUser && state.user.currentUser.email) || null,
|
||||
// // bodyshopid: (state.user && state.user.bodyshop && state.user.bodyshop.id) || null,
|
||||
// // operationName: eventName,
|
||||
// // variables: additionalParams,
|
||||
// // dbevent: false,
|
||||
// // env: `master-AIO|${import.meta.env.VITE_APP_GIT_SHA_DATE}`
|
||||
// // });
|
||||
// // console.log(
|
||||
// // "%c[Analytics]",
|
||||
// // "background-color: green ;font-weight:bold;",
|
||||
// // eventName,
|
||||
// // eventParams
|
||||
// // );
|
||||
// logEvent(analytics, eventName, eventParams);
|
||||
// //amplitude.track(eventName, eventParams);
|
||||
// //posthog.capture(eventName, eventParams);
|
||||
// } finally {
|
||||
// //If it fails, just keep going.
|
||||
// }
|
||||
};
|
||||
|
||||
@@ -14,8 +14,8 @@ import reportWebVitals from "./reportWebVitals";
|
||||
import "./translations/i18n";
|
||||
import "./utils/CleanAxios";
|
||||
// import * as amplitude from "@amplitude/analytics-browser";
|
||||
import { PostHogProvider } from "posthog-js/react";
|
||||
import posthog from "posthog-js";
|
||||
//import { PostHogProvider } from "posthog-js/react";
|
||||
//import posthog from "posthog-js";
|
||||
import { StrictMode } from "react";
|
||||
|
||||
window.global ||= window;
|
||||
@@ -44,11 +44,11 @@ Dinero.globalRoundingMode = "HALF_EVEN";
|
||||
// // }
|
||||
// });
|
||||
|
||||
posthog.init(import.meta.env.VITE_PUBLIC_POSTHOG_KEY, {
|
||||
autocapture: false,
|
||||
capture_exceptions: true,
|
||||
api_host: import.meta.env.VITE_PUBLIC_POSTHOG_HOST
|
||||
});
|
||||
// posthog.init(import.meta.env.VITE_PUBLIC_POSTHOG_KEY, {
|
||||
// autocapture: false,
|
||||
// capture_exceptions: true,
|
||||
// api_host: import.meta.env.VITE_PUBLIC_POSTHOG_HOST
|
||||
// });
|
||||
|
||||
const sentryCreateBrowserRouter = Sentry.wrapCreateBrowserRouterV6(createBrowserRouter);
|
||||
|
||||
@@ -70,9 +70,7 @@ function App() {
|
||||
return (
|
||||
<Provider store={store}>
|
||||
<PersistGate loading={<LoadingSpinner message="Restoring your settings..." />} persistor={persistor}>
|
||||
<PostHogProvider client={posthog}>
|
||||
<RouterProvider router={router} />
|
||||
</PostHogProvider>
|
||||
</PersistGate>
|
||||
</Provider>
|
||||
);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import FingerprintJS from "@fingerprintjs/fingerprintjs";
|
||||
import { setUserId, setUserProperties } from "@firebase/analytics";
|
||||
//import { setUserId, setUserProperties } from "@firebase/analytics";
|
||||
import {
|
||||
checkActionCode,
|
||||
confirmPasswordReset,
|
||||
@@ -13,10 +13,10 @@ import * as Sentry from "@sentry/react";
|
||||
import { notification } from "antd";
|
||||
import axios from "axios";
|
||||
import i18next from "i18next";
|
||||
import LogRocket from "logrocket";
|
||||
//import LogRocket from "logrocket";
|
||||
import { all, call, delay, put, select, takeLatest } from "redux-saga/effects";
|
||||
import {
|
||||
analytics,
|
||||
//analytics,
|
||||
auth,
|
||||
firestore,
|
||||
getCurrentUser,
|
||||
@@ -49,7 +49,7 @@ import {
|
||||
validatePasswordResetSuccess
|
||||
} from "./user.actions";
|
||||
import UserActionTypes from "./user.types";
|
||||
import posthog from "posthog-js";
|
||||
//import posthog from "posthog-js";
|
||||
import { bodyshopHasDmsKey, determineDMSTypeByBodyshop, DMS_MAP } from "../../utils/dmsUtils";
|
||||
|
||||
const fpPromise = FingerprintJS.load();
|
||||
@@ -91,9 +91,9 @@ export function* isUserAuthenticated() {
|
||||
return;
|
||||
}
|
||||
|
||||
LogRocket.identify(user.email);
|
||||
//LogRocket.identify(user.email);
|
||||
//amplitude.setUserId(user.email);
|
||||
posthog.identify(user.email);
|
||||
//posthog.identify(user.email);
|
||||
|
||||
const eulaQuery = yield client.query({
|
||||
query: QUERY_EULA,
|
||||
@@ -234,7 +234,7 @@ export function* onSignInSuccess() {
|
||||
}
|
||||
|
||||
export function* signInSuccessSaga({ payload }) {
|
||||
LogRocket.identify(payload.email);
|
||||
//LogRocket.identify(payload.email);
|
||||
|
||||
try {
|
||||
window.$crisp?.push(["set", "user:nickname", [payload.displayName || payload.email]]);
|
||||
@@ -279,17 +279,17 @@ export function* signInSuccessSaga({ payload }) {
|
||||
console.log("Error updating Crisp settings.", error);
|
||||
}
|
||||
|
||||
try {
|
||||
Sentry.setUser({
|
||||
email: payload.email,
|
||||
username: payload.displayName || payload.email
|
||||
});
|
||||
} catch (error) {
|
||||
console.log("Error setting Sentry user.", error);
|
||||
}
|
||||
// try {
|
||||
// Sentry.setUser({
|
||||
// email: payload.email,
|
||||
// username: payload.displayName || payload.email
|
||||
// });
|
||||
// } catch (error) {
|
||||
// console.log("Error setting Sentry user.", error);
|
||||
// }
|
||||
|
||||
setUserId(analytics, payload.email);
|
||||
setUserProperties(analytics, payload);
|
||||
// setUserId(analytics, payload.email);
|
||||
// setUserProperties(analytics, payload);
|
||||
yield;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,73 +1,71 @@
|
||||
const { isString } = require("lodash");
|
||||
const { sendServerEmail } = require("../email/sendemail");
|
||||
const logger = require("../utils/logger");
|
||||
const { raw } = require("express");
|
||||
|
||||
const SUPPORT_EMAIL = "patrick@imexsystems.ca";
|
||||
const SUPPORT_EMAIL = "support@imexsystems.ca";
|
||||
|
||||
const safeJsonParse = (maybeJson) => {
|
||||
if (!isString(maybeJson)) return null;
|
||||
try {
|
||||
return JSON.parse(maybeJson);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
if (!isString(maybeJson)) return null;
|
||||
try {
|
||||
return JSON.parse(maybeJson);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const handleBillAiFeedback = async (req, res) => {
|
||||
try {
|
||||
const rating = req.body?.rating;
|
||||
const comments = isString(req.body?.comments) ? req.body?.comments?.trim() : "";
|
||||
try {
|
||||
const rating = req.body?.rating;
|
||||
const comments = isString(req.body?.comments) ? req.body?.comments?.trim() : "";
|
||||
|
||||
const billFormValues = safeJsonParse(req.body?.billFormValues);
|
||||
const rawAIData = safeJsonParse(req.body?.rawAIData);
|
||||
const billFormValues = safeJsonParse(req.body?.billFormValues);
|
||||
const rawAIData = safeJsonParse(req.body?.rawAIData);
|
||||
|
||||
const jobid = billFormValues?.jobid || billFormValues?.jobId || "unknown";
|
||||
const shopname = req.body?.shopname || "unknown";
|
||||
const subject = `Bill AI Feedback (${rating === "up" ? "+" : "-"}) Shop=${shopname} jobid=${jobid}`;
|
||||
const jobid = billFormValues?.jobid || billFormValues?.jobId || "unknown";
|
||||
const shopname = req.body?.shopname || "unknown";
|
||||
const subject = `Bill AI Feedback (${rating === "up" ? "+" : "-"}) Shop=${shopname} jobid=${jobid}`;
|
||||
|
||||
const text = [
|
||||
`User: ${req?.user?.email || "unknown"}`,
|
||||
`Rating: ${rating}`,
|
||||
comments ? `Comments: ${comments}` : "Comments: (none)",
|
||||
"",
|
||||
"Form Values (User):",
|
||||
JSON.stringify(billFormValues, null, 4),
|
||||
"",
|
||||
"Raw AI Data:",
|
||||
JSON.stringify(rawAIData, null, 4)
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join("\n");
|
||||
const text = [
|
||||
`User: ${req?.user?.email || "unknown"}`,
|
||||
`Rating: ${rating}`,
|
||||
comments ? `Comments: ${comments}` : "Comments: (none)",
|
||||
"",
|
||||
"Form Values (User):",
|
||||
JSON.stringify(billFormValues, null, 4),
|
||||
"",
|
||||
"Raw AI Data:",
|
||||
JSON.stringify(rawAIData, null, 4)
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join("\n");
|
||||
|
||||
const attachments = [];
|
||||
if (req.file?.buffer) {
|
||||
attachments.push({
|
||||
filename: req.file.originalname || `bill-${jobid}.pdf`,
|
||||
content: req.file.buffer,
|
||||
contentType: req.file.mimetype || "application/pdf"
|
||||
});
|
||||
}
|
||||
|
||||
await sendServerEmail({
|
||||
to: [SUPPORT_EMAIL],
|
||||
subject,
|
||||
type: "text",
|
||||
text,
|
||||
attachments
|
||||
});
|
||||
|
||||
return res.json({ success: true });
|
||||
} catch (error) {
|
||||
logger.log("bill-ai-feedback-error", "ERROR", req?.user?.email, null, {
|
||||
message: error?.message,
|
||||
stack: error?.stack
|
||||
});
|
||||
return res.status(500).json({ message: "Failed to submit feedback" });
|
||||
const attachments = [];
|
||||
if (req.file?.buffer) {
|
||||
attachments.push({
|
||||
filename: req.file.originalname || `bill-${jobid}.pdf`,
|
||||
content: req.file.buffer,
|
||||
contentType: req.file.mimetype || "application/pdf"
|
||||
});
|
||||
}
|
||||
|
||||
await sendServerEmail({
|
||||
to: [SUPPORT_EMAIL],
|
||||
subject,
|
||||
type: "text",
|
||||
text,
|
||||
attachments
|
||||
});
|
||||
|
||||
return res.json({ success: true });
|
||||
} catch (error) {
|
||||
logger.log("bill-ai-feedback-error", "ERROR", req?.user?.email, null, {
|
||||
message: error?.message,
|
||||
stack: error?.stack
|
||||
});
|
||||
return res.status(500).json({ message: "Failed to submit feedback" });
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
handleBillAiFeedback
|
||||
handleBillAiFeedback
|
||||
};
|
||||
|
||||
@@ -52,7 +52,6 @@ exports.default = async (req, res) => {
|
||||
emailer
|
||||
.sendTaskEmail({
|
||||
to: [
|
||||
"patrick.fic@convenient-brands.com",
|
||||
"bradley.rhoades@convenient-brands.com",
|
||||
"jrome@rometech.com",
|
||||
"ivana@imexsystems.ca",
|
||||
|
||||
@@ -422,7 +422,6 @@ const emailBounce = async (req, res) => {
|
||||
rome: `Rome Online <noreply@romeonline.io>`
|
||||
}),
|
||||
to: replyTo,
|
||||
//bcc: "patrick@snapt.ca",
|
||||
subject: `${InstanceManager({
|
||||
imex: "ImEX Online",
|
||||
rome: "Rome Online"
|
||||
|
||||
@@ -6,11 +6,6 @@
|
||||
"active": false,
|
||||
"authlevel": 99
|
||||
},
|
||||
{
|
||||
"useremail": "patrick@imex.prod",
|
||||
"active": false,
|
||||
"authlevel": 99
|
||||
},
|
||||
{
|
||||
"useremail": "allan@imex.prod",
|
||||
"active": false,
|
||||
|
||||
@@ -501,7 +501,7 @@ async function CalculateRatesTotals({ job, client }) {
|
||||
? job.cieca_pfl[property.toUpperCase()].lbr_adjp
|
||||
: job.cieca_pfl[property.toUpperCase()].lbr_adjp * 100; //Adjust lbr_adjp to whole number
|
||||
} else {
|
||||
if (job.cieca_pfl["LAB"].lbr_adjp) {
|
||||
if (job.cieca_pfl["LAB"] && job.cieca_pfl["LAB"].lbr_adjp) {
|
||||
adjp =
|
||||
Math.abs(job.cieca_pfl["LAB"].lbr_adjp) > 1
|
||||
? job.cieca_pfl["LAB"].lbr_adjp
|
||||
|
||||
@@ -77,7 +77,6 @@ router.get("/wstest", eventAuthorizationMiddleware, (req, res) => {
|
||||
// text: "test2",
|
||||
// conversationid: "2b44d692-a9e4-4ed4-9c6b-7d8b0c44a0f6",
|
||||
// isoutbound: true,
|
||||
// userid: "patrick@imex.dev",
|
||||
// image: false,
|
||||
// image_path: [],
|
||||
newMessage: {
|
||||
@@ -104,7 +103,7 @@ router.get("/wstest", eventAuthorizationMiddleware, (req, res) => {
|
||||
text: `This is a test ${Math.round(Math.random() * 100)}`,
|
||||
updated_at: "2024-11-19T22:40:48.346875+00:00",
|
||||
status: "posted",
|
||||
userid: "patrick@imex.dev"
|
||||
userid: "allan@imex.prod"
|
||||
},
|
||||
conversationId: "2b44d692-a9e4-4ed4-9c6b-7d8b0c44a0f6",
|
||||
summary: false
|
||||
|
||||
@@ -2,12 +2,6 @@
|
||||
* List of admin email addresses
|
||||
* @type {string[]}
|
||||
*/
|
||||
const adminEmail = [
|
||||
"patrick@imex.dev",
|
||||
//"patrick@imex.test",
|
||||
"patrick@imex.prod",
|
||||
"patrick@imexsystems.ca",
|
||||
"patrick@thinkimex.com"
|
||||
];
|
||||
const adminEmail = ["allan@imex.prod", "dave@imex.prod"];
|
||||
|
||||
module.exports = adminEmail;
|
||||
|
||||
Reference in New Issue
Block a user