/**
 * 体检操作记录工具函数
 * 使用格式：yh_exam_actions_${today}_${examId}
 * 存储内容：{ idCardSignIn: boolean, consentSign: boolean, printSign: boolean, timestamp: string }
 */

/**
 * 获取今天的日期字符串（YYYY-MM-DD）
 */
export const getTodayString = (): string => {
  const today = new Date();
  const year = today.getFullYear();
  const month = String(today.getMonth() + 1).padStart(2, '0');
  const day = String(today.getDate()).padStart(2, '0');
  return `${year}-${month}-${day}`;
};

/**
 * 获取操作记录的存储 key
 */
export const getExamActionKey = (examId: string | number): string => {
  const today = getTodayString();
  return `yh_exam_actions_${today}_${examId}`;
};

/**
 * 操作记录类型
 */
export interface ExamActionRecord {
  /** 身份证拍照与签到 */
  idCardSignIn?: boolean;
  /** 体检知情同意书的签字 */
  consentSign?: boolean;
  /** 打印导检单是否签名 */
  printSign?: boolean;
  /** 记录时间戳 */
  timestamp?: string;
}
