Add athlete audit logging API and per-athlete history retrieval#9
Draft
Copilot wants to merge 3 commits into
Draft
Add athlete audit logging API and per-athlete history retrieval#9Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
Agent-Logs-Url: https://github.com/Hackaton-NeuroAgents/olympicmind/sessions/1f85b57c-b83d-4fee-a43d-631a59f64246 Co-authored-by: unoursmarin <20300991+unoursmarin@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Hackaton-NeuroAgents/olympicmind/sessions/1f85b57c-b83d-4fee-a43d-631a59f64246 Co-authored-by: unoursmarin <20300991+unoursmarin@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add REST API endpoints for athlete logging and retrieval
Add athlete audit logging API and per-athlete history retrieval
May 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds backend support for daily athlete audit metrics ingestion and historical retrieval, including strict input validation and expected API error semantics (400 for invalid input, 404 for missing athlete).
API surface
POST /api/v1/auditto persist a daily audit entry.GET /api/v1/athletes/{athlete_id}/historyto fetch all audit logs for one athlete, sorted newest-first.Domain logic and persistence
athlete_profiles.pywith audit-log storage (backend/data/audit_logs.json), load/save helpers, and service functions:add_audit_log(...)get_athlete_audit_history(...)athlete_idrequired and must existdaterequired inYYYY-MM-DDscoresrequired, non-empty object[1, 10]notesmust be a string when providedError handling contract
400 Bad Requestwith clear validation details.404 Not Foundon both write and history retrieval paths.Documentation
README.mdwith the two new/api/v1/...routes.Focused tests
backend/tests/test_audit_api.pycovering:400)404)404)