feature/IO-2282-VSSTA-Integration:
- Boilerplate in new route - Fix issues with imgproxy - Clean up imgproxy
This commit is contained in:
36
server/integrations/VSSTA/vsstaIntegration.js
Normal file
36
server/integrations/VSSTA/vsstaIntegration.js
Normal file
@@ -0,0 +1,36 @@
|
||||
const client = require("../../graphql-client/graphql-client").client;
|
||||
|
||||
/**
|
||||
* VSSTA Integration
|
||||
* @param req
|
||||
* @param res
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
const vsstaIntegration = async (req, res) => {
|
||||
const { logger } = req;
|
||||
|
||||
// Examplwe req.body
|
||||
//{
|
||||
// "shop_id":"test",
|
||||
// "“ro_nbr“":"71475",
|
||||
// "vin_nbr":"12345678912345678",
|
||||
// "pdf_download_link":"https://portal-staging.vssta.com/invoice_data/1500564",
|
||||
// "“company_api_key“":"xxxxx",
|
||||
// "scan_type":"PRE",
|
||||
// "scan_fee":"119.00",
|
||||
// "scanner_number":"1234",
|
||||
// "scan_time":"2022-08-23 17:53:50",
|
||||
// "technician":"Frank Jones",
|
||||
// "year":"2021",
|
||||
// "make":"TOYOTA",
|
||||
// "model":"Tacoma SR5 grade"
|
||||
//
|
||||
// }
|
||||
// 1 - We would want to get the Job by searching the ro_nbr and shop_id (The assumption)
|
||||
|
||||
// 2 - We want to download the file provided from the pdf_download_link and associate (upload) it
|
||||
// to S3 bucket for media, and insert a document record in the database, the file is base64 encoded (pdf), we will want to unencode it when storing it as a pdf
|
||||
// We might not have to un-encode it, ultimately we want to send the base64 and the end is a pdf file the user can view from the documents section.
|
||||
};
|
||||
|
||||
module.exports = vsstaIntegration;
|
||||
Reference in New Issue
Block a user