What to build / Ne yapılacak
EN: tests/unit/test_analytics_service.py covers the empty-DB shape, basic log_request increment, and simple top_pages sorting — but not the today_visitors vs total_visitors distinction in get_stats() (app/services/analytics_service.py) when requests span multiple days, nor a tie-breaker case in top_pages ordering when two paths have equal counts.
TR: tests/unit/test_analytics_service.py boş veritabanı durumunu, temel log_request artışını ve basit top_pages sıralamasını test ediyor — ama get_stats() fonksiyonundaki (app/services/analytics_service.py) today_visitors ile total_visitors ayrımını (istekler birden fazla güne yayıldığında) ve top_pages sıralamasında eşit sayıda isteğe sahip iki path arasındaki tie-breaker davranışını test etmiyor.
Files
tests/unit/test_analytics_service.py (add tests here)
app/services/analytics_service.py (read-only reference for behavior)
Acceptance criteria
Blocked by
None — can start immediately.
What to build / Ne yapılacak
EN:
tests/unit/test_analytics_service.pycovers the empty-DB shape, basiclog_requestincrement, and simpletop_pagessorting — but not thetoday_visitorsvstotal_visitorsdistinction inget_stats()(app/services/analytics_service.py) when requests span multiple days, nor a tie-breaker case intop_pagesordering when two paths have equal counts.TR:
tests/unit/test_analytics_service.pyboş veritabanı durumunu, temellog_requestartışını ve basittop_pagessıralamasını test ediyor — amaget_stats()fonksiyonundaki (app/services/analytics_service.py)today_visitorsiletotal_visitorsayrımını (istekler birden fazla güne yayıldığında) vetop_pagessıralamasında eşit sayıda isteğe sahip iki path arasındaki tie-breaker davranışını test etmiyor.Files
tests/unit/test_analytics_service.py(add tests here)app/services/analytics_service.py(read-only reference for behavior)Acceptance criteria
today_visitorsonly counts the current day whiletotal_visitorscounts all of them (use the existingtest_dbfixture; insertTrafficLogrows directly with an explicittimestampiflog_requestdoesn't accept one)top_pagesordering when two or more paths have identical request counts — assert the result is stable/deterministic (document the actual tie-break behavior, don't assume one)pytest tests/unit/test_analytics_service.py -vBlocked by
None — can start immediately.