export interface OpsAction {
  code: string
  label: string
  target: 'car' | 'task' | 'note'
  needConfirm: boolean
  description: string
}

export const OPS_WHITELIST: OpsAction[] = [
  { code: 'ops.car.pause', label: '暂停车辆', target: 'car', needConfirm: false, description: '将单车暂停' },
  { code: 'ops.car.resume', label: '恢复车辆', target: 'car', needConfirm: false, description: '将单车恢复运行' },
  { code: 'ops.car.gohome', label: '回原点', target: 'car', needConfirm: true, description: '指派车辆回原点' },
  { code: 'ops.car.resetSession', label: '重置车辆会话', target: 'car', needConfirm: true, description: '重置车辆通信会话' },
  { code: 'ops.car.manualCharge', label: '手动充电', target: 'car', needConfirm: false, description: '触发手动充电' },
  { code: 'ops.task.pause', label: '暂停任务', target: 'task', needConfirm: false, description: '暂停指定任务' },
  { code: 'ops.task.cancel', label: '取消任务', target: 'task', needConfirm: true, description: '取消指定任务' },
  { code: 'ops.task.reassign', label: '重派任务', target: 'task', needConfirm: true, description: '重新分配任务给其他车辆' },
  { code: 'ops.task.boostPriority', label: '提升优先级', target: 'task', needConfirm: false, description: '提升任务优先级' },
  { code: 'monitor.note.write', label: '写运营备注', target: 'note', needConfirm: false, description: '写入运营备注（标注层）' }
]

export interface OpsAuditEntry {
  id: string
  ts: string
  user: string
  scope: string
  opCode: string
  target: string
  result: 'ok' | 'err'
  message?: string
}
