// ============================================================================== // API de Hardware y Apertura Manual // ============================================================================== import { request } from './client'; export interface HardwareCommandResponse { status: string; modulo_id: number; address: number; payload: string; message: string; latencia_ms: number; } export const hardwareApi = { manualOpen: (moduloId: number, motivo: string = 'APERTURA_MANUAL_GUARDIA', ticketId: number = 0) => { return request(`/hardware/modules/${moduloId}/open`, { method: 'POST', body: JSON.stringify({ modulo_id: moduloId, motivo, ticket_id: ticketId }), }); }, manualClose: (moduloId: number, motivo: string = 'CIERRE_FORZADO_GUARDIA', ticketId: number = 0) => { return request(`/hardware/modules/${moduloId}/close`, { method: 'POST', body: JSON.stringify({ modulo_id: moduloId, motivo, ticket_id: ticketId }), }); }, };