const express = require('express')
const router = express.Router()
const { authorization, } = require('../middleware/authentication')
const { contactCreate, testTemplate, uploadCrmConfig, callJournaling, oauthCallBack, install, deleteCrm, deleteCompany } = require('../controllers/crmController')
const { fileUpload } = require("../utils")

router.route('/create-contact').post(authorization, contactCreate)
router.route('/call-journaling').post(authorization, callJournaling)
router.route('/upload').post(fileUpload.single('crm'), authorization, uploadCrmConfig)
router.route('/delete').post(authorization, deleteCrm)
router.route('/delete-company').post(authorization, deleteCompany)
router.route('/oauth-callback').get(oauthCallBack)
router.route('/install').get(install)
router.route('/test').post(testTemplate)

module.exports = router
