/**
 * 推广活动路由
 * @module routes/promotion
 */

const express = require('express');
const router = express.Router();

const activityController = require('../controllers/promotion/activityController');
const rewardController = require('../controllers/promotion/rewardController');

/**
 * @route GET /api/v1/promotion/activities
 * @description 获取推广活动列表
 * @access Public
 */
router.get('/activities', activityController.getActivities);

/**
 * @route GET /api/v1/promotion/activities/:id
 * @description 获取推广活动详情
 * @access Public
 */
router.get('/activities/:id', activityController.getActivity);

/**
 * @route POST /api/v1/promotion/activities
 * @description 创建推广活动
 * @access Private
 */
router.post('/activities', activityController.createActivity);

/**
 * @route PUT /api/v1/promotion/activities/:id
 * @description 更新推广活动
 * @access Private
 */
router.put('/activities/:id', activityController.updateActivity);

/**
 * @route DELETE /api/v1/promotion/activities/:id
 * @description 删除推广活动
 * @access Private
 */
router.delete('/activities/:id', activityController.deleteActivity);

/**
 * @route GET /api/v1/promotion/rewards
 * @description 获取奖励记录列表
 * @access Private
 */
router.get('/rewards', rewardController.getRewards);

/**
 * @route POST /api/v1/promotion/rewards/:id/issue
 * @description 发放奖励
 * @access Private
 */
router.post('/rewards/:id/issue', rewardController.issueReward);

module.exports = router;