import { z } from 'zod';

import { idStringSchema } from './common.js';

/**
 * 录制启动请求 schema
 *
 * 字段约束：
 *   - routerId: 必传；media-server 通过它定位 mediasoup Router
 *   - roomCode: 必传；用于日志聚合 / Go 侧关联
 *   - producerIds: 至少 1 个；Phase B1 通常是 host 的 audio + video 两个；
 *     Phase B3 扩展为屏幕共享 + 多人音频时，最大值由 RECORDING_MAX_TRACKS 限制
 */
export const startRecordingBodySchema = z.object({
  routerId: idStringSchema,
  roomCode: z.string().min(1).max(64),
  producerIds: z.array(idStringSchema).min(1).max(8),
});

export const recordingIdParamSchema = z.object({
  id: idStringSchema,
});

export type StartRecordingBody = z.infer<typeof startRecordingBodySchema>;
export type RecordingIdParam = z.infer<typeof recordingIdParamSchema>;
