Skip to content

CAP-CRM-ACT-003Correct or delete an activity with protection against stale edits

Markdown

CAP-CRM-ACT-003

Correct or delete an activity with protection against stale edits

Markdown
  • DocumentDraft
  • Product intentProposed
  • ImplementationObserved

KindCapabilityProduct areaCRMModuleActivities, Follow-ups and Task WorkRevision2

Read atservices-crm a8d1364freact-console baf6dae3

The Formal Contract

The narrative above explains; the sections below are authoritative — the rules, scenarios and tests this document binds.

Outcomes
Changes limited to the intended detailsConflicts that preserve newer workShared entries editable by authorized colleagues
Surfaces
consoleapijob
Preconditions
The workspace contains the activity being changed.
Postconditions
The save advances the activity version, or deletion removes the activity and its links.
Intent sources
services-crm:docs/milestones/CRM-M8-activities-and-tasks.md#E-09services-crm:docs/milestones/CRM-M1-contacts-and-organizations.md#D-05services-crm:docs/migrations/activities/README.md#D9

Controls

20 controls apply, from the corpus control catalogue.

TC-AZ-001 TC-AZ-002 TC-AZ-003 TC-AZ-004 TC-AZ-006 TC-DAT-001 TC-DAT-002 TC-DAT-003 TC-DAT-004 TC-LOG-004 TC-LOG-005 TC-PI-001 TC-PI-003 TC-PI-005 TC-PRV-001 TC-PRV-002 TC-PRV-003 TC-TEN-001 TC-TEN-002 TC-TEN-003

Permissions

KeyChecked atScope
crm.activities.readapitenant
crm.activities.updateapitenant
crm.activities.deleteapitenant
crm.activities.updateconsoletenant
crm.activities.deleteconsoletenant

Business Rules

11 rules, 10 to be proved before approval. A rule's product intent is derived from its origin: 3 confirmed by a product decision, the rest inheriting this capability's proposed.

IdRuleKindEnforced atProvenance
01must prove
Confirmed
An edit must use the version read, and a stale version causes a conflict without changing the activity.
no proof recorded yet
validationapi, servicetest
services-crm:modules/activities/tests/e2e/activities.e2e.spec.js#refuses a replace of a version it has moved on from: 409
02must prove
Proposed
A partial edit changes only named properties, clearing those explicitly set to empty and preserving the rest.
no proof recorded yet
policyapi, servicetest
services-crm:modules/activities/tests/e2e/activities.e2e.spec.js#leaves every property the patch omits as it was: duration, end, body, external id, owner and links
03must prove
Proposed
A complete replacement must include every required replacement property, and missing properties cause a field-specific refusal without a write.
no proof recorded yet
validationapitest
services-crm:modules/activities/tests/e2e/activities.e2e.spec.js#refuses a replacement missing a property: 400 naming it
04must prove
Proposed
Replacing activity links matches them by related record, preserving the existing link for each record retained in the set.
no proof recorded yet
policyservicetest
services-crm:modules/activities/tests/integration/services/persistence/activities.integration.spec.js#replaces the links as a set on update, keeping the row of a record still linked
05must prove
Proposed
An activity can retain its deactivated type or outcome during correction, but cannot switch to an inactive type.
no proof recorded yet
policyservicetest
06must prove
Confirmed
An update lock blocks edits, and a deletion lock or full lock blocks deletion.
no proof recorded yet
validationservicetest
07must prove
Proposed
Deleting an activity also deletes its links and attachment records, and another deletion reports it absent.
no proof recorded yet
lifecycleservice, databasetest
08must prove
Proposed
The corresponding activity permissions permit edits and deletion regardless of ownership; activity deletion is a user-tier permission, whereas contact deletion is an administrator-tier permission.
no proof recorded yet
permissionapiobserved
services-crm:aws/crm.service.ts:ActivitiesPermissions
09must prove
Proposed
Editing an activity preserves its original source classification.
no proof recorded yet
invariantservicetest
10
Confirmed
After an ambiguous edit response, the console reads the activity and reports success only if the saved values match the submitted change.
policyconsoletest
react-console:lib/activities/retry-safe-writes.test.ts#is saved when its answer is lost but the activity holds what was sent
11must prove
Proposed
Deleting an activity removes its import mappings, allowing a subsequent import of that source item to create a new activity.
no proof recorded yet
lifecycleserviceobserved

Scenarios

IdGivenWhenThenProvenance
01Two editors read the same call version.Save one correction and then submit the other editor’s correction.The later stale save is rejected and the first correction remains.test
02An integration prepares a meeting replacement.Omit duration from the complete replacement.The request names the missing duration and retains the earlier meeting.test

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.