Skip to content

ATS-PFM-DJE-008Restore a bulk update while preserving later changes: Capability Test Specification

Markdown

ATS-PFM-DJE-008

Restore a bulk update while preserving later changes: Capability Test Specification

Markdown
  • DocumentProposed

KindAcceptance test setProduct areaPlatformModuleData Job EngineRevision2

Read atmacroservice-libraries 54536a44services-crm a8d1364freact-console baf6dae3

Coverage

  • Rule gap: FND-PFM-DJE-068
  • Transition gap: FND-PFM-DJE-068
  • Validation covered
  • Permission covered
  • Edge covered
  • Failure gap: FND-PFM-DJE-068
  • Boundary covered
  • Concurrency covered
  • Invariant gap: FND-PFM-DJE-068
  • Interaction covered

Test Scenarios

10 scenarios proving CAP-PFM-DJE-008; 4 bound to an existing test.

01 Rollback planning creates linked validated worktransitionapitest
Proves
BR-CAP-PFM-DJE-008-01
Preconditions
Complete an update over ten contacts.
Steps
[ { "do": "Prepare its restoration plan.", "expect": "The separate validated job links to the original and retains the overwritten values for eligible records.", "provenance": "test", "source": "services-crm:modules/data-jobs/tests/integration/services/jobs/contact-update-rollback.integration.spec.js#answers a rollback job of its own, linked to the job it compensates" } ]
Expected
The separate validated job links to the original and retains the overwritten values for eligible records.
Data
No additional fixture is needed.
Bound to
Source
services-crm:modules/data-jobs/tests/integration/services/jobs/contact-update-rollback.integration.spec.js#answers a rollback job of its own, linked to the job it compensates
02 Later edits remain outside restorationconcurrencyapinegativetest
Proves
BR-CAP-PFM-DJE-008-02
Preconditions
Edit two of ten contacts after their bulk update.
Steps
[ { "do": "Plan and apply rollback.", "expect": "Eight contacts are restored; two exclusions identify changed fields, editors and times while preserving their edits.", "provenance": "test", "source": "services-crm:modules/data-jobs/tests/integration/services/jobs/contact-update-rollback.integration.spec.js#plans a rollback of the eight nobody touched, and refuses the two somebody did" } ]
Expected
Eight contacts are restored; two exclusions identify changed fields, editors and times while preserving their edits.
Data
No additional fixture is needed.
Bound to
Source
services-crm:modules/data-jobs/tests/integration/services/jobs/contact-update-rollback.integration.spec.js#plans a rollback of the eight nobody touched, and refuses the two somebody did
03 Restoration requires versioned inputvalidationapinegativetest
Proves
BR-CAP-PFM-DJE-008-03
Preconditions
Supply an unversioned plan and separately edit a record after a valid plan.
Steps
[ { "do": "Attempt planning and application.", "expect": "The unversioned plan creates no job; the later edit produces a conflict.", "provenance": "test", "source": "macroservice-libraries:packages/data-jobs/src/tests/integration/rollback-and-retry.integration.spec.ts#refuses a rollback plan with an unversioned item, and writes no rollback job" } ]
Expected
The unversioned plan creates no job; the later edit produces a conflict.
Data
No additional fixture is needed.
Bound to
Source
macroservice-libraries:packages/data-jobs/src/tests/integration/rollback-and-retry.integration.spec.ts#refuses a rollback plan with an unversioned item, and writes no rollback job
04 Unsupported rollback states have coded refusalsedgeunitnegativetest
Proves
BR-CAP-PFM-DJE-008-04
Preconditions
Prepare delete, running and already-restored job states.
Steps
[ { "do": "Evaluate rollback availability for each and for a merely planned rollback.", "expect": "Unsupported cases return their refusal codes; planning alone does not block another plan.", "provenance": "test", "source": "macroservice-libraries:packages/data-jobs/src/data-job-actions.spec.ts#refuses Rollback by the code the service would answer" } ]
Expected
Unsupported cases return their refusal codes; planning alone does not block another plan.
Data
No additional fixture is needed.
Bound to
Source
macroservice-libraries:packages/data-jobs/src/data-job-actions.spec.ts#refuses Rollback by the code the service would answer
05 Custom-field changes exclude whole recordsboundarybrowsernegativeproposed
Proves
BR-CAP-PFM-DJE-008-05
Preconditions
Prepare a job that sets a title and a custom value on ten contacts.
Steps
[ { "do": "Plan restoration and inspect its refusals.", "expect": "Those contacts are non-reversible as whole records; their titles are not independently restored.", "provenance": "proposed", "source": "react-console:acceptance/crm/playwright/journeys/data-operations/CRM-ACC-0659.spec.ts#CRM-ACC-0659" } ]
Expected
Those contacts are non-reversible as whole records; their titles are not independently restored.
Data
Contacts with the relevant custom field.
Source
react-console:acceptance/crm/playwright/journeys/data-operations/CRM-ACC-0659.spec.ts#CRM-ACC-0659
06 Rollback refuses a caller lacking update accesspermissionapinegativeproposed
Proves
BR-CAP-PFM-DJE-008-06
Preconditions
Use a caller with bulk access but no update permission.
Steps
[ { "do": "Request rollback planning.", "expect": "The proposed API proof expects 403.", "provenance": "proposed", "source": "macroservice-libraries:packages/data-jobs/src/data-job-actions.spec.ts#offers Rollback for a finished job, requiring the bulk key and the per-record key the plan re-checks" } ]
Expected
The proposed API proof expects 403.
Data
Caller contexts with distinct grants.
Source
macroservice-libraries:packages/data-jobs/src/data-job-actions.spec.ts#offers Rollback for a finished job, requiring the bulk key and the per-record key the plan re-checks
07 Applied restoration prevents reopening original blocked workinteractionapiproposed
Proves
BR-CAP-PFM-DJE-004-05 BR-CAP-PFM-DJE-008-01 BR-CAP-PFM-DJE-008-09
Preconditions
Finish an update with reversible changes and blocked input.
Steps
[ { "do": "Plan a restoration, verify planning alone leaves retry available, apply the restoration, and attempt retry of the original.", "expect": "Only application of restoration prevents later retry; restored values stay intact.", "provenance": "proposed", "source": "macroservice-libraries:packages/data-jobs/src/tests/integration/rollback-and-retry.integration.spec.ts#refuses to retry a job that has been rolled back, so its blocked rows are not written after the undo; services-crm:modules/data-jobs/tests/integration/services/jobs/contact-update-rollback.integration.spec.js#plans it already validated, because planning a rollback IS validating it; macroservice-libraries:packages/data-jobs/README.md#Rolling a job back" } ]
Expected
Only application of restoration prevents later retry; restored values stay intact.
Data
Finish an update with reversible changes and blocked input.
Source
macroservice-libraries:packages/data-jobs/src/tests/integration/rollback-and-retry.integration.spec.ts#refuses to retry a job that has been rolled back, so its blocked rows are not written after the undo; services-crm:modules/data-jobs/tests/integration/services/jobs/contact-update-rollback.integration.spec.js#plans it already validated, because planning a rollback IS validating it; macroservice-libraries:packages/data-jobs/README.md#Rolling a job back
08 Restoration retains an inspectable link and exclusionsinteractionapiproposed
Proves
BR-CAP-PFM-DJE-005-05 BR-CAP-PFM-DJE-008-01 BR-CAP-PFM-DJE-008-02
Preconditions
Complete a contact title update and edit one affected title afterward.
Steps
[ { "do": "Plan and apply restoration, then inspect both jobs and the excluded contact.", "expect": "The restoration is linked to the original; reversible contacts are restored and the later edit remains with an exclusion.", "provenance": "proposed", "source": "services-crm:modules/data-jobs/tests/integration/services/jobs/contact-data-jobs.integration.spec.js#stamps the job on the revision, so every record one job changed can be listed; services-crm:modules/data-jobs/tests/integration/services/jobs/contact-update-rollback.integration.spec.js#plans it already validated, because planning a rollback IS validating it; services-crm:modules/data-jobs/tests/integration/services/jobs/contact-update-rollback.integration.spec.js#says which field changed since the job and when, without saying what it was changed to" } ]
Expected
The restoration is linked to the original; reversible contacts are restored and the later edit remains with an exclusion.
Data
Complete a contact title update and edit one affected title afterward.
Source
services-crm:modules/data-jobs/tests/integration/services/jobs/contact-data-jobs.integration.spec.js#stamps the job on the revision, so every record one job changed can be listed; services-crm:modules/data-jobs/tests/integration/services/jobs/contact-update-rollback.integration.spec.js#plans it already validated, because planning a rollback IS validating it; services-crm:modules/data-jobs/tests/integration/services/jobs/contact-update-rollback.integration.spec.js#says which field changed since the job and when, without saying what it was changed to
09 An edit after restoration planning remains protectedinteractionapinegativeproposed
Proves
BR-CAP-PFM-DJE-006-01 BR-CAP-PFM-DJE-008-02 BR-CAP-PFM-DJE-008-03
Preconditions
Complete an update and plan its restoration using current versions.
Steps
[ { "do": "Edit a reversible contact after planning and approve the restoration.", "expect": "The later edit survives as a changed-since conflict while other reversible contacts are restored.", "provenance": "proposed", "source": "services-crm:modules/data-jobs/tests/integration/services/jobs/contact-update-versions.integration.spec.js#skips the contact that changed after the validation as a named conflict; services-crm:modules/data-jobs/services/operations/contact-update.ts:prevalidate; services-crm:modules/data-jobs/tests/integration/services/jobs/contact-update-rollback.integration.spec.js#says which field changed since the job and when, without saying what it was changed to; macroservice-libraries:packages/data-jobs/src/tests/integration/rollback-and-retry.integration.spec.ts#refuses a rollback plan with an unversioned item, and writes no rollback job" } ]
Expected
The later edit survives as a changed-since conflict while other reversible contacts are restored.
Data
Complete an update and plan its restoration using current versions.
Source
services-crm:modules/data-jobs/tests/integration/services/jobs/contact-update-versions.integration.spec.js#skips the contact that changed after the validation as a named conflict; services-crm:modules/data-jobs/services/operations/contact-update.ts:prevalidate; services-crm:modules/data-jobs/tests/integration/services/jobs/contact-update-rollback.integration.spec.js#says which field changed since the job and when, without saying what it was changed to; macroservice-libraries:packages/data-jobs/src/tests/integration/rollback-and-retry.integration.spec.ts#refuses a rollback plan with an unversioned item, and writes no rollback job
10 A completed hard deletion offers no restorationinteractionapiproposed
Proves
BR-CAP-PFM-DJE-007-07 BR-CAP-PFM-DJE-007-08 BR-CAP-PFM-DJE-008-04
Preconditions
Prepare contacts eligible for deletion.
Steps
[ { "do": "Validate and approve deletion, inspect its receipts, and request rollback.", "expect": "Deleted records remain absent and the unsupported restoration creates no compensating job.", "provenance": "proposed", "source": "services-crm:modules/data-jobs/tests/integration/services/jobs/contact-delete.integration.spec.js#removed, per collection, exactly the number of rows the validation had counted; services-crm:modules/data-jobs/tests/integration/services/jobs/contact-update-rollback.integration.spec.js#refuses the rollback, because there is no undo for a hard delete; macroservice-libraries:packages/data-jobs/src/data-job-actions.spec.ts#does not offer Rollback once a rollback has been applied, by the code the route answers, and still does while one is only planned" } ]
Expected
Deleted records remain absent and the unsupported restoration creates no compensating job.
Data
Prepare contacts eligible for deletion.
Source
services-crm:modules/data-jobs/tests/integration/services/jobs/contact-delete.integration.spec.js#removed, per collection, exactly the number of rows the validation had counted; services-crm:modules/data-jobs/tests/integration/services/jobs/contact-update-rollback.integration.spec.js#refuses the rollback, because there is no undo for a hard delete; macroservice-libraries:packages/data-jobs/src/data-job-actions.spec.ts#does not offer Rollback once a rollback has been applied, by the code the route answers, and still does while one is only planned

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.