export enum TransferOrderStatus {
  PENDING = 'PENDING',                           // 待卖方确认
  SELLER_CONFIRMED = 'SELLER_CONFIRMED',         // 卖方已确认
  PAYMENT_FROZEN = 'PAYMENT_FROZEN',             // 买方资金已冻结
  TREES_LOCKED = 'TREES_LOCKED',                 // 卖方树已锁定
  OWNERSHIP_TRANSFERRED = 'OWNERSHIP_TRANSFERRED', // 所有权已变更
  CONTRIBUTION_ADJUSTED = 'CONTRIBUTION_ADJUSTED', // 算力已调整
  STATS_UPDATED = 'STATS_UPDATED',               // 团队统计已更新
  PAYMENT_SETTLED = 'PAYMENT_SETTLED',           // 资金已结算
  COMPLETED = 'COMPLETED',                       // 转让完成

  CANCELLED = 'CANCELLED',                       // 已取消
  FAILED = 'FAILED',                             // 失败
  ROLLING_BACK = 'ROLLING_BACK',                 // 补偿中
  ROLLED_BACK = 'ROLLED_BACK',                   // 已回滚
}

/**
 * 可取消的状态（PENDING 和 SELLER_CONFIRMED 阶段可取消）
 */
export const CANCELLABLE_STATUSES = [
  TransferOrderStatus.PENDING,
  TransferOrderStatus.SELLER_CONFIRMED,
] as const;

/**
 * 终态（不可再变更）
 */
export const TERMINAL_STATUSES = [
  TransferOrderStatus.COMPLETED,
  TransferOrderStatus.CANCELLED,
  TransferOrderStatus.ROLLED_BACK,
] as const;
