{"size": 1609, "ext": "js", "max_stars_repo_path": "routes/records.js", "max_stars_repo_name": "devJeremyt/vacstrack", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "routes/records.js", "max_issues_repo_name": "devJeremyt/vacstrack", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "routes/records.js", "max_forks_repo_name": "devJeremyt/vacstrack", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 41.2564102564, "max_line_length": 151, "alphanum_fraction": 0.7228091983}
var express = require('express');
var router = express.Router();
const vaccinesController = require('../controllers/vaccinesController')
const authorize = require('../authorize')

router.get('/', authorize(['HR Representative', 'Administrator']), (req, res)=> vaccinesController.viewRecords(req, res))

router.get('/view', authorize(['HR Representative', 'Administrator', 'Standard']), (req,res)=>{vaccinesController.viewIndividualRecord(req, res)})

router.get('/new', (req, res)=>{
    res.render('record/new')
})

router.post('/new', (req, res)=>{
    vaccinesController.addVacsRecord(req, res)
})

router.get('/edit', (req, res)=>vaccinesController.editRecord(req, res))

router.get('/specificrecord', (req, res)=> vaccinesController.viewSpecificRecord(req, res))

router.post('/edit', (req,res)=>vaccinesController.submitRecordEdit(req, res))

router.get('/pendingApproval', authorize(['HR Representative', 'Administrator']), (req, res)=> vaccinesController.viewPendingApprovalRecords(req, res))

router.get('/support/new', (req, res)=> res.render('record/support/new'))

router.post('/support/new', (req,res)=> res.render('index'))

router.get('/test/new', (req, res)=> res.render('record/test/new'))

router.post('/test/new', (req, res)=> vaccinesController.createTestResult(req, res))

router.get('/needapproval', authorize(['HR Representative', 'Administrator']), (req, res)=> vaccinesController.getRecordsPendingApproval(req, res))

router.get('/markApproved', authorize(['HR Representative', 'Administrator']), (req, res)=> vaccinesController.markRecordApproved(req, res))


module.exports = router