Skip to content

Add the Database Reco Counts CSV report endpoint #3343

Description

@adamtheturtle

The Cloud Targets Web API documents POST /imagetargets/databases/{database_id}/reports/recoCounts, which the mock does not route at all. It is the only documented Cloud Targets endpoint with no mock implementation.

The documented behaviour is:

  • The request body is JSON with a month field in YYYY-mm form. Only the current and previous month can be requested.
  • The response is {"result_code": "Success", "transaction_id": ..., "presigned_url": ...}.
  • The presigned URL returns 404 until the report is ready, and then 200 with the CSV content.
  • The CSV has one row per target with at least one reco in the month, with target_id and reco_count columns.

The mock does not count recos (see docs/source/differences-to-vws.rst), so a mock report will necessarily be empty or synthetic.

Acceptance criteria

  • The VWS mock routes POST /imagetargets/databases/{database_id}/reports/recoCounts on both the in-process and Flask backends.
  • A presigned-URL-like download route serves the generated CSV, including the documented 404-until-ready behaviour.
  • Verified fake tests cover a valid request, an out-of-range month, and a malformed month.
  • Any remaining differences, in particular the empty reco counts, are documented in docs/source/differences-to-vws.rst.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions