const express = require('express')
const { results, entireinfo, saveresult, itemDelete, reports, result, resultwithid, deleteresult, result_with_roll } = require('../controller/result')

const router = express.Router()

// this all route is protected. implement on token.

// preview results
router.route('/preview/:session/:exam/:classn/:section/:department/:studentid').get(result) 
router.route('/preview_with_roll/:session/:exam/:classn/:section/:department/:studentid').get(result_with_roll) 
router.route('/preview').get(results) 
router.route('/preview/:withresultid/:withstudentid').get(resultwithid) 
// delete result
router.route('/delete/:id').delete(deleteresult)
// entire info.
router.route('/entireinfo/:exam/:classn/:section/:department').get(entireinfo)
// load result. if new entrys
// save result
router.route('/save').post(saveresult)
// slice result item
router.route('/delete-item/:id').delete(itemDelete)
// report
router.route('/reports/:session/:exam/:classn/:section/:department').get(reports)

module.exports = router