import express from 'express';
const router = express.Router();
import {
    createTermination, getTerminations, getTerminationById, updateTerminationStatus,
    submitScnResponse, recordPersonalHearing, updateClearance, uploadTerminationDocument, issueScn, uploadScnResponse, finalizeTermination
} from './termination.controller.js';
import { authenticate } from '../../common/middleware/auth.js';
import { uploadSingle, uploadMultipleIfMultipart } from '../../common/middleware/upload.js';

router.use(authenticate as any);

router.post('/', uploadMultipleIfMultipart, createTermination);
router.get('/', getTerminations);
router.get('/:id', getTerminationById);
router.put('/:id/status', updateTerminationStatus);
router.post('/:id/status', updateTerminationStatus);
router.post('/:id/scn', issueScn);
router.post('/:id/scn-response', uploadSingle, uploadScnResponse);
router.post('/:id/finalize', finalizeTermination);
router.post('/scn-response', submitScnResponse);
router.post('/hearing-record', recordPersonalHearing);
router.put('/:id/clearance', updateClearance);
router.post('/:id/documents', uploadSingle, uploadTerminationDocument);

export default router;
