Skip to content

CAP-CRM-ENT-012Review organization role compliance and prepare notices

Markdown

CAP-CRM-ENT-012

Review organization role compliance and prepare notices

Markdown
  • DocumentApproved
  • Product intentConfirmed
  • ImplementationObserved

KindCapabilityProduct areaCRMModuleEntitiesRevision1Approved byAndrewApproved at2026-10-22

Read atservices-crm 7ea48a41react-console da630758

The Formal Contract

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

Outcomes
Each organization retained to rules carries a status and the violations that explain it.A notice moves out exactly once per fall into non-compliance.An administrator can preview the notice and re-apply changed rules to the complete tenant.
Surfaces
consoleapijob
Intent sources
services-crm:docs/milestones/CRM-M2-affiliations-roles-compliance.plan.md#1. Objectiveservices-crm:docs/milestones/CRM-M2-affiliations-roles-compliance.plan.md#A7services-crm:docs/milestones/CRM-M1-contacts-and-organizations.plan.md#9. Acceptance scenarios

Controls

28 controls apply, from the corpus control catalogue.

TC-AVL-004 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-IAM-001 TC-IAM-005 TC-IAM-006 TC-LOG-004 TC-LOG-005 TC-MON-001 TC-MON-002 TC-PI-001 TC-PI-002 TC-PI-003 TC-PI-004 TC-PI-005 TC-PRV-001 TC-PRV-002 TC-TEN-001 TC-TEN-002 TC-TEN-003 TC-VEN-001 TC-VEN-003

Repositories Read

RepositoryPaths
undefined:modules/entities/
undefined:docs/entities-api.md
undefined:modules/entities/services/persistence/organization-types.ts
undefined:modules/entities/services/templates/compliance-notification-template.ts
undefined:modules/entities/tests/e2e/email-previews.e2e.spec.js
undefined:modules/entities/tests/e2e/organization-compliance.e2e.spec.js
undefined:modules/entities/tests/integration/services/email-previews/email-preview.integration.spec.js
undefined:modules/entities/tests/integration/services/organizations/compliance/compliance-change-events.integration.spec.js
undefined:modules/entities/tests/integration/services/organizations/compliance/compliance-reads.integration.spec.js
undefined:modules/entities/tests/integration/services/organizations/compliance/compliance-reprocess.integration.spec.js
undefined:modules/entities/tests/integration/services/organizations/compliance/organization-compliance.integration.spec.js
undefined:modules/entities/tests/integration/services/persistence/compliance-reprocesses.integration.spec.js
undefined:modules/entities/tests/integration/services/persistence/organization-attention-items.queries.integration.spec.js
undefined:modules/entities/tests/integration/services/templates/compliance-notification-template.integration.spec.js
undefined:app/(console)/console/[tenantId]/crm/contacts/
undefined:acceptance/crm/playwright/journeys/organizations/CRM-ACC-0122.spec.ts

Where It Lives

RepositoryRolePaths
services-crmownerservices-crm:modules/entities/
services-crm:docs/entities-api.md
services-crm:modules/entities/services/persistence/organization-types.ts
services-crm:modules/entities/services/templates/compliance-notification-template.ts
services-crm:modules/entities/tests/e2e/email-previews.e2e.spec.js
services-crm:modules/entities/tests/e2e/organization-compliance.e2e.spec.js
services-crm:modules/entities/tests/integration/services/email-previews/email-preview.integration.spec.js
services-crm:modules/entities/tests/integration/services/organizations/compliance/compliance-change-events.integration.spec.js
services-crm:modules/entities/tests/integration/services/organizations/compliance/compliance-reads.integration.spec.js
services-crm:modules/entities/tests/integration/services/organizations/compliance/compliance-reprocess.integration.spec.js
services-crm:modules/entities/tests/integration/services/organizations/compliance/organization-compliance.integration.spec.js
services-crm:modules/entities/tests/integration/services/persistence/compliance-reprocesses.integration.spec.js
services-crm:modules/entities/tests/integration/services/persistence/organization-attention-items.queries.integration.spec.js
services-crm:modules/entities/tests/integration/services/templates/compliance-notification-template.integration.spec.js
react-consoleconsolereact-console:app/(console)/console/[tenantId]/crm/contacts/
react-console:acceptance/crm/playwright/journeys/organizations/CRM-ACC-0122.spec.ts

Permissions

KeyChecked atScope
crm.organizations.updateapitenant
crm.organization-types.updateapitenant
crm.organizations.readservicetenant
crm.contacts.readservicetenant

Business Rules

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

IdRuleKindEnforced atProvenance
01must prove
Confirmed
Role compliance applies only through an existing organization type that enables it; other organizations begin without compliance data and lose prior status and violations on recalculation.
policyservicetest
02must prove
Confirmed
New organizations governed by minimum-role rules start out of compliance with a zero-holder violation for each minimum and send no notice on creation.
calculationservicetest
services-crm:modules/entities/tests/integration/services/organizations/compliance/organization-compliance.integration.spec.js#with a type that holds it to rules: not in compliance, every rule with a minimum violated (it has no contact yet)
03must prove
Confirmed
Compliance counts each contact once for each role effective on a current affiliation, primary or secondary, compares counts to minimum and maximum bounds including zero, and reports violations in rule order.
calculationservicetest
services-crm:modules/entities/tests/integration/services/organizations/compliance/organization-compliance.integration.spec.js#brings an organization into compliance for a role held on a current affiliation that is not primary
04must prove
Confirmed
Affiliation and role changes or contact deletion recalculate affected organizations from before and after the change when they have rules or existing status; the DISABLE_CONTACT_ROLE_COMPLIANCE_CHECK notes marker suppresses save reactions but not deletion reactions.
lifecycleservicetest
services-crm:modules/entities/tests/integration/services/organizations/compliance/compliance-change-events.integration.spec.js#a contact saved with the notes DISABLE_CONTACT_ROLE_COMPLIANCE_CHECK: nothing (its delete still records)
05must prove
Confirmed
Compliance writes status, violations and version only when violations differ and serializes recalculation per organization, so duplicate or delayed events do not create redundant saves.
invariantservice, databasetest
services-crm:modules/entities/tests/integration/services/organizations/compliance/organization-compliance.integration.spec.js#writes nothing for a duplicate delivery, or a second run on an unchanged organization
06must prove
Confirmed
Changing type rules or an organization’s type leaves compliance unchanged until a contact reaction, date reconciliation or reprocess reaches it, and organization writes ignore supplied compliance status and violations.
policyservice, apitest
07must prove
Confirmed
A notifying type submits one transactionally deduplicated notice when an organization enters not in compliance, using its written version as part of the key; rollback, repeated delivery, continuing noncompliance and return to compliance do not submit another notice.
lifecycleservice, databasetest
services-crm:modules/entities/tests/integration/services/organizations/compliance/organization-compliance.integration.spec.js#is not submitted again while the organization stays out of compliance, nor for a type that does not notify
08must prove
Confirmed
Compliance recipients are current affiliates with primary e-mail addresses and a configured notification role, or all current affiliates when no notification roles are selected, with at most 500 recipients per request.
calculationservicetest
services-crm:modules/entities/tests/integration/services/organizations/compliance/compliance-reads.integration.spec.js#leaves out the contact whose addresses sit past the primary slot, no secondary address standing in
09must prove
Confirmed
Compliance mail uses the organization type’s Platform-owned template, and a missing template blocks delivery.
policyservicedocumented
services-crm:docs/entities-api.md#`compliance_notification_template`: the e-mail the type sends
10must prove
Confirmed
Organization update permission allows tenant-wide compliance reprocessing with one running request per tenant, resumable batches, retryable failures and final failure only on the last delivery with record details redacted.
lifecycleapi, servicetest
11must prove
Confirmed
Draft notice previews require organization-type update and both record read permissions, use an actually affiliated contact and organization, store and send nothing, identify sample violations when needed and return template problems as preview results.
permissionapi, servicetest
services-crm:modules/entities/tests/e2e/email-previews.e2e.spec.js#answers 403 to a caller who may administer types but may not read the records the answer contains
12must prove
Confirmed
A compliance test send uses one selected template or typed draft for one contact, sends through Platform to the administrator’s specified address and reports delivery or refusal.
policyapi, servicetest
services-crm:modules/entities/tests/e2e/organization-compliance.e2e.spec.js#answers 400 for a template both named and typed in, or neither
13must prove
Confirmed
Organization type saves remove rules with a falsy minimum and absent maximum, retain maximum zero, reject unknown rule roles and require lists or nonempty compliance options when their corresponding restriction or compliance switch is enabled.
validationapi, serviceobserved
14
Confirmed
Out-of-compliance organizations appear as attention items with their violations and the time noncompliance began.
policyservicetest
15must prove
Confirmed
A compliance-template change merges specified fields or clears the template independently of other organization-type values.
lifecycleserviceobserved
16must prove
Confirmed
Invalid template content prevents a type change; a later template persistence failure compensates a committed type create by deleting it or restores an existing type’s content through another versioned save.
lifecycleserviceobserved
17must prove
Confirmed
Organization type deletion commits before template archival, and failed archival is logged without recreating the type.
lifecycleservicetest
services-crm:modules/entities/tests/integration/services/templates/compliance-notification-template.integration.spec.js#keeps the delete and logs the type id when Platform cannot clear it: the type is gone either way

Scenarios

IdGivenWhenThenProvenance
01Bayview Guild's type requires one Billing Contact.Daniel joins with the Billing Contact role, then the role ends.Bayview moves into compliance, then out, and the notice moves out once.test
02A type's minimum is raised.The administrator reprocesses compliance.Every organization of the type is recalculated in batches and the run completes.test
services-crm:modules/entities/tests/integration/services/organizations/compliance/compliance-reprocess.integration.spec.js#answers the run completed once the following batches reach the end, every organization counted

Edge Cases

IdGivenWhenThenProvenance
03A compliant chapter.The administrator previews its notice.The preview uses example violations and says the violations are sample data.test
services-crm:modules/entities/tests/integration/services/email-previews/email-preview.integration.spec.js#is previewed with the purpose contract’s example violations, and says so in sample_data

Decision History

Product decisions recorded in this module's findings that bear on this specification, as recorded.

  1. OQ-CRM-ENT-003DecisionAndrew2026-10-22

    B: a rule's product intent is derived from its origin: an origin that names a product decision (a milestone decision id or an answered open question) makes the rule confirmed; otherwise the rule inherits its capability's intent. No rule-level field.

    Applied to: Structured decision update record

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.