Compare commits
11 Commits
feature/IO
...
feature/IO
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
079dffce4d | ||
|
|
6005eaee6a | ||
|
|
c069600cfd | ||
|
|
186cbf2c97 | ||
|
|
392988ae11 | ||
|
|
2e33b79eb9 | ||
|
|
fa99ef7b37 | ||
|
|
c4aff1b516 | ||
|
|
61276bb2d1 | ||
|
|
9ab41308e7 | ||
|
|
12c87ed689 |
@@ -81,8 +81,9 @@ export function HasFeatureAccess({ featureName, bodyshop, bypass, debug = false
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
bodyshop?.features?.allAccess ||
|
bodyshop?.features?.allAccess ||
|
||||||
bodyshop?.features?.[featureName] ||
|
(typeof bodyshop?.features?.[featureName] === "boolean"
|
||||||
dayjs(bodyshop?.features[featureName]).isAfter(dayjs())
|
? bodyshop?.features?.[featureName]
|
||||||
|
: dayjs(bodyshop?.features?.[featureName]).isAfter(dayjs()))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,12 @@ import { Col, Row } from "antd";
|
|||||||
import Axios from "axios";
|
import Axios from "axios";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import queryString from "query-string";
|
import queryString from "query-string";
|
||||||
import React, { useCallback, useEffect, useState } from "react";
|
import { useCallback, useEffect, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { useLocation, useNavigate } from "react-router-dom";
|
import { useLocation, useNavigate } from "react-router-dom";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
import {
|
import {
|
||||||
DELETE_AVAILABLE_JOB,
|
DELETE_AVAILABLE_JOB,
|
||||||
@@ -33,7 +34,6 @@ import OwnerFindModalContainer from "../owner-find-modal/owner-find-modal.contai
|
|||||||
import { GetSupplementDelta } from "./jobs-available-supplement.estlines.util";
|
import { GetSupplementDelta } from "./jobs-available-supplement.estlines.util";
|
||||||
import HeaderFields from "./jobs-available-supplement.headerfields";
|
import HeaderFields from "./jobs-available-supplement.headerfields";
|
||||||
import JobsAvailableTableComponent from "./jobs-available-table.component";
|
import JobsAvailableTableComponent from "./jobs-available-table.component";
|
||||||
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -195,7 +195,7 @@ export function JobsAvailableContainer({ bodyshop, currentUser, insertAuditTrail
|
|||||||
|
|
||||||
await deleteJob({
|
await deleteJob({
|
||||||
variables: { id: estData.id }
|
variables: { id: estData.id }
|
||||||
}).then((r) => {
|
}).then(() => {
|
||||||
refetch();
|
refetch();
|
||||||
setInsertLoading(false);
|
setInsertLoading(false);
|
||||||
});
|
});
|
||||||
@@ -315,7 +315,7 @@ export function JobsAvailableContainer({ bodyshop, currentUser, insertAuditTrail
|
|||||||
|
|
||||||
deleteJob({
|
deleteJob({
|
||||||
variables: { id: estData.id }
|
variables: { id: estData.id }
|
||||||
}).then((r) => {
|
}).then(() => {
|
||||||
refetch();
|
refetch();
|
||||||
setInsertLoading(false);
|
setInsertLoading(false);
|
||||||
});
|
});
|
||||||
@@ -372,7 +372,7 @@ export function JobsAvailableContainer({ bodyshop, currentUser, insertAuditTrail
|
|||||||
loadEstData({ variables: { id: record.id } });
|
loadEstData({ variables: { id: record.id } });
|
||||||
modalSearchState[1](record.clm_no);
|
modalSearchState[1](record.clm_no);
|
||||||
setJobModalVisible(true);
|
setJobModalVisible(true);
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -456,7 +456,7 @@ function replaceEmpty(someObj, replaceValue = null) {
|
|||||||
return JSON.parse(temp);
|
return JSON.parse(temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function CheckTaxRatesUSA(estData, bodyshop) {
|
async function CheckTaxRatesUSA(estData) {
|
||||||
if (!estData.parts_tax_rates?.PAM) {
|
if (!estData.parts_tax_rates?.PAM) {
|
||||||
estData.parts_tax_rates.PAM = estData.parts_tax_rates.PAC;
|
estData.parts_tax_rates.PAM = estData.parts_tax_rates.PAC;
|
||||||
}
|
}
|
||||||
@@ -568,7 +568,7 @@ async function CheckTaxRates(estData, bodyshop) {
|
|||||||
});
|
});
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
function ResolveCCCLineIssues(estData, bodyshop) {
|
function ResolveCCCLineIssues(estData) {
|
||||||
//Find all misc amounts, populate them to the act price.
|
//Find all misc amounts, populate them to the act price.
|
||||||
//This needs to be done before cleansing unq_seq since some misc prices could move over.
|
//This needs to be done before cleansing unq_seq since some misc prices could move over.
|
||||||
estData.joblines.data.forEach((line) => {
|
estData.joblines.data.forEach((line) => {
|
||||||
@@ -585,6 +585,9 @@ function ResolveCCCLineIssues(estData, bodyshop) {
|
|||||||
// line.notes += ` | ET/UT Update (prev = ${line.mod_lbr_ty})`;
|
// line.notes += ` | ET/UT Update (prev = ${line.mod_lbr_ty})`;
|
||||||
line.mod_lbr_ty = "LAR";
|
line.mod_lbr_ty = "LAR";
|
||||||
}
|
}
|
||||||
|
if (line.mod_lbr_ty === "OTSL") {
|
||||||
|
line.mod_lbr_ty = line.mod_lbr_hrs === 0 ? null : "LAB";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
74
package-lock.json
generated
74
package-lock.json
generated
@@ -50,7 +50,7 @@
|
|||||||
"node-persist": "^4.0.4",
|
"node-persist": "^4.0.4",
|
||||||
"nodemailer": "^6.10.0",
|
"nodemailer": "^6.10.0",
|
||||||
"phone": "^3.1.58",
|
"phone": "^3.1.58",
|
||||||
"query-string": "^9.1.2",
|
"query-string": "7.1.3",
|
||||||
"recursive-diff": "^1.0.9",
|
"recursive-diff": "^1.0.9",
|
||||||
"rimraf": "^6.0.1",
|
"rimraf": "^6.0.1",
|
||||||
"skia-canvas": "^2.0.2",
|
"skia-canvas": "^2.0.2",
|
||||||
@@ -5853,12 +5853,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/decode-uri-component": {
|
"node_modules/decode-uri-component": {
|
||||||
"version": "0.4.1",
|
"version": "0.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz",
|
||||||
"integrity": "sha512-+8VxcR21HhTy8nOt6jf20w0c9CADrw1O8d+VZ/YzzCt4bJ3uBjw+D1q2osAB8RnpwwaeYBxy0HyKQxD5JBMuuQ==",
|
"integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.16"
|
"node": ">=0.10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/decompress-response": {
|
"node_modules/decompress-response": {
|
||||||
@@ -7102,15 +7102,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/filter-obj": {
|
"node_modules/filter-obj": {
|
||||||
"version": "5.1.0",
|
"version": "1.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-5.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz",
|
||||||
"integrity": "sha512-qWeTREPoT7I0bifpPUXtxkZJ1XJzxWtfoWWkdVGqa+eCr3SHW/Ocp89o8vLvbUuQnadybJpjOKu4V+RwO6sGng==",
|
"integrity": "sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.16"
|
"node": ">=0.10.0"
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/finalhandler": {
|
"node_modules/finalhandler": {
|
||||||
@@ -8132,24 +8129,6 @@
|
|||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/intuit-oauth/node_modules/decode-uri-component": {
|
|
||||||
"version": "0.2.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz",
|
|
||||||
"integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==",
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.10"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/intuit-oauth/node_modules/filter-obj": {
|
|
||||||
"version": "1.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz",
|
|
||||||
"integrity": "sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ==",
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.10.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/intuit-oauth/node_modules/query-string": {
|
"node_modules/intuit-oauth/node_modules/query-string": {
|
||||||
"version": "6.14.1",
|
"version": "6.14.1",
|
||||||
"resolved": "https://registry.npmjs.org/query-string/-/query-string-6.14.1.tgz",
|
"resolved": "https://registry.npmjs.org/query-string/-/query-string-6.14.1.tgz",
|
||||||
@@ -8168,15 +8147,6 @@
|
|||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/intuit-oauth/node_modules/split-on-first": {
|
|
||||||
"version": "1.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz",
|
|
||||||
"integrity": "sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==",
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/ioredis": {
|
"node_modules/ioredis": {
|
||||||
"version": "5.6.1",
|
"version": "5.6.1",
|
||||||
"resolved": "https://registry.npmjs.org/ioredis/-/ioredis-5.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/ioredis/-/ioredis-5.6.1.tgz",
|
||||||
@@ -10348,17 +10318,18 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/query-string": {
|
"node_modules/query-string": {
|
||||||
"version": "9.1.2",
|
"version": "7.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/query-string/-/query-string-9.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/query-string/-/query-string-7.1.3.tgz",
|
||||||
"integrity": "sha512-s3UlTyjxRux4KjwWaJsjh1Mp8zoCkSGKirbD9H89pEM9UOZsfpRZpdfzvsy2/mGlLfC3NnYVpy2gk7jXITHEtA==",
|
"integrity": "sha512-hh2WYhq4fi8+b+/2Kg9CEge4fDPvHS534aOOvOZeQ3+Vf2mCFsaFBYj0i+iXcAq6I9Vzp5fjMFBlONvayDC1qg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"decode-uri-component": "^0.4.1",
|
"decode-uri-component": "^0.2.2",
|
||||||
"filter-obj": "^5.1.0",
|
"filter-obj": "^1.1.0",
|
||||||
"split-on-first": "^3.0.0"
|
"split-on-first": "^1.0.0",
|
||||||
|
"strict-uri-encode": "^2.0.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=6"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
@@ -11496,15 +11467,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/split-on-first": {
|
"node_modules/split-on-first": {
|
||||||
"version": "3.0.0",
|
"version": "1.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz",
|
||||||
"integrity": "sha512-qxQJTx2ryR0Dw0ITYyekNQWpz6f8dGd7vffGNflQQ3Iqj9NJ6qiZ7ELpZsJ/QBhIVAiDfXdag3+Gp8RvWa62AA==",
|
"integrity": "sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12"
|
"node": ">=6"
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/sprintf-js": {
|
"node_modules/sprintf-js": {
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
"node-persist": "^4.0.4",
|
"node-persist": "^4.0.4",
|
||||||
"nodemailer": "^6.10.0",
|
"nodemailer": "^6.10.0",
|
||||||
"phone": "^3.1.58",
|
"phone": "^3.1.58",
|
||||||
"query-string": "^9.1.2",
|
"query-string": "7.1.3",
|
||||||
"recursive-diff": "^1.0.9",
|
"recursive-diff": "^1.0.9",
|
||||||
"rimraf": "^6.0.1",
|
"rimraf": "^6.0.1",
|
||||||
"skia-canvas": "^2.0.2",
|
"skia-canvas": "^2.0.2",
|
||||||
|
|||||||
@@ -4,4 +4,5 @@ exports.chatter = require("./chatter").default;
|
|||||||
exports.claimscorp = require("./claimscorp").default;
|
exports.claimscorp = require("./claimscorp").default;
|
||||||
exports.kaizen = require("./kaizen").default;
|
exports.kaizen = require("./kaizen").default;
|
||||||
exports.usageReport = require("./usageReport").default;
|
exports.usageReport = require("./usageReport").default;
|
||||||
exports.podium = require("./podium").default;
|
exports.podium = require("./podium").default;
|
||||||
|
exports.emsUpload = require("./emsUpload").default;
|
||||||
22
server/data/emsUpload.js
Normal file
22
server/data/emsUpload.js
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
const moment = require("moment-timezone");
|
||||||
|
const logger = require("../utils/logger");
|
||||||
|
const s3Client = require("../utils/s3"); // Using the S3 client utilities with LocalStack support
|
||||||
|
|
||||||
|
const emsUpload = async (req, res) => {
|
||||||
|
try {
|
||||||
|
const { bodyshopid, ciecaid, clm_no, ownr_ln } = req.body;
|
||||||
|
const presignedUrl = await s3Client.getPresignedUrl({
|
||||||
|
bucketName: process.env.S3_EMS_UPLOAD_BUCKET,
|
||||||
|
key: `${bodyshopid}/${ciecaid}-${clm_no}-${ownr_ln}-${moment().format("YYYY-MM-DD--HH-mm-ss")}.zip`
|
||||||
|
});
|
||||||
|
res.status(200).json({ presignedUrl });
|
||||||
|
} catch (error) {
|
||||||
|
logger.log("ems-upload-presign-error", "ERROR", req?.user?.email, null, {
|
||||||
|
error: error.message,
|
||||||
|
stack: error.stack
|
||||||
|
});
|
||||||
|
res.status(500).json({ error: error.message, stack: error.stack });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.default = emsUpload;
|
||||||
@@ -138,6 +138,9 @@ router.post("/canvastest", validateFirebaseIdTokenMiddleware, canvastest);
|
|||||||
// Alert Check
|
// Alert Check
|
||||||
router.post("/alertcheck", eventAuthorizationMiddleware, alertCheck);
|
router.post("/alertcheck", eventAuthorizationMiddleware, alertCheck);
|
||||||
|
|
||||||
|
//EMS Upload
|
||||||
|
router.post("/emsupload", validateFirebaseIdTokenMiddleware, data.emsUpload);
|
||||||
|
|
||||||
// Redis Cache Routes
|
// Redis Cache Routes
|
||||||
router.post("/bodyshop-cache", eventAuthorizationMiddleware, updateBodyshopCache);
|
router.post("/bodyshop-cache", eventAuthorizationMiddleware, updateBodyshopCache);
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ const {
|
|||||||
const { defaultProvider } = require("@aws-sdk/credential-provider-node");
|
const { defaultProvider } = require("@aws-sdk/credential-provider-node");
|
||||||
const { InstanceRegion } = require("./instanceMgr");
|
const { InstanceRegion } = require("./instanceMgr");
|
||||||
const { isString, isEmpty } = require("lodash");
|
const { isString, isEmpty } = require("lodash");
|
||||||
|
const { getSignedUrl } = require("@aws-sdk/s3-request-presigner");
|
||||||
|
|
||||||
const createS3Client = () => {
|
const createS3Client = () => {
|
||||||
const S3Options = {
|
const S3Options = {
|
||||||
@@ -95,6 +96,17 @@ const createS3Client = () => {
|
|||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getPresignedUrl = async ({ bucketName, key }) => {
|
||||||
|
const command = new PutObjectCommand({
|
||||||
|
Bucket: bucketName,
|
||||||
|
Key: key,
|
||||||
|
StorageClass: "INTELLIGENT_TIERING"
|
||||||
|
});
|
||||||
|
const presignedUrl = await getSignedUrl(s3Client, command, { expiresIn: 360 });
|
||||||
|
return presignedUrl;
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
uploadFileToS3,
|
uploadFileToS3,
|
||||||
downloadFileFromS3,
|
downloadFileFromS3,
|
||||||
@@ -102,8 +114,12 @@ const createS3Client = () => {
|
|||||||
deleteFileFromS3,
|
deleteFileFromS3,
|
||||||
copyFileInS3,
|
copyFileInS3,
|
||||||
fileExistsInS3,
|
fileExistsInS3,
|
||||||
|
getPresignedUrl,
|
||||||
...s3Client
|
...s3Client
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
module.exports = createS3Client();
|
module.exports = createS3Client();
|
||||||
|
|||||||
Reference in New Issue
Block a user