( perspectiveId: string, resolvedBy: string, notes: string )
| 131 | * ones are left alone since a human may be actively working them. |
| 132 | */ |
| 133 | export async function resolveEscalationsForPerspective( |
| 134 | perspectiveId: string, |
| 135 | resolvedBy: string, |
| 136 | notes: string |
| 137 | ): Promise<number[]> { |
| 138 | const result = await query<{ id: number }>( |
| 139 | `UPDATE addie_escalations |
| 140 | SET status = 'resolved', |
| 141 | resolved_by = $2, |
| 142 | resolved_at = NOW(), |
| 143 | resolution_notes = $3, |
| 144 | updated_at = NOW() |
| 145 | WHERE perspective_id = $1 AND status = 'open' |
| 146 | RETURNING id`, |
| 147 | [perspectiveId, resolvedBy, notes] |
| 148 | ); |
| 149 | return result.rows.map(r => r.id); |
| 150 | } |
| 151 | |
| 152 | /** |
| 153 | * Get a single escalation by ID |
no outgoing calls
no test coverage detected