Skip to content

ATS-CRM-ACT-011Complete, cancel and reopen work with clear attribution: Capability Test Specification

Markdown

ATS-CRM-ACT-011

Complete, cancel and reopen work with clear attribution: Capability Test Specification

Markdown
  • DocumentProposed

KindAcceptance test setProduct areaCRMModuleActivities, Follow-ups and Task WorkRevision3

Read atservices-crm a8d1364freact-console baf6dae3rhythm-v2-docs 18a49edf

Coverage

  • Rule gap: FND-CRM-ACT-057
  • Transition covered
  • Validation covered
  • Permission gap: FND-CRM-ACT-057
  • Edge covered
  • Failure covered
  • Boundary gap: FND-CRM-ACT-057
  • Concurrency covered
  • Invariant covered
  • Interaction covered

Test Scenarios

24 scenarios proving CAP-CRM-ACT-011; 9 bound to an existing test.

01 Evaluate ordinary task status transitionstransitionunitnegativetest
Proves
BR-CAP-CRM-ACT-011-01
Preconditions
All task statuses are available to the lifecycle decision.
Steps
Evaluate each possible ordinary edit transition.
Expected
Open-to-open transitions succeed and closed-boundary transitions fail.
Data
Each run creates and isolates the records it needs.
Bound to
services-crm:modules/tasks/tests/unit/services/tasks/lifecycle.spec.js#allows an open task to move to any of the three open statuses
services-crm:modules/tasks/tests/unit/services/tasks/lifecycle.spec.js#decides every operation from every status, so no move is left unanswered
Source
services-crm:modules/tasks/tests/unit/services/tasks/lifecycle.spec.js#allows an open task to move to any of the three open statuses
02 Require explicit closing actionsvalidationapinegativetest
Proves
BR-CAP-CRM-ACT-011-02
Preconditions
An open task is saved.
Steps
Replace its status with Completed or Cancelled.
Expected
The service refuses and names the appropriate action.
Data
Each run creates and isolates the records it needs.
Bound to
services-crm:modules/tasks/tests/unit/services/tasks/lifecycle.spec.js#refuses an update that would complete the task, naming the operation that would have worked
services-crm:modules/tasks/tests/unit/services/tasks/lifecycle.spec.js#refuses an update that would cancel the task the same way
services-crm:modules/tasks/tests/integration/services/persistence/tasks.integration.spec.js#refuses a replacement that would complete the task, naming the operation that would
Source
services-crm:modules/tasks/tests/unit/services/tasks/lifecycle.spec.js#refuses an update that would complete the task, naming the operation that would have worked
03 Attribute closing and clear stamps on reopeninvariantapitest
Proves
BR-CAP-CRM-ACT-011-03
Preconditions
An open task can be completed and cancelled.
Steps
Complete, reopen and cancel it.
Expected
Closing stamps identify actor and time, and reopening clears prior stamps.
Data
Each run creates and isolates the records it needs.
Bound to
services-crm:modules/tasks/tests/e2e/tasks.e2e.spec.js#completes the task, stamping who finished it and when
services-crm:modules/tasks/tests/e2e/tasks.e2e.spec.js#cancels it afterwards, stamping who decided that and when
services-crm:modules/tasks/tests/integration/db/tasks.table.integration.spec.js#refuses a completion stamp on a task that is not completed, so a reopen leaves no trace
Source
services-crm:modules/tasks/tests/e2e/tasks.e2e.spec.js#completes the task, stamping who finished it and when
04 Require reopening between closed statusestransitionunitnegativetest
Proves
BR-CAP-CRM-ACT-011-04
Preconditions
Completed and Cancelled tasks are available.
Steps
Cancel the completed task and complete the cancelled task.
Expected
Both refuse with reopening guidance.
Data
Each run creates and isolates the records it needs.
Bound to
services-crm:modules/tasks/tests/unit/services/tasks/lifecycle.spec.js#refuses a cancelled task, asking for the reopen that would make it possible
services-crm:modules/tasks/tests/unit/services/tasks/lifecycle.spec.js#refuses a completed task, asking for the reopen that would make it possible
services-crm:modules/tasks/tests/integration/services/persistence/tasks.integration.spec.js#refuses cancelling a completed task, asking for the reopen first
Source
services-crm:modules/tasks/tests/unit/services/tasks/lifecycle.spec.js#refuses a cancelled task, asking for the reopen that would make it possible
05 Reject repeated user completionedgeapinegativetest
Proves
BR-CAP-CRM-ACT-011-05
Preconditions
The task is already completed.
Steps
Complete it again as a person.
Expected
The action returns Conflict.
Data
Each run creates and isolates the records it needs.
Bound to
services-crm:modules/tasks/tests/e2e/tasks.e2e.spec.js#answers 409 to completing a task that is already completed
Source
services-crm:modules/tasks/tests/e2e/tasks.e2e.spec.js#answers 409 to completing a task that is already completed
06 Restore Open and remove completion attributiontransitionapinegativetest
Proves
BR-CAP-CRM-ACT-011-06
Preconditions
A deferred task was completed.
Steps
Reopen it and separately try reopening an already open task.
Expected
The closed task returns to Open without closing stamps; the other request fails.
Data
Each run creates and isolates the records it needs.
Bound to
services-crm:modules/tasks/tests/integration/services/persistence/tasks.integration.spec.js#reopens it as open, whatever status it was in before it closed
services-crm:modules/tasks/tests/integration/services/persistence/tasks.integration.spec.js#clears the completion stamps on the reopen, so nothing says it is done
services-crm:modules/tasks/tests/e2e/tasks.e2e.spec.js#answers 409 to reopening a task that is not closed
services-crm:modules/tasks/tests/unit/services/tasks/lifecycle.spec.js#refuses a deferred task too: deferred is still a task somebody will do
Source
services-crm:modules/tasks/tests/integration/services/persistence/tasks.integration.spec.js#reopens it as open, whatever status it was in before it closed
07 Prevent ordinary edits to closed workfailureapinegativetest
Proves
BR-CAP-CRM-ACT-011-07
Preconditions
A task is cancelled.
Steps
Submit its general replacement.
Expected
The response conflicts and requires reopening.
Data
Each run creates and isolates the records it needs.
Bound to
services-crm:modules/tasks/tests/e2e/tasks.e2e.spec.js#answers 409 to replacing a cancelled task, which is reopened first
services-crm:modules/tasks/tests/unit/services/tasks/lifecycle.spec.js#refuses an update of a completed task even where the status is left alone
Source
services-crm:modules/tasks/tests/e2e/tasks.e2e.spec.js#answers 409 to replacing a cancelled task, which is reopened first
08 Guard lifecycle actions with the read versionconcurrencyapinegativetest
Proves
BR-CAP-CRM-ACT-011-08
Preconditions
A task was completed after an earlier read.
Steps
Reopen with the earlier version and send closing actions without a version.
Expected
The stale action conflicts, missing versions fail validation and the saved status remains.
Data
Each run creates and isolates the records it needs.
Bound to
services-crm:modules/tasks/tests/e2e/tasks.e2e.spec.js#answers 409 to the reopen sent at the version the completion moved on from
services-crm:modules/tasks/tests/e2e/tasks.e2e.spec.js#answers 400 naming sys_version to a reopen, a cancel and a complete that name no version
services-crm:modules/tasks/tests/unit/api/task-api-mapper.spec.js#refuses a body that names no version, as ObjectInvalid naming sys_version
Source
services-crm:modules/tasks/tests/e2e/tasks.e2e.spec.js#answers 409 to the reopen sent at the version the completion moved on from
09 Workflow closure resolves overdue work and differs from a person retryinteractionapiproposed
Proves
BR-CAP-CRM-ACT-011-05 BR-CAP-CRM-ACT-015-04 BR-CAP-CRM-ACT-017-04
Preconditions
Publishing is enabled and an overdue task is open.
Steps
Complete as a registered service, repeat that command, then attempt a person completion with the current version.
Expected
The item resolves, the service repeat leaves the version unchanged, and the person repeat conflicts.
Data
Run-owned records in an isolated workspace; fixed clock for calendar checks.
Source
services-crm:modules/tasks/tests/e2e/tasks.e2e.spec.js#answers 409 to completing a task that is already completed; services-crm:modules/tasks/tests/integration/services/persistence/task-attention-items.integration.spec.js#resolves the item completed when the overdue task is completed; services-crm:modules/tasks/tests/integration/services/persistence/tasks.workflow-actions.integration.spec.js#answers a completed task as it is, writing nothing, when asked again idempotently
10 Persist task from Open to Waiting for someone elsetransitionapiproposed
Proves
INV-DOM-CRM-ACT-003-02 INV-DOM-CRM-ACT-003-10 INV-DOM-CRM-ACT-003-12
Preconditions
Run-owned task has Open standing. The task is unfinished, updates are unlocked and the read version matches.
Steps
An ordinary edit selects another unfinished-work status. Read the resulting record and affected projections after commit.
Expected
The resulting task has Waiting for someone else standing. Enabled attention refreshes an overdue item within the task transaction.
Data
Run-owned records in an isolated workspace; fixed clock for calendar checks.
Source
services-crm:modules/tasks/tests/unit/services/tasks/lifecycle.spec.js#allows an open task to move to any of the three open statuses
11 Persist task from Waiting for someone else to Deferredtransitionapiproposed
Proves
INV-DOM-CRM-ACT-003-02 INV-DOM-CRM-ACT-003-10 INV-DOM-CRM-ACT-003-12
Preconditions
Run-owned task has Waiting for someone else standing. The task is unfinished, updates are unlocked and the read version matches.
Steps
An ordinary edit selects another unfinished-work status. Read the resulting record and affected projections after commit.
Expected
The resulting task has Deferred standing. Enabled attention refreshes an overdue item within the task transaction.
Data
Run-owned records in an isolated workspace; fixed clock for calendar checks.
Source
services-crm:modules/tasks/tests/unit/services/tasks/lifecycle.spec.js#allows an open task to move to any of the three open statuses
12 Persist task from Deferred to Opentransitionapiproposed
Proves
INV-DOM-CRM-ACT-003-02 INV-DOM-CRM-ACT-003-10 INV-DOM-CRM-ACT-003-12
Preconditions
Run-owned task has Deferred standing. The task is unfinished, updates are unlocked and the read version matches.
Steps
An ordinary edit selects another unfinished-work status. Read the resulting record and affected projections after commit.
Expected
The resulting task has Open standing. Enabled attention refreshes an overdue item within the task transaction.
Data
Run-owned records in an isolated workspace; fixed clock for calendar checks.
Source
services-crm:modules/tasks/tests/unit/services/tasks/lifecycle.spec.js#allows an open task to move to any of the three open statuses
13 Persist task from Open to Completedtransitionapiproposed
Proves
INV-DOM-CRM-ACT-003-02 INV-DOM-CRM-ACT-003-10 INV-DOM-CRM-ACT-003-12
Preconditions
Run-owned task has Open standing. Updates are unlocked and the task is unfinished; the public action also requires the current read version.
Steps
The dedicated completion action is invoked. Read the resulting record and affected projections after commit.
Expected
The resulting task has Completed standing. The completion actor and instant are recorded while routing is retained. Enabled attention resolves an overdue item as completed in the same transaction.
Data
Run-owned records in an isolated workspace; fixed clock for calendar checks.
Source
services-crm:modules/tasks/tests/e2e/tasks.e2e.spec.js#completes the task, stamping who finished it and when
14 Persist task from Open to Cancelledtransitionapiproposed
Proves
INV-DOM-CRM-ACT-003-02 INV-DOM-CRM-ACT-003-10 INV-DOM-CRM-ACT-003-12
Preconditions
Run-owned task has Open standing. Updates are unlocked and the task is unfinished; the public action also requires the current read version.
Steps
The dedicated cancellation action is invoked. Read the resulting record and affected projections after commit.
Expected
The resulting task has Cancelled standing. The cancellation actor and instant are recorded while routing is retained. Enabled attention resolves an overdue item as cancelled in the same transaction.
Data
Run-owned records in an isolated workspace; fixed clock for calendar checks.
Source
services-crm:modules/tasks/services/persistence/tasks.ts:closeTask
15 Persist task from Waiting for someone else to Completedtransitionapiproposed
Proves
INV-DOM-CRM-ACT-003-02 INV-DOM-CRM-ACT-003-10 INV-DOM-CRM-ACT-003-12
Preconditions
Run-owned task has Waiting for someone else standing. Updates are unlocked and the task is unfinished; the public action also requires the current read version.
Steps
The dedicated completion action is invoked. Read the resulting record and affected projections after commit.
Expected
The resulting task has Completed standing. The completion actor and instant are recorded while routing is retained. Enabled attention resolves an overdue item as completed in the same transaction.
Data
Run-owned records in an isolated workspace; fixed clock for calendar checks.
Source
services-crm:modules/tasks/services/tasks/lifecycle.ts:taskTransitionRefusal
16 Persist task from Deferred to Cancelledtransitionapiproposed
Proves
INV-DOM-CRM-ACT-003-02 INV-DOM-CRM-ACT-003-10 INV-DOM-CRM-ACT-003-12
Preconditions
Run-owned task has Deferred standing. Updates are unlocked and the task is unfinished; the public action also requires the current read version.
Steps
The dedicated cancellation action is invoked. Read the resulting record and affected projections after commit.
Expected
The resulting task has Cancelled standing. The cancellation actor and instant are recorded while routing is retained. Enabled attention resolves an overdue item as cancelled in the same transaction.
Data
Run-owned records in an isolated workspace; fixed clock for calendar checks.
Source
services-crm:modules/tasks/services/tasks/lifecycle.ts:taskTransitionRefusal
17 Persist task from Completed to Opentransitionapiproposed
Proves
INV-DOM-CRM-ACT-003-02 INV-DOM-CRM-ACT-003-10 INV-DOM-CRM-ACT-003-12
Preconditions
Run-owned task has Completed standing. The task is closed, updates are unlocked and the required read version matches.
Steps
The dedicated reopening action is invoked. Read the resulting record and affected projections after commit.
Expected
The resulting task has Open standing. Both closing stamp pairs are cleared and the status becomes Open regardless of the earlier unfinished status. Enabled attention publishes again if the reopened work is overdue.
Data
Run-owned records in an isolated workspace; fixed clock for calendar checks.
Source
services-crm:modules/tasks/tests/integration/services/persistence/tasks.integration.spec.js#reopens it as open, whatever status it was in before it closed
18 Persist task from Cancelled to Opentransitionapiproposed
Proves
INV-DOM-CRM-ACT-003-02 INV-DOM-CRM-ACT-003-10 INV-DOM-CRM-ACT-003-12
Preconditions
Run-owned task has Cancelled standing. The task is closed, updates are unlocked and the required read version matches.
Steps
The dedicated reopening action is invoked. Read the resulting record and affected projections after commit.
Expected
The resulting task has Open standing. Both closing stamp pairs are cleared and the status becomes Open regardless of the earlier unfinished status. Enabled attention publishes again if the reopened work is overdue.
Data
Run-owned records in an isolated workspace; fixed clock for calendar checks.
Source
services-crm:modules/tasks/services/persistence/tasks.ts:reopenTask
19 Persist task from Open to Deferredtransitionapiproposed
Proves
INV-DOM-CRM-ACT-003-02 INV-DOM-CRM-ACT-003-10 INV-DOM-CRM-ACT-003-12
Preconditions
Run-owned task has Open standing. The task is unfinished, updates are unlocked and the read version matches.
Steps
An ordinary edit selects another unfinished-work status. Read the resulting record and affected projections after commit.
Expected
The resulting task has Deferred standing. Enabled attention refreshes an overdue item within the task transaction.
Data
Run-owned records in an isolated workspace; fixed clock for calendar checks.
Source
services-crm:modules/tasks/services/tasks/lifecycle.ts:taskTransitionRefusal
20 Persist task from Waiting for someone else to Opentransitionapiproposed
Proves
INV-DOM-CRM-ACT-003-02 INV-DOM-CRM-ACT-003-10 INV-DOM-CRM-ACT-003-12
Preconditions
Run-owned task has Waiting for someone else standing. The task is unfinished, updates are unlocked and the read version matches.
Steps
An ordinary edit selects another unfinished-work status. Read the resulting record and affected projections after commit.
Expected
The resulting task has Open standing. Enabled attention refreshes an overdue item within the task transaction.
Data
Run-owned records in an isolated workspace; fixed clock for calendar checks.
Source
services-crm:modules/tasks/services/tasks/lifecycle.ts:taskTransitionRefusal
21 Persist task from Deferred to Waiting for someone elsetransitionapiproposed
Proves
INV-DOM-CRM-ACT-003-02 INV-DOM-CRM-ACT-003-10 INV-DOM-CRM-ACT-003-12
Preconditions
Run-owned task has Deferred standing. The task is unfinished, updates are unlocked and the read version matches.
Steps
An ordinary edit selects another unfinished-work status. Read the resulting record and affected projections after commit.
Expected
The resulting task has Waiting for someone else standing. Enabled attention refreshes an overdue item within the task transaction.
Data
Run-owned records in an isolated workspace; fixed clock for calendar checks.
Source
services-crm:modules/tasks/services/tasks/lifecycle.ts:taskTransitionRefusal
22 Persist task from Waiting for someone else to Cancelledtransitionapiproposed
Proves
INV-DOM-CRM-ACT-003-02 INV-DOM-CRM-ACT-003-10 INV-DOM-CRM-ACT-003-12
Preconditions
Run-owned task has Waiting for someone else standing. Updates are unlocked and the task is unfinished; the public action also requires the current read version.
Steps
The dedicated cancellation action is invoked. Read the resulting record and affected projections after commit.
Expected
The resulting task has Cancelled standing. The cancellation actor and instant are recorded while routing is retained. Enabled attention resolves an overdue item as cancelled in the same transaction.
Data
Run-owned records in an isolated workspace; fixed clock for calendar checks.
Source
services-crm:modules/tasks/services/tasks/lifecycle.ts:taskTransitionRefusal
23 Persist task from Deferred to Completedtransitionapiproposed
Proves
INV-DOM-CRM-ACT-003-02 INV-DOM-CRM-ACT-003-10 INV-DOM-CRM-ACT-003-12
Preconditions
Run-owned task has Deferred standing. Updates are unlocked and the task is unfinished; the public action also requires the current read version.
Steps
The dedicated completion action is invoked. Read the resulting record and affected projections after commit.
Expected
The resulting task has Completed standing. The completion actor and instant are recorded while routing is retained. Enabled attention resolves an overdue item as completed in the same transaction.
Data
Run-owned records in an isolated workspace; fixed clock for calendar checks.
Source
services-crm:modules/tasks/services/tasks/lifecycle.ts:taskTransitionRefusal
24 Map lifecycle refusal codes through the public error boundaryfailureunitnegativetest
Proves
BR-CAP-CRM-ACT-011-10 BR-CAP-CRM-ACT-017-05
Preconditions
Refusals represent incompatible closure, update locking and ineligible role claiming.
Steps
Map each refusal through the shared error response.
Expected
The response retains the specific problem code alongside status and explanation.
Data
Run-owned records in an isolated workspace; fixed clock for calendar checks.
Bound to
Source
services-crm:modules/tasks/tests/unit/services/tasks/task-refusals.spec.js

The Markdown files under specs/ in rhythmsoftware/rhythm-v2-docs are the canonical source of truth. This reader is a generated, read-only projection of them.