2019-05-23 16:41:50 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
const { apiStatusCheck } = require('../controllers/apiStatusCheck');
|
2019-06-14 08:05:24 +02:00
|
|
|
const { uploadDoorLockData } = require('../controllers/doorLock');
|
2019-06-18 23:59:00 +02:00
|
|
|
const { fetchMembersList } = require('../controllers/officeRnD');
|
2019-07-16 11:22:40 +02:00
|
|
|
const {
|
|
|
|
|
getKnownOfficeResourceMappings,
|
|
|
|
|
addNewMapping,
|
2019-08-28 09:30:19 +02:00
|
|
|
deleteMapping,
|
2019-08-28 12:44:47 +02:00
|
|
|
updateMapping,
|
2019-07-16 11:22:40 +02:00
|
|
|
getAllIncidentsController,
|
|
|
|
|
getMemberIncidents,
|
2019-07-25 14:40:33 +02:00
|
|
|
addFees,
|
|
|
|
|
checkProcessingStatus,
|
2019-08-05 12:06:18 +02:00
|
|
|
getPracticeSummaryReport,
|
2019-07-16 11:22:40 +02:00
|
|
|
} = require('../controllers/integration');
|
2019-06-18 23:59:00 +02:00
|
|
|
|
2019-06-14 08:05:24 +02:00
|
|
|
const { calculateDoorLockCharges } = require('../services/integration/doorLockCharges');
|
2019-05-23 16:41:50 +02:00
|
|
|
|
|
|
|
|
const express = require('express');
|
|
|
|
|
const router = express.Router();
|
|
|
|
|
|
|
|
|
|
router.get('/', apiStatusCheck);
|
2019-06-10 05:59:05 +02:00
|
|
|
|
2019-05-30 03:44:11 +02:00
|
|
|
router.post('/doorLock/upload', uploadDoorLockData);
|
2019-06-14 08:05:24 +02:00
|
|
|
router.get('/integration/mappings', getKnownOfficeResourceMappings);
|
|
|
|
|
router.post('/integration/mappings', addNewMapping);
|
2019-08-28 09:30:19 +02:00
|
|
|
router.delete('/integration/mappings/:mappingId', deleteMapping);
|
2019-08-28 12:44:47 +02:00
|
|
|
router.put('/integration/mappings/:mappingId', updateMapping);
|
2019-06-14 08:05:24 +02:00
|
|
|
|
2019-06-18 23:59:00 +02:00
|
|
|
router.get('/integration/report/member/:memberId/:startDate/:endDate', getMemberIncidents);
|
2019-07-08 18:50:10 +02:00
|
|
|
router.get('/integration/report/allIncidents/:startDate/:endDate', getAllIncidentsController);
|
2019-06-16 11:53:20 +02:00
|
|
|
|
2019-06-18 23:59:00 +02:00
|
|
|
router.get('/officeRnD/membersList', fetchMembersList);
|
|
|
|
|
|
2019-07-16 11:22:40 +02:00
|
|
|
router.post('/integration/addFees', addFees);
|
|
|
|
|
|
2019-07-25 14:40:33 +02:00
|
|
|
router.get('/integration/processing', checkProcessingStatus);
|
|
|
|
|
|
2019-08-09 00:05:17 +02:00
|
|
|
router.get('/integration/report/practiceSummary/:year', getPracticeSummaryReport);
|
2019-08-05 12:06:18 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-06-14 08:05:24 +02:00
|
|
|
// temporary route, manually trigger door lock charge calculations
|
|
|
|
|
router.get('/calculate', (req, res) => { calculateDoorLockCharges(); res.send();});
|
2019-05-23 16:41:50 +02:00
|
|
|
|
|
|
|
|
module.exports = router;
|