Keysproperty operations Corbelstone Residential

#320 · Water alarm, no ticket · Wren Yard

done Sat 21:25 · alarm 1961

Ledger row
policy v2
The call
POST /tickets source=alarm alarm=1961
Action, tier
open_ticket_from_alarm, tier 0
Decided by
rules: Leak alarm live 13 minutes with no ticket; open an emergency ticket now.
Controller
Allowed: open_ticket_from_alarm is tier 0 (just do it); within budget (0 of 6 actions at building 99 this hour).
authority
conditions
cooldown
budget
Definition
water_alarm_no_ticket v1
At stake
water running 13 min with nobody sent
Outcome
Emergency ticket 5660 opened from alarm 1961, vendor 34 dispatched.
Undo
Close the ticket as raised in error and cancel the dispatch.

Undo

Restores the before-snapshot below and writes a new row.

Evidence

{
  "alarm_id": 1961,
  "amount_at_risk": null,
  "asset_id": 2655,
  "building": "Wren Yard",
  "building_id": 99,
  "currency": null,
  "kind": "water_leak",
  "minutes_active": 13,
  "raised_at": "2026-10-31 21:12:49.380855",
  "sensor": "Home 0014",
  "stake_note": "water running 13 min with nobody sent",
  "started_at": "2026-10-31T21:22:49.380855",
  "unit_id": 6493
}

Before and after

{
  "after": {
    "ticket_events": [
      {
        "id": 27060,
        "ticket_id": 5660,
        "type": "created"
      },
      {
        "id": 27061,
        "ticket_id": 5660,
        "type": "vendor_dispatched"
      }
    ],
    "tickets": [
      {
        "alarm_id": 1961,
        "assigned_at": "2026-10-31T21:25:00",
        "attended_at": "2026-10-31T23:55:43.777442",
        "building_id": 99,
        "category": "leak",
        "closed_at": "2026-11-01T03:35:45.529224",
        "completed_at": "2026-11-01T02:35:45.529224",
        "due_at": "2026-11-01T01:25:00",
        "duplicate_of": null,
        "id": 5660,
        "opened_at": "2026-10-31T21:25:00",
        "priority": "emergency",
        "reported_by": "keys operator",
        "source": "alarm",
        "status": "assigned",
        "summary": "Water alarm: leak detected",
        "trade": "plumbing",
        "unit_id": 6493,
        "vendor_id": 34
      },
      {
        "closed_at": "2026-10-31T23:47:41.883377",
        "duplicate_of": 5660,
        "id": 5511,
        "status": "merged"
      }
    ]
  },
  "before": {
    "tickets": [
      {
        "closed_at": "2026-11-02T16:22:22.797520",
        "duplicate_of": null,
        "id": 5511,
        "status": "closed"
      }
    ]
  },
  "endpoint": "POST /tickets source=alarm alarm=1961",
  "note": "Emergency ticket 5660 opened from alarm 1961, vendor 34 dispatched.",
  "ok": true,
  "rollback_fn_name": "undo_open_ticket_from_alarm"
}

Arguments

{
  "alarm_id": 1961
}