---
id: JNY-PFM-QRY-002
title: Reuse a question for morning delivery
feature: FEAT-PFM-QRY-02
product_area: platform
module: queries
revision: 1
status: draft
product_intent: proposed
implementation_evidence: observed
supersedes:
  - RPT-ACC-0434
  - RPT-ACC-0093
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
actor: ACT-PFM-013
goal: 'Keep a parameterized contact question, request its output and arrange daily delivery.'
capabilities:
  - CAP-PFM-QRY-002
  - CAP-PFM-QRY-006
  - CAP-PFM-QRY-007
  - CAP-PFM-QRY-014
  - CAP-PFM-QRY-015
screens:
  - '/console/{tenantId}/queries/new'
  - '/console/{tenantId}/queries/{id}'
  - '/console/{tenantId}/queries/schedules/new'
  - '/console/{tenantId}/queries/schedules/{id}'
steps:
  - 'n': 1
    surface: '/console/{tenantId}/queries/new'
    action: Design a contact question with a date supplied when it runs.
    capability: CAP-PFM-QRY-002
    expected: Executing the question returns contacts that meet its date condition.
    provenance: inferred
    source: 'react-console:app/(console)/console/[tenantId]/queries/new/page.tsx'
    note: >-
      The cited evidence supports a service result or a related interaction. This screen sequence requires its
      own browser proof.
  - 'n': 2
    surface: '/console/{tenantId}/queries/{id}'
    action: Keep the question under a recognizable name.
    capability: CAP-PFM-QRY-006
    expected: Its saved definition retains the requested date value and starts private.
    provenance: inferred
    source: 'react-console:acceptance/reporting/playwright/journeys/schedules/RPT-ACC-0434.spec.ts#RPT-ACC-0434'
    note: >-
      The cited evidence supports a service result or a related interaction. This screen sequence requires its
      own browser proof.
  - 'n': 3
    surface: startQueryExport
    action: Request a CSV with technical field names.
    capability: CAP-PFM-QRY-014
    expected: The headings follow the selected output fields in their declared order.
    provenance: test
    source: >-
      services-platform:modules/queries/tests/integration/services/exports/run-query-export.integration.spec.js#heads
      the file with the technical names in the query’s output order
  - 'n': 4
    surface: '/console/{tenantId}/queries/schedules/new'
    action: >-
      Create a daily morning schedule with the execution day as the date value and skipping enabled for empty
      results.
    capability: CAP-PFM-QRY-015
    expected: 'The schedule retains the selected time zone, CSV options and recipient.'
    provenance: test
    source: 'react-console:acceptance/reporting/playwright/journeys/schedules/RPT-ACC-0434.spec.ts#RPT-ACC-0434'
  - 'n': 5
    surface: '/console/{tenantId}/queries/schedules/{id}'
    action: Request an immediate run while the question matches no contacts.
    capability: CAP-PFM-QRY-015
    expected: The history records an empty-result skip and contains no delivery.
    provenance: test
    source: 'react-console:acceptance/reporting/playwright/journeys/schedules/RPT-ACC-0434.spec.ts#RPT-ACC-0434'
  - 'n': 6
    surface: '/console/{tenantId}/queries/schedules/{id}'
    action: 'Add a matching contact, run again and open the delivered link.'
    capability: CAP-PFM-QRY-015
    expected: A single message provides a CSV containing the new contact.
    provenance: test
    source: 'react-console:acceptance/reporting/playwright/journeys/schedules/RPT-ACC-0434.spec.ts#RPT-ACC-0434'
  - 'n': 7
    surface: '/console/{tenantId}/queries'
    action: Attempt to remove the question while its schedule exists.
    capability: CAP-PFM-QRY-006
    expected: The refusal identifies the schedule that depends on the question.
    provenance: test
    source: 'react-console:acceptance/reporting/playwright/journeys/schedules/RPT-ACC-0434.spec.ts#RPT-ACC-0434'
alternates:
  - from_step: 4
    condition: The recipient list includes an external address.
    path: Apply the external-recipient permission check.
    outcome: A caller without that permission cannot retain the external recipient.
    provenance: test
    source: 'react-console:acceptance/reporting/playwright/journeys/schedules/RPT-ACC-0428.spec.ts#RPT-ACC-0428'
failures:
  - from_step: 7
    condition: The coordinator first removes the schedule.
    path: Remove the unused saved question after its dependencies are gone.
    outcome: The schedule and saved-query definitions no longer exist.
    provenance: test
    source: 'react-console:acceptance/reporting/playwright/journeys/schedules/RPT-ACC-0434.spec.ts#RPT-ACC-0434'
rules_in_play:
  - BR-CAP-PFM-QRY-007-03
  - BR-CAP-PFM-QRY-014-03
  - BR-CAP-PFM-QRY-015-09
  - BR-CAP-PFM-QRY-015-10
  - BR-CAP-PFM-QRY-006-14
assertions:
  - id: AS-JNY-PFM-QRY-002-01
    statement: >-
      The schedule supplies its execution day to the date parameter and skips delivery when the result is
      empty.
    provenance: test
    source: 'react-console:acceptance/reporting/playwright/journeys/schedules/RPT-ACC-0434.spec.ts#RPT-ACC-0434'
  - id: AS-JNY-PFM-QRY-002-02
    statement: A schedule dependency prevents deletion of its saved query.
    provenance: test
    source: 'react-console:acceptance/reporting/playwright/journeys/schedules/RPT-ACC-0434.spec.ts#RPT-ACC-0434'
e2e_policy: required
e2e_reason: >-
  Browser coverage connects the query’s Schedule action, parameter display, run history and delivered file;
  backend coverage supplies the export-format checks.
evidence:
  - 'Pinned reference: react-console:acceptance/reporting/playwright/journeys/schedules/RPT-ACC-0428.spec.ts'
  - 'Pinned reference: react-console:acceptance/reporting/playwright/journeys/schedules/RPT-ACC-0434.spec.ts'
  - 'Pinned reference: react-console:app/(console)/console/[tenantId]/queries/new/page.tsx'
  - >-
    Pinned reference:
    services-platform:modules/queries/tests/integration/services/exports/run-query-export.integration.spec.js
proved_by: []
---

# Reuse a question for morning delivery

## Story

A coordinator keeps a contact question that asks for a date and uses its output for morning delivery. The schedule supplies the execution day automatically. An immediate empty run records a skip; after a new contact appears, another run sends a downloadable file. Removing the source question requires clearing the schedule dependency first.
