mirror of
https://github.com/zvx-echo6/central.git
synced 2026-05-21 18:14:44 +02:00
feat(models): add quake event subject routing
Update subject_for_event to handle quake.* category events. Subject format: central.quake.event.<magnitude_tier> Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
aacf06499b
commit
668027b442
1 changed files with 87 additions and 79 deletions
|
|
@ -38,6 +38,7 @@ def subject_for_event(ev: Event) -> str:
|
|||
|
||||
Dispatch by category prefix:
|
||||
- fire.*: returns central.<category> directly
|
||||
- quake.*: returns central.<category> directly
|
||||
- wx.*: uses weather alert subject logic
|
||||
|
||||
Weather alert subjects:
|
||||
|
|
@ -48,11 +49,18 @@ def subject_for_event(ev: Event) -> str:
|
|||
|
||||
Fire hotspot subjects:
|
||||
central.fire.hotspot.<satellite>.<confidence>
|
||||
|
||||
Quake event subjects:
|
||||
central.quake.event.<magnitude_tier>
|
||||
"""
|
||||
# Fire events: subject is just central.<category>
|
||||
if ev.category.startswith("fire."):
|
||||
return f"central.{ev.category}"
|
||||
|
||||
# Quake events: subject is just central.<category>
|
||||
if ev.category.startswith("quake."):
|
||||
return f"central.{ev.category}"
|
||||
|
||||
# Weather events: use geo-based subject logic
|
||||
prefix = "central.wx"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue