Skip to content

Local export history#1664

Open
Ezequiel-Valencia wants to merge 63 commits intomasterfrom
local-export-history
Open

Local export history#1664
Ezequiel-Valencia wants to merge 63 commits intomasterfrom
local-export-history

Conversation

@Ezequiel-Valencia
Copy link
Copy Markdown
Contributor

@Ezequiel-Valencia Ezequiel-Valencia commented Apr 17, 2026

Summary

This PR implements a complete Export History feature that persists and exposes a paginated record of each user's simulation export
operations. When a user exports simulation data, the export details are saved to a new database table. Users can then query their export
history through a new REST endpoint.

What was changed

  • Database layer — New vc_simulation_export_history table (PostgreSQL) stores export metadata: job ID,
    simulation/biomodel/mathmodel/math key references, export format, timestamp, output URI, exported variables, time range, and event
    status. Implements insert, paginated query (100 records per page, ordered by date DESC), and delete-by-URI operations.

  • ExportSpecs enrichment — Added bioModelKey, mathModelKey, and mathDescriptionKey fields so that export requests carry the
    model references needed to populate the history table.

  • REST endpoint — New GET /api/v1/export/history?pageNumber=N endpoint (requires user role) returns a paginated list of
    ExportHistory records for the authenticated user.

  • OpenAPI spec & generated clients — Updated openapi.yaml with the new endpoint and ExportHistory, ExportFormat, and
    DifferentParameterValues schemas. Regenerated Java (vcell-restclient), Python (python-restclient), and TypeScript/Angular
    (webapp-ng) clients.

  • Tests — DB-level tests verify insert, delete, and multi-record retrieval with model-name joins. Client integration tests cover
    end-to-end export → history flow, ordering (most-recent-first), and pagination boundaries.

Test plan

  • ExportHistoryDBTest — unit tests for DB CRUD operations pass against a real test database
  • ExportHistoryClientTest — integration tests verify the REST endpoint returns correct history, ordering, and page boundaries
  • ExportRequestTest / ExportServerTest — existing export tests still pass with updated ExportSpecs constructor
  • Manual smoke test: perform an export via the UI, then call GET /api/v1/export/history and confirm the record appears with correct
    metadata

Notes

  • The DELETE endpoint (DELETE /api/v1/export/history) exists in ExportResource.java but is currently marked hidden in the OpenAPI spec —
    it is not included in the PR description.
  • Page size is fixed at 100; pageNumber is 0-indexed and validated to be in [0, 9999].

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.

Export History Should Be Saved on the Server instead of Locally

2 participants