// Delete the mitra_online_status row for a specific mitra. Used by the // "freshly created user, no online record" scenario (ts-mitra-1-01a) to // simulate the natural pre-app-launch state. // // After this script runs, the next /api/mitra/status call from the app // will hit ensureStatusRow() in mitra-status.service.js, which INSERTs a // fresh row with the DB default is_online=false. So home will render // BestieHomeOffline. // // Required env: MITRA_ID // Optional env: BACKEND_INTERNAL_URL (defaults to localhost:3001) const url = (BACKEND_INTERNAL_URL || 'http://localhost:3001') + '/internal/_test/delete-mitra-status-row' const resp = http.post(url, { headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ mitra_id: MITRA_ID }), }) if (resp.status !== 200) { throw new Error(`delete-mitra-status-row failed (${resp.status}): ${resp.body}`) } const data = json(resp.body) console.log('delete_mitra_status_row:', JSON.stringify(data))