Fix domain reports and sources API 500 errors

- Use begin_timestamp/end_timestamp (Unix ints) instead of begin_date/end_date
  (ISO strings) when building ReportEntry, fixing Pydantic int_parsing errors
- Extract policy string from dict (policy["p"]) when the stored value is a dict,
  fixing Pydantic string_type validation error
- Rename _days -> days in ReportStore.get_domain_sources() so the endpoint's
  `days=days` keyword call no longer raises TypeError

Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/15ac3521-e81f-42fa-81a2-f6804a423e1d

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-29 20:03:43 +00:00
parent 8e051ac74d
commit 11daa15335
2 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -177,7 +177,7 @@ class ReportStore:
return sorted_reports[:limit]
return sorted_reports
def get_domain_sources(self, domain: str, _days: int = 30) -> List[Dict[str, Any]]:
def get_domain_sources(self, domain: str, days: int = 30) -> List[Dict[str, Any]]:
"""
Get sending sources for a domain