Skip to content

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

Markdown

ATS-CRM-ENT-012

Review organization role compliance and prepare notices

Markdown
  • DocumentProposed

Planning

Proves capability
CAP-CRM-ENT-012

Design

Executed by
TST-CRM-ENT-775, TST-CRM-ENT-786, TST-CRM-ENT-787

KindAcceptance test setProduct areaCRMModuleEntitiesRevision1

Read atservices-crm a8d1364freact-console baf6dae3

Coverage

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

Test Scenarios

25 scenarios proving CAP-CRM-ENT-012; 15 bound to an existing test.

01 Only types with rules compute complianceedgeapinegativetest
Proves
BR-CAP-CRM-ENT-012-01 INV-DOM-CRM-ENT-002-07
Preconditions
Prepare types with and without rules.
Steps
Create organizations of each and none; recalculate one whose type lost its rules.
Expected
Status only for the first; cleared for the last.
Data
No additional fixtures.
Bound to
Source
services-crm:modules/entities/tests/integration/services/organizations/compliance/organization-compliance.integration.spec.js#with a type that holds it to no rule, or with no type: no status and no violations
02 a new organization violates every minimumtransitionbrowsertest
Proves
BR-CAP-CRM-ENT-012-02
Preconditions
Prepare a type requiring one Billing Contact; one with only a maximum.
Steps
Create an organization of each.
Expected
Not in compliance with too few 0; in compliance.
Data
No additional fixtures.
Bound to
Source
services-crm:modules/entities/tests/e2e/organization-compliance.e2e.spec.js#answer the computed status and violations of an organization created with a compliance type
03 Counting roles in effect, too few and too manyinteractionapitest
Proves
BR-CAP-CRM-ENT-012-03
Preconditions
Prepare rules with minimum and maximum.
Steps
Give the role on a non-primary current affiliation; end the affiliation; end the role; exceed the maximum.
Expected
In; out; out; too many.
Data
No additional fixtures.
Bound to
Source
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
04 Which contact changes recalculate which organizationsinteractionapitest
Proves
BR-CAP-CRM-ENT-012-04
Preconditions
Prepare contacts tied to organizations retained to rules.
Steps
Save without affiliation changes; with the escape-hatch notes; add, end and remove affiliations and roles; delete a contact tied to two.
Expected
Nothing; nothing; the organization named; both.
Data
No additional fixtures.
Bound to
Source
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)
05 Writes only on change, serialisedconcurrencyapitest
Proves
BR-CAP-CRM-ENT-012-05
Preconditions
Prepare an organization out of compliance.
Steps
Deliver the same event twice; run two recalculations at once.
Expected
No second write; one writes, the other finds nothing.
Data
No additional fixtures.
Bound to
Source
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
06 Rule and type changes wait for a reprocess; sent status ignoredrulebrowsertest
Proves
BR-CAP-CRM-ENT-012-06 INV-DOM-CRM-ENT-002-06
Preconditions
Prepare an organization of a type whose minimum is raised.
Steps
Save the type; read the organization; PUT the organization with another status; reprocess.
Expected
Status unmodified until the reprocess; the PUT's status ignored.
Data
No additional fixtures.
Bound to
Source
react-console:acceptance/crm/playwright/journeys/organizations/CRM-ACC-0124.spec.ts#CRM-ACC-0124
07 One notice per fall, in the transactioninvariantapitest
Proves
BR-CAP-CRM-ENT-012-07 INV-DOM-CRM-ENT-002-08
Preconditions
Prepare a notifying type.
Steps
Take the organization out of compliance; recalculate unmodified; add a violation while out; roll back a recalculation.
Expected
One request; none; none; none.
Data
No additional fixtures.
Bound to
Source
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
08 Recipients: notification-role holders with a primary e-mailruleapitest
Proves
BR-CAP-CRM-ENT-012-08
Preconditions
Prepare contacts with a primary address, only a secondary, none.
Steps
Compose the recipients.
Expected
Only the one with a primary address, in contact id order.
Data
No additional fixtures.
Bound to
Source
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
09 No template, nobody e-mailedfailurebrowsernegativetest
Proves
BR-CAP-CRM-ENT-012-09
Preconditions
Prepare a notifying type that owns no template.
Steps
Take an organization of it out of compliance.
Expected
The notice is blocked for configuration and no mail moves out.
Data
No additional fixtures.
Bound to
Source
react-console:acceptance/crm/playwright/journeys/organizations/CRM-ACC-0123.spec.ts#CRM-ACC-0123
10 Reprocess: one run per workspace, batches, failurestransitionapinegativetest
Proves
BR-CAP-CRM-ENT-012-10 INV-DOM-CRM-ENT-002-09
Preconditions
Prepare a workspace with organizations.
Steps
Start a run; start another; run the batches; fail a batch then its last delivery.
Expected
The legacy message and one run; rejected second; completed; failed only on the last receive with a redacted reason.
Data
No additional fixtures.
Bound to
Source
services-crm:modules/entities/tests/integration/services/persistence/compliance-reprocesses.integration.spec.js#refuses a second running run for the tenant
11 Preview: keys, linked contact, sample data, problems as returnspermissionapinegativetest
Proves
BR-CAP-CRM-ENT-012-11
Preconditions
Prepare an organization and contacts tied and not tied to it.
Steps
Preview as an administrator with and without the read keys; for a contact not tied; with a broken template; for a compliant organization.
Expected
403 without either read key; 400; 200 with problems; sample violations named.
Data
No additional fixtures.
Bound to
Source
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
12 Test sendruleapinegativetest
Proves
BR-CAP-CRM-ENT-012-12
Preconditions
Prepare a template and an organization.
Steps
Send a typed draft to an address; send with both a named and a typed template; without a subject; for an unknown contact.
Expected
Sent with its message id; 400; 400; 404.
Data
Use platform test send in dev.
Bound to
Source
services-crm:modules/entities/tests/e2e/organization-compliance.e2e.spec.js#answers 400 for a template both named and typed in, or neither
13 Type rules are cleaned and validatedvalidationapinegativetest
Proves
BR-CAP-CRM-ENT-012-13 INV-DOM-CRM-ENT-002-11
Preconditions
No additional setup is required.
Steps
Save a type with a rule with neither bound, a rule of an unknown role, a notify switch without its list.
Expected
The rule dropped; 409 and nothing saved; 400 naming the field.
Data
No additional fixtures.
Bound to
Source
services-crm:modules/entities/tests/e2e/organization-types.e2e.spec.js#answers 409 for a rule of a role the tenant does not have, and saves nothing
14 Compliance template partial changeruleapitest
Proves
BR-CAP-CRM-ENT-012-15
Preconditions
Prepare an organization type and a controllable Platform template service.
Steps
Change only one template property, omit the template on another save, then clear it.
Expected
Unmentioned template properties remain, omission leaves the template unmodified, and clearing removes the active template.
Data
Use a type with a published compliance template.
Bound to
Source
services-crm:modules/entities/services/templates/compliance-notification-template.ts:effectiveTemplateChange
15 Compliance template failure compensationfailureapinegativeproposed
Proves
BR-CAP-CRM-ENT-012-16
Preconditions
Prepare an organization type and a controllable Platform template service.
Steps
Submit invalid template content, then simulate an unavailable template service during a valid create and update.
Expected
Invalid content causes no type change; a failed create leaves no type, and a failed update restores content but advances the type version.
Data
Use a type with a published compliance template.
Source
services-crm:modules/entities/services/persistence/organization-types.ts:updateOrganizationType
16 Compliance template cleanup after deletiontransitionapinegativetest
Proves
BR-CAP-CRM-ENT-012-17
Preconditions
Prepare an organization type and a controllable Platform template service.
Steps
Delete a type with a template, once with Platform available and once while template archival fails.
Expected
The successful cleanup archives the template; failed cleanup logs the type id and leaves the type deleted.
Data
Use a type with a published compliance template.
Bound to
Source
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
17 Distinguish empty notice-role selection from all affiliatesedgeapinegativeproposed
Proves
BR-CAP-CRM-ENT-012-08
Preconditions
A notifying type has an explicitly empty notification-role selection and the organization has an eligible affiliate with a primary email.
Steps
Enter noncompliance and inspect composed recipients and communication submissions.
Expected
The pinned implementation composes no recipients and submits no notice; the planning rule’s all-affiliate fallback remains contradicted.
Data
Run-owned records and configuration in an isolated workspace.
Source
services-crm:modules/entities/services/organizations/compliance/contact-role-compliance.ts:contactsToNotify; FND-CRM-ENT-043
18 A terminal failed reprocess cannot resume through redeliveryinvariantapiproposed
Proves
BR-CAP-CRM-ENT-012-10
Preconditions
A compliance reprocess is terminally failed after exhausting retries.
Steps
Redeliver its message, then request a fresh run.
Expected
The failed run stays terminal; recovery begins with a distinct run rather than resuming the old one.
Data
Run-owned records and configuration in an isolated workspace.
Source
services-crm:modules/entities/services/organizations/compliance/compliance-reprocess.ts:runComplianceReprocess; rhythm-v2-docs:specs/crm/entities/design/state-models/STATE-CRM-ENT-004-compliance-reprocess-run.md:invalid
19 Establish a body under role policyinteractionapiproposed
Proves
BR-CAP-CRM-ENT-002-04 BR-CAP-CRM-ENT-012-02
Preconditions
An organization classification requires one holder of a selected role.
Steps
Create an organization using that classification and read its initial compliance.
Expected
The new organization has the initial zero-holder violation and creation submits no notice.
Data
Run-owned records and configuration in an isolated workspace.
Source
services-crm:modules/entities/tests/e2e/organization-types.e2e.spec.js#refuses an organization of a type the tenant does not have (409), and the delete of a type an organization has (409); 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)
20 A role change reaches organization coverage after commitinteractionapiproposed
Proves
BR-CAP-CRM-ENT-009-02 BR-CAP-CRM-ENT-012-04
Preconditions
A current affiliation belongs to an organization with a minimum-role policy.
Steps
Add the missing role through the person save; process its committed compliance reaction and read the organization.
Expected
The person retains the role and the organization’s recalculated coverage reflects that effective holder.
Data
Run-owned records and configuration in an isolated workspace.
Source
react-console:acceptance/crm/playwright/journeys/affiliations/CRM-ACC-0202.spec.ts#CRM-ACC-0202; 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)
21 An expired role changes organizational coverageinteractionapiproposed
Proves
BR-CAP-CRM-ENT-010-05 BR-CAP-CRM-ENT-012-03
Preconditions
An organization meets its minimum through a role ending today.
Steps
Read coverage on the inclusive end day; reconcile the next local day and reread coverage.
Expected
Coverage remains satisfied through the last day and becomes deficient after the ended role no longer counts.
Data
Run-owned records and configuration in an isolated workspace.
Source
services-crm:modules/entities/tests/integration/services/affiliations/affiliation-date-reconciliation.integration.spec.js#takes the organization out of compliance the next morning, with no save of the contact; 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
22 Allowed responsibility satisfies organizational policyinteractionapiproposed
Proves
BR-CAP-CRM-ENT-011-05 BR-CAP-CRM-ENT-012-03
Preconditions
A governed organization allows a required role on a current affiliation.
Steps
Assign that role through the person and recalculate the organization.
Expected
The allowed assignment persists and its effective holder satisfies the configured minimum.
Data
Run-owned records and configuration in an isolated workspace.
Source
services-crm:modules/entities/tests/integration/services/persistence/contact-affiliations.integration.spec.js#refuses a role outside the list added to an existing affiliation; 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
23 Policy editing takes effect when reprocessing reaches the bodyinteractionapiproposed
Proves
BR-CAP-CRM-ENT-012-06 BR-CAP-CRM-ENT-018-07
Preconditions
An existing organization is compliant under its classification’s old policy.
Steps
Increase the minimum in the classification; read the body, request reprocessing and read it after settlement.
Expected
The first read retains stored coverage; settled reprocessing records the new deficient coverage.
Data
Run-owned records and configuration in an isolated workspace.
Source
services-crm:modules/entities/tests/e2e/organization-compliance.e2e.spec.js#keep them against a PUT that sends others back; services-crm:modules/entities/tests/e2e/contact-types.e2e.spec.js#then, when the version is off, refuses the change (409)
24 Recalculate through every policy statetransitionapiproposed
Proves
BR-CAP-CRM-ENT-012-01 BR-CAP-CRM-ENT-012-03 BR-CAP-CRM-ENT-012-05 BR-CAP-CRM-ENT-012-06 BR-CAP-CRM-ENT-012-07
Preconditions
Two initially ungoverned organizations have controlled role-holder fixtures.
Steps
Enable a minimum policy; recalculate one with a holder and one without. Remove and restore the holder; change the deficiency while still deficient; disable policy on a satisfied and a deficient organization and recalculate both.
Expected
The reads distinguish newly satisfied, newly deficient, changing deficiency and cleared policy state. Unchanged recalculation contributes no additional version and notice submissions follow the transition contract.
Data
Run-owned records and configuration in an isolated workspace.
Source
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); services-crm:modules/entities/services/organizations/compliance/organization-compliance.ts:recalculateOrganizationCompliance; 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; 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; services-crm:modules/entities/services/organizations/compliance/organization-compliance.ts:recalculateOrganizationCompliance; services-crm:modules/entities/tests/integration/services/organizations/compliance/organization-compliance.integration.spec.js#with a type that holds it to no rule, or with no type: no status and no violations; services-crm:modules/entities/tests/integration/services/organizations/compliance/organization-compliance.integration.spec.js#with a type that holds it to no rule, or with no type: no status and no violations
25 Exercise every declared authority independentlypermissionapinegativeproposed
Proves
BR-CAP-CRM-ENT-012-11
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.