2025-12-08 16:01:59 +09:00
|
|
|
/**
|
|
|
|
|
* 세금계산서 라우터
|
|
|
|
|
* /api/tax-invoice 경로 처리
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import { Router } from "express";
|
|
|
|
|
import { TaxInvoiceController } from "../controllers/taxInvoiceController";
|
|
|
|
|
import { authenticateToken } from "../middleware/authMiddleware";
|
|
|
|
|
|
|
|
|
|
const router = Router();
|
|
|
|
|
|
|
|
|
|
// 모든 라우트에 인증 미들웨어 적용
|
|
|
|
|
router.use(authenticateToken);
|
|
|
|
|
|
|
|
|
|
// 목록 조회
|
|
|
|
|
router.get("/", TaxInvoiceController.getList);
|
|
|
|
|
|
|
|
|
|
// 월별 통계 (상세 조회보다 먼저 정의해야 함)
|
|
|
|
|
router.get("/stats/monthly", TaxInvoiceController.getMonthlyStats);
|
|
|
|
|
|
2025-12-08 16:18:44 +09:00
|
|
|
// 비용 유형별 통계
|
|
|
|
|
router.get("/stats/cost-type", TaxInvoiceController.getCostTypeStats);
|
|
|
|
|
|
2025-12-08 16:01:59 +09:00
|
|
|
// 상세 조회
|
|
|
|
|
router.get("/:id", TaxInvoiceController.getById);
|
|
|
|
|
|
|
|
|
|
// 생성
|
|
|
|
|
router.post("/", TaxInvoiceController.create);
|
|
|
|
|
|
|
|
|
|
// 수정
|
|
|
|
|
router.put("/:id", TaxInvoiceController.update);
|
|
|
|
|
|
|
|
|
|
// 삭제
|
|
|
|
|
router.delete("/:id", TaxInvoiceController.delete);
|
|
|
|
|
|
|
|
|
|
// 발행
|
|
|
|
|
router.post("/:id/issue", TaxInvoiceController.issue);
|
|
|
|
|
|
|
|
|
|
// 취소
|
|
|
|
|
router.post("/:id/cancel", TaxInvoiceController.cancel);
|
|
|
|
|
|
|
|
|
|
export default router;
|
|
|
|
|
|