Skip to content

Conversation

@jwilkinson87
Copy link
Contributor

This pull request introduces a significant refactor and enhancement to the data capture module, specifically separating the handling of form submissions and their versions. It introduces new routers and response models, updates tests to match the new structure, and adds comprehensive test data for both form submissions and submission versions. The changes improve clarity, maintainability, and test coverage for the form submission and versioning APIs.

API Refactor and Enhancements

  • Introduced a new FormSubmissionVersionsRouter class to manage creation and retrieval of form submission versions, separating this responsibility from the existing FormSubmissionsRouter. This includes methods for creating a version, fetching all versions for a submission, and retrieving a single version.
  • Updated FormSubmissionsRouter to remove version creation logic and focus solely on retrieving paginated lists of form submissions, now properly hydrating relationships such as contributors, creator, form, organisation, and versions.

Model and Data Structure Updates

  • Added a new FormSubmission response model with metadata and relationships to contributors, creator, form, organisation, and versions, supporting better hydration and type safety.

Testing Improvements

  • Added a comprehensive test suite for FormSubmissionVersionsRouter, covering creation, retrieval of all versions, and retrieval of a single version, using new test fixtures.
  • Updated FormSubmissionsRouterTest to reflect the new API structure, focusing on retrieval and hydration of submissions rather than creation. [1] [2]

Test Data and Fixtures

  • Added new and updated JSON test fixtures for form submissions and submission versions, ensuring accurate and realistic test coverage. [1] [2] [3] [4] [5]

These changes collectively improve the separation of concerns for form submissions and their versions, enhance the API's clarity, and provide a solid foundation for future features and maintenance.…pagination support

@github-actions
Copy link

github-actions bot commented Oct 9, 2025

There is a problem with the Gemini CLI PR review. Please check the action logs for details.

@jwilkinson87 jwilkinson87 merged commit 75184da into main Oct 10, 2025
2 of 3 checks passed
@jwilkinson87 jwilkinson87 deleted the feat/retrieve-submissions branch October 10, 2025 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants