import express from "express";
import {
  getDataflowDiagrams,
  getDataflowDiagramById,
  createDataflowDiagram,
  updateDataflowDiagram,
  deleteDataflowDiagram,
  copyDataflowDiagram,
} from "../controllers/dataflowDiagramController";

const router = express.Router();

/**
 * @route GET /api/dataflow-diagrams
 * @desc 관계도 목록 조회 (페이지네이션)
 */
router.get("/", getDataflowDiagrams);

/**
 * @route GET /api/dataflow-diagrams/:diagramId
 * @desc 특정 관계도 조회
 */
router.get("/:diagramId", getDataflowDiagramById);

/**
 * @route POST /api/dataflow-diagrams
 * @desc 새로운 관계도 생성
 */
router.post("/", createDataflowDiagram);

/**
 * @route PUT /api/dataflow-diagrams/:diagramId
 * @desc 관계도 수정
 */
router.put("/:diagramId", updateDataflowDiagram);

/**
 * @route DELETE /api/dataflow-diagrams/:diagramId
 * @desc 관계도 삭제
 */
router.delete("/:diagramId", deleteDataflowDiagram);

/**
 * @route POST /api/dataflow-diagrams/:diagramId/copy
 * @desc 관계도 복제
 */
router.post("/:diagramId/copy", copyDataflowDiagram);

export default router;
