---
id: ATS-PFM-INT-022
scope: CAP-PFM-INT-022
product_area: platform
module: integrations
revision: 3
status: proposed
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
  macroservice-libraries: 54536a441935c6e09fdb7f96f0bec71c52ba4e03
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
scenarios:
  - id: ATS-PFM-INT-022-01
    title: Calendar validation preserves the single-default choice
    level: api
    proves:
      - BR-CAP-PFM-INT-022-01
    preconditions: A workspace already has a default.
    steps: >-
      Create invalid zones, empty weekdays, reversed hours and four hundred and one holidays, then a
      valid new default.
    expected: Invalid calendars refuse; the accepted default clears the previous flag.
    negative: true
    data_needs: 'Fixtures establishing the stated accounts, declarations and history in an isolated workspace.'
    bound_to:
      - TST-PFM-INT-596
      - TST-PFM-INT-588
    provenance: test
    source: >-
      services-platform:modules/workflow-actions/tests/integration/services/persistence/business-calendars.integration.spec.js#refuses
      more than 400 holidays
    category: validation
    binding_evidence:
      - >-
        services-platform:modules/workflow-actions/tests/integration/services/persistence/business-calendars.integration.spec.js#refuses
        more than 400 holidays
      - >-
        services-platform:modules/workflow-actions/tests/integration/services/persistence/business-calendars.integration.spec.js#refuses
        a time zone that is not an IANA name
      - >-
        services-platform:modules/workflow-actions/tests/integration/services/persistence/business-calendars.integration.spec.js#refuses
        no working day
      - >-
        services-platform:modules/workflow-actions/tests/integration/services/persistence/business-calendars.integration.spec.js#refuses
        working hours that end before they start
      - >-
        services-platform:modules/workflow-actions/tests/integration/services/persistence/business-calendars.integration.spec.js#accepts
        exactly 400 holidays (the cap’s negative control)
      - >-
        services-platform:modules/workflow-actions/tests/integration/services/persistence/business-calendars.integration.spec.js#clears
        the first’s default in the same write, moving its version
      - >-
        services-platform:modules/workflow-actions/tests/integration/db/workflow-actions-tables.integration.spec.js#refuses
        a second default of one tenant
    binding_scope: >-
      contributions: the cited tests support their own asserted outcomes. Additional setup, branches
      and combined sequences remain proposed unless the cited assertions exercise them.
  - id: ATS-PFM-INT-022-02
    title: Provisioning seeds the working week once
    level: api
    proves:
      - BR-CAP-PFM-INT-022-02
    preconditions: A workspace has not yet received defaults.
    steps: 'Provision, remove Standard week and provision again.'
    expected: The initial seed is default and its later user deletion does not cause recreation.
    negative: false
    data_needs: 'Fixtures establishing the stated accounts, declarations and history in an isolated workspace.'
    bound_to:
      - TST-PFM-INT-590
    provenance: test
    source: >-
      services-platform:modules/workflow-actions/tests/integration/services/maintenance/tenant-participant.integration.spec.js#gives
      the tenant Standard week in its own zone, as its default
    category: transition
    binding_evidence:
      - >-
        services-platform:modules/workflow-actions/tests/integration/services/maintenance/tenant-participant.integration.spec.js#gives
        the tenant Standard week in its own zone, as its default
      - >-
        services-platform:modules/workflow-actions/tests/integration/services/maintenance/tenant-participant.integration.spec.js#does
        not give it again to a tenant that deleted it
    binding_scope: >-
      contributions: the cited tests support their own asserted outcomes. Additional setup, branches
      and combined sequences remain proposed unless the cited assertions exercise them.
  - id: ATS-PFM-INT-022-03
    title: Business arithmetic follows local working time
    level: unit
    proves:
      - BR-CAP-PFM-INT-022-03
    preconditions: A Monday-to-Friday calendar has a Monday holiday and nine-to-five hours.
    steps: Add two business days to Friday at four and four business hours from three.
    expected: 'The results are Wednesday at four and the next working day at eleven, respectively.'
    negative: false
    data_needs: 'Fixtures establishing the stated accounts, declarations and history in an isolated workspace.'
    bound_to:
      - TST-PFM-INT-002
    provenance: test
    source: >-
      macroservice-libraries:packages/workflow-actions/src/business-days.spec.ts#P2D business from a
      Friday 16:00 with a Monday holiday lands on Wednesday 16:00, across the DST change (08 §10 case 8)
    category: edge
    binding_evidence:
      - >-
        macroservice-libraries:packages/workflow-actions/src/business-days.spec.ts#P2D business from a
        Friday 16:00 with a Monday holiday lands on Wednesday 16:00, across the DST change (08 §10 case
        8)
      - >-
        macroservice-libraries:packages/workflow-actions/src/business-days.spec.ts#PT4H business from
        15:00 on a 09:00–17:00 calendar is 11:00 the next working day
      - >-
        macroservice-libraries:packages/workflow-actions/src/business-days.spec.ts#the calendar is read
        in its own zone, not the tenant’s
    binding_scope: >-
      contributions: the cited tests support their own asserted outcomes. Additional setup, branches
      and combined sequences remain proposed unless the cited assertions exercise them.
  - id: ATS-PFM-INT-022-04
    title: Configuration mutation requires the matching authority
    level: api
    proves:
      - BR-CAP-PFM-INT-022-05
    preconditions: A caller has registry read alone.
    steps: Attempt creation of a business calendar.
    expected: The creation request is denied without its management permission.
    negative: true
    data_needs: 'Fixtures establishing the stated accounts, declarations and history in an isolated workspace.'
    bound_to: []
    provenance: proposed
    source: 'services-platform:modules/workflow-actions/aws/api/workflow-actions.routes.ts:workflowActionsRoutes'
    category: permission
    binding_evidence: []
  - id: ATS-PFM-INT-022-05
    title: Calendar limits and locks preserve existing state
    level: api
    proves:
      - BR-CAP-PFM-INT-022-06
    preconditions: 'The workspace holds one hundred calendars, an old copy, locked entries and one unlocked default.'
    steps: 'Exceed the count, replace the old copy, mutate locked entries and delete the unlocked default.'
    expected: >-
      Count, concurrency and lock violations preserve records and default; permitted default deletion
      leaves no default.
    negative: true
    data_needs: 'Fixtures establishing the stated accounts, declarations and history in an isolated workspace.'
    bound_to: []
    provenance: proposed
    source: >-
      services-platform:modules/workflow-actions/services/persistence/business-calendars.ts:createBusinessCalendar
    category: boundary
    binding_evidence: []
  - id: ATS-PFM-INT-022-06
    level: api
    negative: false
    data_needs: Run-owned records and principals in an isolated workspace.
    bound_to: []
    provenance: proposed
    title: Calendar edits leave an already scheduled timer unchanged
    category: interaction
    proves:
      - BR-CAP-PFM-INT-020-07
      - BR-CAP-PFM-INT-022-04
    exercises:
      - CAP-PFM-INT-022
      - CAP-PFM-INT-020
    preconditions: A host has a business-duration timer calculated from its workspace calendar.
    steps: Change the calendar and inspect the shared timer view before calculating a new timer.
    expected: The existing timer retains its due date and the new calculation uses the changed calendar.
    source:
      - >-
        services-platform:modules/workflow-actions/tests/integration/services/persistence/cross-workflow-views.queries.integration.spec.js#skips
        a host with no view, and one whose view lacks a column, naming each
      - 'services-platform:docs/workflow-actions/README.md#How a host reads a calendar'
    workflows: []
  - id: ATS-PFM-INT-022-07
    level: api
    negative: false
    data_needs: Run-owned records and principals in an isolated workspace.
    bound_to: []
    provenance: proposed
    title: Workspace lifecycle separates defaults from retained history
    category: interaction
    proves:
      - BR-CAP-PFM-INT-003-11
      - BR-CAP-PFM-INT-022-02
    exercises:
      - CAP-PFM-INT-022
      - CAP-PFM-INT-003
    preconditions: Two workspaces have installations and seeded calendars.
    steps: >-
      Retry provisioning, delete one workspace through its participants and inspect the remaining
      workspace.
    expected: >-
      Provisioning creates no duplicate seed and deletion removes only the selected workspace records,
      with protected history removed last.
    source:
      - >-
        services-platform:modules/integrations/tests/integration/services/maintenance/tenant-participant.integration.spec.js#leaves
        every table of the module empty of the tenant, the ones the application can delete included
      - >-
        services-platform:modules/workflow-actions/tests/integration/services/maintenance/tenant-participant.integration.spec.js#gives
        the tenant Standard week in its own zone, as its default
    workflows:
      - WF-PFM-INT-023
