import { Router } from 'express';
import multer from 'multer';
import { requireAuth } from '../middleware/auth';
import { uploadTemplate, getTemplateDownloadUrl, deleteTemplate } from '../controllers/template.controller';

const router = Router();
const upload = multer({ storage: multer.memoryStorage() });

router.post('/upload', upload.single('file'), requireAuth, uploadTemplate);
router.get('/:templateId/download-url', requireAuth, getTemplateDownloadUrl);
router.delete('/:templateId', requireAuth, deleteTemplate);

export default router;
