Skip to content

refactor(history): consolidate /diff and /version-summary into /history endpoint

Summary

  • Removed GET /history/record/{id}/diff — absorbed into enhanced /history
  • Removed GET /history/record/{id}/version-summary — absorbed into enhanced /history
  • Enhanced GET /history/record/{id}/history with 3 new optional query params:
    • from_version + to_version — when both provided, includes diff between those versions in response
    • include_summary — when true, includes version summary counters in response
  • Added RecordHistoryResponse schema with history, diff, and summary fields for a unified response structure
  • Service methods and schemas kept unchanged — only the endpoint layer changed

Test plan

  • GET /history/record/{id}/history{ "history": [...], "diff": null, "summary": null }
  • GET /history/record/{id}/history?include_summary=truesummary populated with version counters
  • GET /history/record/{id}/diff404 Not Found
  • GET /history/record/{id}/version-summary404 Not Found

Checklist

  • Code follows project API guidelines
  • Documentation is updated (OpenAPI docs reflect removed endpoints and new params)
  • Code adheres to project coding standards

Closes #122

Merge request reports

Loading