evidence:
  - >-
    Each binding identifies an existing source test at the pinned revision; unbound scenarios remain
    proposed proof obligations.
supersedes:
  - ATS-PFM-INT-019
title: Acceptance for customer business calendars
coverage:
  rule: 'gap: FND-PFM-INT-094'
  transition: covered
  validation: covered
  permission: covered
  edge: covered
  failure: 'gap: FND-PFM-INT-094'
  boundary: covered
  concurrency: 'gap: FND-PFM-INT-094'
  invariant: 'gap: FND-PFM-INT-094'
  interaction: covered
coverage_notes:
  covered: A designed scenario exists; executable coverage and a passing run require separate evidence.
  gaps: >-
    The finding records categories without a designed scenario and remaining permission and rule audit
    obligations.
---
# Schedule work using customer business calendars: Capability Test Specification

## Coverage

| Rule | Proved By |
|---|---|
| `BR-CAP-PFM-INT-022-01` | `ATS-PFM-INT-022-01` |
| `BR-CAP-PFM-INT-022-02` | `ATS-PFM-INT-022-02`, `ATS-PFM-INT-022-07` |
| `BR-CAP-PFM-INT-022-03` | `ATS-PFM-INT-022-03` |
| `BR-CAP-PFM-INT-022-04` | `ATS-PFM-INT-022-06` |
| `BR-CAP-PFM-INT-022-05` | `ATS-PFM-INT-022-04` |
| `BR-CAP-PFM-INT-022-06` | `ATS-PFM-INT-022-05` |

## Interactions With Related Capabilities

Calendar configuration feeds calculations performed by a workflow host. The interaction cases distinguish existing timers from later calculations and follow workspace provisioning and deletion across calendar and integration records.

The structured scenarios name the capabilities and rules involved. A bound test contributes only the outcomes it asserts; proposed transition matrices and composed interactions still require executable proof.
