---
id: CAP-PFM-INT-022
title: Schedule work using customer business calendars
feature: FEAT-PFM-INT-06
product_area: platform
module: integrations
revision: 1
status: draft
product_intent: proposed
implementation_evidence: observed
supersedes:
  - CAP-PFM-INT-019
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
  macroservice-libraries: 54536a441935c6e09fdb7f96f0bec71c52ba4e03
intent_sources:
  - 'services-platform:docs/proposals/application-processes-and-workflow-actions/14-decisions.md#D-03'
  - 'services-platform:docs/proposals/application-processes-and-workflow-actions/14-decisions.md#D-08'
purpose: >-
  Administrators define customer working days, holidays and a default calendar for supported business-time
  scheduling.
outcomes:
  - Provisioning supplies an initial working calendar for each workspace.
concepts:
  - CON-PFM-INT-006
actors:
  - ACT-PFM-022
  - ACT-PFM-006
surfaces:
  - api
preconditions: []
postconditions: []
permissions:
  - key: platform.workflow-actions.registry-read
    where_checked: api
    scope: tenant
  - key: platform.workflow-actions.calendars-manage
    where_checked: api
    scope: tenant
rules:
  - id: BR-CAP-PFM-INT-022-01
    proved_by: [ATS-PFM-INT-022-01, TST-PFM-INT-588, TST-PFM-INT-596]
    statement: >-
      Calendars require a valid IANA zone, distinct working weekdays, optional forward working hours and at
      most four hundred holidays; one default at most must be active and a new default atomically clears the
      previous one.
    kind: validation
    enforced_at:
      - service
      - database
    must_prove: true
    provenance: test
    source: >-
      services-platform:modules/workflow-actions/tests/integration/services/persistence/business-calendars.integration.spec.js#refuses
      more than 400 holidays
    origin: 'services-platform:docs/proposals/application-processes-and-workflow-actions/14-decisions.md#D-08'
  - id: BR-CAP-PFM-INT-022-02
    proved_by: [ATS-PFM-INT-003-16, ATS-PFM-INT-022-02, ATS-PFM-INT-022-07, TST-PFM-INT-590]
    statement: >-
      Provisioning gives a workspace a Monday-to-Friday, nine-to-five Standard week in its own zone with no
      holidays, uses the seed ledger once and does not recreate a user-deleted seed.
    kind: lifecycle
    enforced_at:
      - service
    must_prove: true
    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
    origin: 'services-platform:docs/proposals/application-processes-and-workflow-actions/14-decisions.md#D-08'
  - id: BR-CAP-PFM-INT-022-03
    proved_by: [ATS-PFM-INT-022-03, TST-PFM-INT-002]
    statement: >-
      Business-duration arithmetic uses the calendar’s zone, working days, hours and holidays, so two business
      days after Friday at four in the afternoon with Monday closed reaches Wednesday at the same time.
    kind: calculation
    enforced_at:
      - service
    must_prove: true
    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)
    origin: 'services-platform:docs/proposals/application-processes-and-workflow-actions/14-decisions.md#D-08'
  - id: BR-CAP-PFM-INT-022-04
    proved_by: [ATS-PFM-INT-022-06]
    statement: Calendar changes leave previously calculated timer dates unchanged.
    kind: policy
    enforced_at:
      - service
    must_prove: true
    provenance: documented
    source: 'services-platform:docs/workflow-actions/README.md#How a host reads a calendar'
    origin: 'services-platform:docs/proposals/application-processes-and-workflow-actions/14-decisions.md#D-08'
  - id: BR-CAP-PFM-INT-022-05
    proved_by: [ATS-PFM-INT-022-04]
    statement: >-
      Registry read permits calendar reads and calendars manage permits creating, replacing or deleting
      calendars.
    kind: permission
    enforced_at:
      - api
    must_prove: true
    provenance: observed
    source: 'services-platform:modules/workflow-actions/aws/api/workflow-actions.routes.ts:workflowActionsRoutes'
    origin: none
  - id: BR-CAP-PFM-INT-022-06
    proved_by: [ATS-PFM-INT-022-05]
    statement: >-
      A workspace holds no more than one hundred calendars; stale replacements and applicable locked mutations
      refuse without changes, while deletion of the sole unlocked default can leave no default.
    kind: validation
    enforced_at:
      - service
    must_prove: true
    provenance: observed
    source: >-
      services-platform:modules/workflow-actions/services/persistence/business-calendars.ts:createBusinessCalendar
    origin: none
scenarios:
  - id: SC-CAP-PFM-INT-022-01
    given: The working calendar closes weekends and a Monday holiday.
    when: A reminder adds two business days to Friday at four in the afternoon.
    then: The reminder falls on Wednesday at four in the afternoon.
    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)
edge_cases: []
constraints: []
depends_on:
  - CAP-PFM-INT-018
related:
  - CAP-PFM-INT-020
journeys: []
open_questions: []
evidence:
  - >-
    services-platform source inventory: modules/workflow-actions/services/persistence/action-templates.ts,
    workflow-templates.ts, business-calendars.ts, services/validation/action-lists.ts,
    contracts/workflow-template-document.ts, services/maintenance/*; rule-level automated test references;
    docs/workflow-actions/README.md; 14-decisions.md (D-03, D-08).
  - >-
    macroservice-libraries source inventory: packages/workflow-actions/src/business-days.ts; associated unit
    test.
  - 'End-to-end definition inventory: workflow-actions.e2e.spec.js.'
controls: [TC-AVL-004, TC-AZ-001, TC-AZ-002, TC-AZ-003, TC-AZ-004, TC-DAT-001, TC-DAT-003, TC-DAT-004, TC-IAM-001, TC-IAM-006, TC-LOG-004, TC-LOG-005, TC-PI-001, TC-PI-002, TC-PI-003, TC-PI-004, TC-PI-005, TC-TEN-001, TC-TEN-002, TC-TEN-003, TC-VEN-001, TC-VEN-002, TC-VEN-003]
exercised_by: [FAS-PFM-INT-06-01, FAS-PFM-INT-06-03, FAS-PFM-INT-06-04]
suites: [TST-PFM-INT-002, TST-PFM-INT-588, TST-PFM-INT-590, TST-PFM-INT-596]
---
# Schedule work using customer business calendars

## Purpose

Administrators define customer working days, holidays and a default calendar for supported business-time scheduling.

## How It Works

Staff maintain local working time for scheduled work. Calendar configuration supplies weekdays, hours and holidays. Provisioning gives the workspace an initial default. Selecting another default updates the previous flag in the same change. Existing timer dates remain those already computed. The product should make a missing default understandable after a permitted deletion.

## Relationships

Application hosts use the shared calendar arithmetic when computing business-time schedules. Their timer records own the resulting due dates.
