feat(conflicts): GET /api/conflicts conflict-zone catalog + news/GDELT counts #33
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "osint-dashboard/t_e66223e3-osint-get-api-conflicts-catalog-news-cou"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
New
GET /api/conflictsendpoint (specdocs/osiris-ideas.md§8): a curated OSINT conflict-zone catalog merged with a live event-count roll-up.What
app/conflicts.py— static catalog of 13 theatres (Ukraine, Gaza, Sudan, Myanmar, DRC, Yemen, Syria, Lebanon, Sahel, Somalia, Red Sea, Taiwan Strait, Korean DMZ) withwar|high|elevatedseverity, short factual descriptions, and an internal per-zone bbox used only for counting.GET /api/conflicts→{ zones: [{id, label, severity, lat, lon, description, eventCount, lastUpdated}], timestamp }.eventCount= count of pre-existing geocoded rows inside each zone bbox —news_itemsmap pins (/api/news/map) + geocodedevents(source_typeinrss/gdel-t2). Empty tables →eventCount=0, never 502.overlay_catalog()gains aconflictsentry (kind=points,endpoint=/api/conflicts).Not done (out of scope)
Tests
tests/test_conflicts.py(no DB, no outbound HTTP): catalog length == 13, severity enum, unique ids / well-formed bboxes,overlay_catalog()["conflicts"]contract, purezone_event_statscounting + latest, and the API contract with mockedmain._fetch_geocoded_points(eventCount per zone, empty-DB zero counts).pytest tests/test_conflicts.py tests/test_api_live_layers.py— 18 passed.Curated static catalogue of 13 conflict theatres (Ukraine, Gaza, Sudan, Myanmar, DRC, Yemen, Syria, Lebanon, Sahel, Somalia, Red Sea, Taiwan Strait, Korean DMZ) with war|high|elevated severity and short factual descriptions. GET /api/conflicts returns { zones: [{id,label,severity, lat,lon,description,eventCount,lastUpdated}], timestamp } where eventCount rolls up pre-existing geocoded news/GDELT//api/news/map rows inside each zone bbox (0 when the tables are empty). Adds the conflicts entry to overlay_catalog(). No upstream scraping, no jittered coords.