Skip to content

pydantic schemas for visit_history and cunsultation using camp_visit_id

Title: fix(api): revoke admin privilege in visit-history and add valid pydantic schemas

Description

This merge request updates the backend API authorization logic and introduces structured Pydantic response schemas for history-related endpoints.

Changes included:

  • Updated role-based access control for
    GET /api/v1/users/{user_id}/visit-history

    • Ensures proper permission validation
    • enables authorized access to other users' visit history
  • Added valid Pydantic response schemas for:

    • GET /api/v1/users/{user_id}/visit-history
    • GET /api/v1/consultations/camp-visit/{camp_visit_id}/consultation-history
  • Updated route imports and response models to use the new schemas.

  • Ensured consistent API response typing and serialization.

  • Improved Swagger/OpenAPI documentation visibility for these endpoints.

Checklist

  • Code follows project API guidelines.
  • Performance considerations have been addressed.

Related Issue(s)

Closes #32 (closed)

Merge request reports

Loading