import { createCrudRoutes } from '../../../utils/generic-crud.routes';
import { authMiddleware } from '../../../middleware/auth.middleware';
import { ActivityEntity } from '../../../modules/activities/activity.entity';
import { createActivitySchema, updateActivitySchema, getActivitySchema, activityListResponseSchema } from '../../../modules/activities/activity.schema';

// 创建活动管理API路由
export const activitiesRoutes = createCrudRoutes({
  entity: ActivityEntity,
  createSchema: createActivitySchema,
  updateSchema: updateActivitySchema,
  getSchema: getActivitySchema,
  listSchema: activityListResponseSchema,
  searchFields: ['name', 'description'],
  relations: ['routes', 'venueLocation'],
  middleware: [authMiddleware],
  userTracking: {
    createdByField: 'createdBy',
    updatedByField: 'updatedBy'
  }
});