feature/IO-3187-Admin-Enhancements - Minor cleanup

This commit is contained in:
Dave Richer
2025-04-15 14:21:28 -04:00
parent 0e75f54d6e
commit aa6ad109c9

View File

@@ -51,8 +51,8 @@ const vsstaIntegrationRoute = async (req, res) => {
});
}
const { shop_id, ro_nbr, pdf_download_link, scan_type, scan_time, technician, year, make, model, company_api_key } =
req.body;
// technician, year, make, model, is also available.
const { shop_id, ro_nbr, pdf_download_link, scan_type, scan_time, company_api_key } = req.body;
// 1. Get the job record by ro_number and shop_id
const jobResult = await client.request(GET_JOB_BY_RO_NUMBER_AND_SHOP_ID, {
@@ -82,7 +82,7 @@ const vsstaIntegrationRoute = async (req, res) => {
// 4. Generate key for S3
const timestamp = moment(scan_time).tz(job.bodyshop.timezone).format("YYYYMMDD-HHmmss");
const fileName = `${timestamp}_VSSTA_${scan_type}_Scan_${technician}_${year}_${make}_${model}`;
const fileName = `${timestamp}_VSSTA_${scan_type}`;
const s3Key = `${job.shopid}/${job.id}/${fileName.replace(/[^A-Z0-9]+/gi, "_")}.pdf`;
// 5. Generate presigned URL for S3 upload