diff --git a/client/src/components/dashboard-grid/dashboard-grid.component.jsx b/client/src/components/dashboard-grid/dashboard-grid.component.jsx index 8a214051e..85b79f166 100644 --- a/client/src/components/dashboard-grid/dashboard-grid.component.jsx +++ b/client/src/components/dashboard-grid/dashboard-grid.component.jsx @@ -1,5 +1,5 @@ import Icon, { SyncOutlined } from "@ant-design/icons"; -import { useMutation, useQuery, useApolloClient } from "@apollo/client"; +import { useMutation, useQuery } from "@apollo/client"; import { Button, Dropdown, Space } from "antd"; import { PageHeader } from "@ant-design/pro-layout"; import { useMemo, useState, useEffect } from "react"; @@ -33,7 +33,6 @@ const mapDispatchToProps = () => ({ export function DashboardGridComponent({ currentUser }) { const { t } = useTranslation(); - const client = useApolloClient(); const notification = useNotification(); // Constants for layout defaults @@ -114,11 +113,6 @@ export function DashboardGridComponent({ currentUser }) { return false; } - // Note: Removed Apollo cache update to prevent triggering unwanted Redux actions - // Instead, evict the dashboard bodyshop query from cache to ensure fresh data on next fetch - client.cache.evict({ fieldName: "dashboard_bodyshops" }); - client.cache.gc(); - return true; } catch (err) { console.error(`Dashboard ${errorContext} failed`, err); @@ -202,7 +196,7 @@ export function DashboardGridComponent({ currentUser }) { - diff --git a/server/data/carfax-rps.js b/server/data/carfax-rps.js index d6065df57..de267d7ac 100644 --- a/server/data/carfax-rps.js +++ b/server/data/carfax-rps.js @@ -277,6 +277,7 @@ const GenerateDetailLines = (line) => { line_desc: line.line_desc ? line.line_desc.replace(NON_ASCII_REGEX, "") : null, oem_partno: line.oem_partno ? line.oem_partno.replace(NON_ASCII_REGEX, "") : null, alt_partno: line.alt_partno ? line.alt_partno.replace(NON_ASCII_REGEX, "") : null, + op_code: line.lbr_op || null, op_code_desc: generateOpCodeDescription(line.lbr_op), lbr_ty: generateLaborType(line.mod_lbr_ty), lbr_hrs: line.mod_lb_hrs || 0, diff --git a/server/data/carfax.js b/server/data/carfax.js index f2ff0bac2..aaa7d0dde 100644 --- a/server/data/carfax.js +++ b/server/data/carfax.js @@ -336,6 +336,7 @@ const GenerateDetailLines = (line) => { line_desc: line.line_desc ? line.line_desc.replace(NON_ASCII_REGEX, "") : null, oem_partno: line.oem_partno ? line.oem_partno.replace(NON_ASCII_REGEX, "") : null, alt_partno: line.alt_partno ? line.alt_partno.replace(NON_ASCII_REGEX, "") : null, + op_code: line.lbr_op || null, op_code_desc: line.op_code_desc ? line.op_code_desc.replace(NON_ASCII_REGEX, "") : null, lbr_ty: generateLaborType(line.mod_lbr_ty), lbr_hrs: line.mod_lb_hrs || 0, diff --git a/server/graphql-client/queries.js b/server/graphql-client/queries.js index 397e90de8..0ada3141d 100644 --- a/server/graphql-client/queries.js +++ b/server/graphql-client/queries.js @@ -905,6 +905,7 @@ exports.CARFAX_QUERY = `query CARFAX_EXPORT($start: timestamptz, $bodyshopid: uu line_desc mod_lb_hrs mod_lbr_ty + lbr_op oem_partno op_code_desc part_type @@ -2906,6 +2907,7 @@ exports.GET_BODYSHOP_BY_ID = ` intellipay_config state notification_followers + timezone } } `; @@ -2997,6 +2999,7 @@ query GET_JOBID_BY_MERCHANTID_RONUMBER($merchantID: String!, $roNumber: String!) id intellipay_config email + timezone } } }`; @@ -3006,6 +3009,7 @@ query GET_BODYSHOP_BY_MERCHANTID($merchantID: String!) { bodyshops(where: {intellipay_merchant_id: {_eq: $merchantID}}) { id email + timezone } }`; diff --git a/server/intellipay/lib/handleCommentBasedPayment.js b/server/intellipay/lib/handleCommentBasedPayment.js index 535e92ab8..fd2ff3ef8 100644 --- a/server/intellipay/lib/handleCommentBasedPayment.js +++ b/server/intellipay/lib/handleCommentBasedPayment.js @@ -48,7 +48,9 @@ const handleCommentBasedPayment = async (values, decodedComment, logger, logMeta payer: "Customer", type: getPaymentType(ipMapping, values.cardtype), jobid: p.jobid, - date: moment(Date.now()), + date: moment() + .tz(bodyshop?.bodyshops_by_pk?.timezone ?? "UTC") + .format("YYYY-MM-DD"), payment_responses: { data: { amount: values.total, diff --git a/server/intellipay/lib/handleInvoiceBasedPayment.js b/server/intellipay/lib/handleInvoiceBasedPayment.js index d5fc97b9c..34a1a5e8d 100644 --- a/server/intellipay/lib/handleInvoiceBasedPayment.js +++ b/server/intellipay/lib/handleInvoiceBasedPayment.js @@ -97,7 +97,9 @@ const handleInvoiceBasedPayment = async (values, logger, logMeta, res) => { payer: "Customer", type: getPaymentType(ipMapping, values.cardtype), jobid: job.id, - date: moment(Date.now()) + date: moment() + .tz(bodyshop?.timezone ?? "UTC") + .format("YYYY-MM-DD") } }); diff --git a/server/notifications/queues/appQueue.js b/server/notifications/queues/appQueue.js index 1f198698c..b376b2cf6 100644 --- a/server/notifications/queues/appQueue.js +++ b/server/notifications/queues/appQueue.js @@ -92,7 +92,7 @@ const loadAppQueue = async ({ pubClient, logger, redisHelpers, ioRedis }) => { "consolidate-notifications", { jobId, recipients }, { - jobId: `consolidate:${jobId}`, + jobId: `consolidate-${jobId}`, delay: APP_CONSOLIDATION_DELAY, attempts: 3, backoff: LOCK_EXPIRATION @@ -288,7 +288,7 @@ const dispatchAppsToQueue = async ({ appsToDispatch }) => { await appQueue.add( "add-notification", { jobId, bodyShopId, key, variables, recipients, body, jobRoNumber }, - { jobId: `${jobId}:${Date.now()}` } + { jobId: `${jobId}-${Date.now()}` } ); devDebugLogger(`Added notification to queue for jobId ${jobId} with ${recipients.length} recipients`); } diff --git a/server/notifications/queues/emailQueue.js b/server/notifications/queues/emailQueue.js index 7d965cb69..a5ad8a530 100644 --- a/server/notifications/queues/emailQueue.js +++ b/server/notifications/queues/emailQueue.js @@ -86,7 +86,7 @@ const loadEmailQueue = async ({ pubClient, logger }) => { "consolidate-emails", { jobId, jobRoNumber, bodyShopName, bodyShopTimezone }, { - jobId: `consolidate:${jobId}`, + jobId: `consolidate-${jobId}`, delay: EMAIL_CONSOLIDATION_DELAY, attempts: 3, backoff: LOCK_EXPIRATION @@ -252,7 +252,7 @@ const dispatchEmailsToQueue = async ({ emailsToDispatch, logger }) => { await emailAddQueue.add( "add-email-notification", { jobId, jobRoNumber, bodyShopName, bodyShopTimezone, body, recipients }, - { jobId: `${jobId}:${Date.now()}` } + { jobId: `${jobId}-${Date.now()}` } ); devDebugLogger(`Added email notification to queue for jobId ${jobId} with ${recipients.length} recipients`); }