/**
 * 合同签署状态枚举
 */
export enum ContractSigningStatus {
  /** 待签署 */
  PENDING = 'PENDING',

  /** 已滚动到底部 */
  SCROLLED = 'SCROLLED',

  /** 已确认法律效力 */
  ACKNOWLEDGED = 'ACKNOWLEDGED',

  /** 已签署完成 */
  SIGNED = 'SIGNED',

  /** 超时未签署 */
  UNSIGNED_TIMEOUT = 'UNSIGNED_TIMEOUT',
}

/**
 * 判断是否需要用户签署
 */
export function needsUserSigning(status: ContractSigningStatus): boolean {
  return (
    status === ContractSigningStatus.PENDING ||
    status === ContractSigningStatus.SCROLLED ||
    status === ContractSigningStatus.ACKNOWLEDGED ||
    status === ContractSigningStatus.UNSIGNED_TIMEOUT
  );
}

/**
 * 判断是否已完成签署
 */
export function isSigningCompleted(status: ContractSigningStatus): boolean {
  return status === ContractSigningStatus.SIGNED;
}
