---
id: TST-PFM-QRY-349
title: Platform query schedule routes
kind: integration
product_area: platform
module: queries
revision: 1
status: draft
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
  rhythm-v2-docs: 99376625d3e7ac26936413cfc31a88fba6562464
repository: services-platform
files:
  - modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js
implements:
  - ATS-PFM-QRY-006-14
  - ATS-PFM-QRY-015-01
  - ATS-PFM-QRY-015-02
  - ATS-PFM-QRY-015-03
  - ATS-PFM-QRY-015-05
  - ATS-PFM-QRY-015-06
  - ATS-PFM-QRY-015-07
  - ATS-PFM-QRY-015-10
  - ATS-PFM-QRY-015-14
  - ATS-PFM-QRY-015-15
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 5
isolation: 'The suite’s database fixtures, controlled execution contexts and file-owned external dependency seams.'
evidence:
  - >-
    services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js
assertion_bindings:
  - scenario: ATS-PFM-QRY-006-14
    source:
      - >-
        services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js#refuses
        to delete a saved query that schedules run (409), naming them
    scope: contributing assertions; the scenario combines multiple files
    provenance: test
  - scenario: ATS-PFM-QRY-015-01
    source:
      - >-
        services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js#answers
        the owner and a manager
      - >-
        services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js#answers
        a colleague holding only .use 404, as for one that does not exist
      - >-
        services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js#lists
        it for its owner and a manager, not for a colleague
      - >-
        services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js#narrows
        a manager’s list to their own with mine=1
      - >-
        services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js#refuses
        a caller with neither schedules key (403)
    scope: contributing assertions; the scenario combines multiple files
    provenance: test
  - scenario: ATS-PFM-QRY-015-02
    source:
      - >-
        services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js#refuses
        a query whose required value is missing (400, naming it)
      - >-
        services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js#refuses
        a template that has never been published (400)
      - >-
        services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js#refuses
        a schedule more often than hourly (400)
      - >-
        services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js#refuses
        a definition written in camelCase (400), and writes nothing
      - >-
        services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js#refuses
        a caller who may not read the dataset (403)
    scope: assertions cited by the scenario
    provenance: test
  - scenario: ATS-PFM-QRY-015-03
    source:
      - >-
        services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js#flags
        the saved query as changed since the schedule was set up
      - >-
        services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js#summarises
        the pinned and the latest definitions side by side
      - >-
        services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js#re-pins
        to the latest definition and clears the flag
    scope: assertions cited by the scenario
    provenance: test
  - scenario: ATS-PFM-QRY-015-05
    source:
      - >-
        services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js#refuses
        take-ownership to a holder of .use alone (403)
      - >-
        services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js#makes
        a manager the owner
    scope: contributing assertions; the scenario combines multiple files
    provenance: test
  - scenario: ATS-PFM-QRY-015-06
    source:
      - >-
        services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js#answers
        the run queued, run now by the caller rather than the owner
      - >-
        services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js#is
        run by the consumer, as the caller, to the schedule’s recipients
      - >-
        services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js#shows
        the run in the history: run-now, who ran it, the file and each delivery
    scope: contributing assertions; the scenario combines multiple files
    provenance: test
  - scenario: ATS-PFM-QRY-015-07
    source:
      - >-
        services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js#refuses
        an outside address without platform.query-schedules.external-recipients (403), and writes nothing
      - >-
        services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js#accepts
        the address of one of the organization’s own users without it
    scope: contributing assertions; the scenario combines multiple files
    provenance: test
  - scenario: ATS-PFM-QRY-015-10
    source:
      - >-
        services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js#accepts
        a date parameter as today, the relative day each run reads as its own date
    scope: contributing assertions; the scenario combines multiple files
    provenance: test
  - scenario: ATS-PFM-QRY-015-14
    source:
      - >-
        services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js#arrives
        paused and flagged imported, owned by the person named
      - >-
        services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js#refuses
        a resume without confirmLegacyDisabled (400), saying why
      - >-
        services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js#resumes
        with it
    scope: assertions cited by the scenario
    provenance: test
  - scenario: ATS-PFM-QRY-015-15
    source:
      - >-
        services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js#refuses
        a replacement at a stale version (409)
      - >-
        services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js#duplicates
        it paused, named a copy, owned by the caller
      - >-
        services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js#deletes
        the schedule, which is then not found
    scope: contributing assertions; the scenario combines multiple files
    provenance: test
fixture_seams:
  - >-
    services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js:130
  - >-
    services-platform:modules/queries/tests/integration/services/schedules/query-schedule-routes.integration.spec.js:102
---

# Platform query schedule routes

## Verification Boundary

The file invokes its service or persistence boundary against local integration fixtures.

## What This Suite Proves

Its assertions check query schedule routes. The assertion bindings identify the corresponding acceptance examples and retain their original test-title citations.

## What It Does Not Prove

Local execution does not establish deployed queue scheduling, every external provider response or a passing result at the pinned revision.

## Real Dependencies and Test Doubles

The integration fixture and any imported dependency seams define the environment. Database-oriented checks use PostgreSQL; file-owned transport, clock, provider or worker seams isolate the explicitly controlled boundary.

## Must Not Be Doubled

Keep the service or persistence operation whose behavior is asserted real. Database constraints and transactions cannot be replaced by fixture answers when they are the subject of the check.
