Skip to content

ATS-CRM-ENT-013Set records aside and restore them

Markdown

ATS-CRM-ENT-013

Set records aside and restore them

Markdown
  • DocumentProposed

KindAcceptance test setProduct areaCRMModuleEntitiesRevision1

Read atservices-crm a8d1364freact-console baf6dae3

Coverage

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

Test Scenarios

17 scenarios proving CAP-CRM-ENT-013; 10 bound to an existing test.

01 Archive needs its own keypermissionapinegativetest
Proves
BR-CAP-CRM-ENT-013-01
Preconditions
Prepare callers with update, read and archive keys.
Steps
Archive and unarchive a contact and an organization as each.
Expected
403 without the archive key; the record left live.
Data
Use personas by key.
Bound to
Source
services-crm:modules/entities/tests/e2e/archive.e2e.spec.js#refuses a caller who may update contacts but not archive them, 403
02 Archive at the version readconcurrencyapinegativetest
Proves
BR-CAP-CRM-ENT-013-02
Preconditions
Prepare a live contact.
Steps
Archive without a version; at a stale version; an unknown id.
Expected
400 naming sys_version; 409; 404.
Data
No additional fixtures.
Bound to
Source
services-crm:modules/entities/tests/e2e/archive.e2e.spec.js#refuses an archive with no version, 400, naming it
03 Archive preserves everything and is idempotentinvariantapitest
Proves
BR-CAP-CRM-ENT-013-03
Preconditions
Prepare a deceased contact with collections and an affiliation.
Steps
Archive it; archive it again.
Expected
Instant, user and reason set, version once, status preserved, collections preserved, one revision; no new version.
Data
No additional fixtures.
Bound to
Source
services-crm:modules/entities/tests/integration/services/persistence/contacts.archive.integration.spec.js#keeps the status it had: archive is not a status
04 Unarchive returns the record and preserves its reasontransitionapitest
Proves
BR-CAP-CRM-ENT-013-04
Preconditions
Prepare an archived organization.
Steps
Unarchive with a reason; with 501 characters; archive again.
Expected
Columns cleared, record as it was, reason preserved; rejected; reason cleared.
Data
No additional fixtures.
Bound to
Source
services-crm:modules/entities/tests/integration/services/persistence/organizations.archive.integration.spec.js#keeps the trimmed reason as unarchive_reason
05 an archived record rejects saves; a merge may save itfailureapinegativetest
Proves
BR-CAP-CRM-ENT-013-05 INV-DOM-CRM-ENT-033-12
Preconditions
Prepare an archived contact and organization.
Steps
Replace, patch, save as a merge.
Expected
409 RecordArchived twice, nothing changed; the merge saved.
Data
No additional fixtures.
Bound to
Source
services-crm:modules/entities/tests/e2e/archive.e2e.spec.js#refuses a replacement, 409 RecordArchived
06 Lists leave archived records out by defaultruleapitest
Proves
BR-CAP-CRM-ENT-013-06
Preconditions
Prepare one archived and some live contacts.
Steps
List by default, archived=only, archived=include; read the archived one by id.
Expected
Live only; it alone; both; complete record.
Data
No additional fixtures.
Bound to
Source
services-crm:modules/entities/tests/e2e/archive.e2e.spec.js#lists it for archived=only, and only it
07 Pickers and Quick Search leave archived records outinteractionbrowsertest
Proves
BR-CAP-CRM-ENT-013-07
Preconditions
Prepare an archived contact.
Steps
Search for it in Quick Search and a contact picker.
Expected
Not offered.
Data
No additional fixtures.
Bound to
Source
react-console:acceptance/crm/playwright/journeys/contacts/CRM-ACC-0066.spec.ts#CRM-ACC-0066
08 an archived organization preserves its peopleinteractionbrowsertest
Proves
BR-CAP-CRM-ENT-013-08
Preconditions
Prepare an organization with a current and a former employee.
Steps
Archive it; read the affiliations and the people list.
Expected
Affiliations keep the organization with its archive instant; Past, Current and All returned, each marked.
Data
No additional fixtures.
Bound to
Source
services-crm:modules/entities/tests/integration/services/persistence/organizations.archive.integration.spec.js#keeps the ended affiliation naming the organization's id, with its name and its archive instant
09 Only the actions write the archive recordinvariantapitest
Proves
BR-CAP-CRM-ENT-013-09 INV-DOM-CRM-ENT-033-11
Preconditions
Prepare an unarchived contact with an unarchive reason.
Steps
Save it ordinarily.
Expected
The reason preserved; the archive columns untouched.
Data
No additional fixtures.
Bound to
Source
services-crm:modules/entities/tests/integration/services/persistence/contacts.archive.integration.spec.js#is kept through a plain save, which never writes it
10 the journey: archive a closed firm and keep its peopleinteractionbrowsertest
Proves
AS-JNY-CRM-ENT-003-01 AS-JNY-CRM-ENT-003-02 AS-JNY-CRM-ENT-003-03
Preconditions
Prepare a firm with a former employee.
Steps
Run JNY-CRM-ENT-003.
Expected
Out of the default list; past affiliations name it, badged archived; unarchive returns it as it was.
Data
No additional fixtures.
Bound to
Source
react-console:acceptance/crm/playwright/journeys/organizations/CRM-ACC-0147.spec.ts#CRM-ACC-0147
11 Accept the archive reason limit and refuse the next characterboundaryapinegativeproposed
Proves
BR-CAP-CRM-ENT-013-03 BR-CAP-CRM-ENT-013-04
Preconditions
Two eligible records have current versions.
Steps
Archive one with a reason of 500 characters; try the other with 501; exercise the same boundary when restoring.
Expected
The limit-length reason is retained; the longer reason is refused without changing lifecycle state.
Data
Run-owned records and configuration in an isolated workspace.
Source
services-crm:modules/entities/tests/integration/services/persistence/contacts.archive.integration.spec.js#keeps the status it had: archive is not a status
12 Archive changes discovery without losing direct readsinteractionapiproposed
Proves
BR-CAP-CRM-ENT-003-05 BR-CAP-CRM-ENT-013-06
Preconditions
A live person can be found in an ordinary list.
Steps
Archive the person; list ordinarily and with archive inclusion; open it by identity.
Expected
The ordinary list omits it, the explicit archived selection includes it and the direct read retains its saved information.
Data
Run-owned records and configuration in an isolated workspace.
Source
services-crm:modules/entities/tests/e2e/contacts.e2e.spec.js#answers only the contacts a picker may offer: not the inactive, not the deceased; services-crm:modules/entities/tests/e2e/archive.e2e.spec.js#lists it for archived=only, and only it
13 Archive invalidates an open correctioninteractionapiproposed
Proves
BR-CAP-CRM-ENT-004-01 BR-CAP-CRM-ENT-013-05
Preconditions
An editor reads a live person while an administrator can archive it.
Steps
Archive the person; submit the editor’s pending correction.
Expected
The correction is refused and the archived record retains its pre-edit values.
Data
Run-owned records and configuration in an isolated workspace.
Source
services-crm:modules/entities/tests/e2e/contacts.e2e.spec.js#answers 400 naming sys_version to a patch that tests no version; services-crm:modules/entities/tests/e2e/archive.e2e.spec.js#refuses a replacement, 409 RecordArchived
14 Archived bodies retain their people’s relationshipsinteractionapiproposed
Proves
BR-CAP-CRM-ENT-009-15 BR-CAP-CRM-ENT-013-08
Preconditions
An organization has current, ended and upcoming person ties.
Steps
Archive the organization; inspect each dated people view and the contacts’ affiliations.
Expected
The relationship identities persist and reads show the organization’s archive information.
Data
Run-owned records and configuration in an isolated workspace.
Source
services-crm:modules/entities/tests/e2e/contact-affiliations.e2e.spec.js#answers 403 permission_missing to a caller who may read organizations but not contacts; services-crm:modules/entities/tests/integration/services/persistence/organizations.archive.integration.spec.js#keeps the ended affiliation naming the organization's id, with its name and its archive instant
15 Archive does not erase deletion dependenciesinteractionapiproposed
Proves
BR-CAP-CRM-ENT-013-08 BR-CAP-CRM-ENT-014-05
Preconditions
An archived organization still has an ended person affiliation.
Steps
Attempt organization deletion and read the retained affiliation.
Expected
Deletion is refused and the ended relationship still identifies the archived body.
Data
Run-owned records and configuration in an isolated workspace.
Source
services-crm:modules/entities/tests/integration/services/persistence/organizations.archive.integration.spec.js#keeps the ended affiliation naming the organization's id, with its name and its archive instant; services-crm:modules/entities/tests/e2e/organizations.e2e.spec.js#answers 409 to a delete while the contact is affiliated with it
16 Archive and restoration remain inspectableinteractionapiproposed
Proves
BR-CAP-CRM-ENT-013-03 BR-CAP-CRM-ENT-016-01
Preconditions
A live person has readable history.
Steps
Archive it with a reason, restore it with a reason and open both revisions.
Expected
History identifies both lifecycle changes while the restored person keeps its identity and collections.
Data
Run-owned records and configuration in an isolated workspace.
Source
services-crm:modules/entities/tests/integration/services/persistence/contacts.archive.integration.spec.js#keeps the status it had: archive is not a status; services-crm:modules/entities/tests/integration/services/persistence/contacts.history.integration.spec.js#writes exactly one revision, whatever the save touched
17 Exercise every declared authority independentlypermissionapinegativeproposed
Proves
BR-CAP-CRM-ENT-013-01
Preconditions
An eligible record and configuration fixture exist for each operation; the caller can reach only the run’s workspace.
Steps
For each declared permission, execute its matching operation with that permission, then without it while retaining the other required grants. Read affected records after every refused mutation.
Expected
The authorized case reaches the operation; the missing-grant case is refused and preserves saved data. Record access alone does not authorize the other declared actions.
Data
Run-owned records and configuration in an isolated workspace.
Source
services-crm:aws/crm.service.ts:ApplicationPermissions; services-crm:modules/entities/aws/api/entities.routes.ts

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.