import { createCrudRoutes } from '@/server/utils/generic-crud.routes';
import { VodVideo } from '@/server/modules/vod/vod-video.entity';
import { VodVideoSchema, CreateVodVideoDto, UpdateVodVideoDto } from '@/server/modules/vod/vod-video.schema';
import { authMiddleware } from '@/server/middleware/auth.middleware';

const vodVideoRoutes = createCrudRoutes({
  entity: VodVideo,
  createSchema: CreateVodVideoDto,
  updateSchema: UpdateVodVideoDto,
  getSchema: VodVideoSchema,
  listSchema: VodVideoSchema,
  searchFields: ['title', 'description', 'fileId'],
  middleware: [authMiddleware],
  userTracking: {
    createdByField: 'createdBy',
    updatedByField: 'updatedBy'
  }
});

export default vodVideoRoutes;