Skip to content

ATS-CRM-ENT-011Maintain responsibilities on organizational relationships

Markdown

ATS-CRM-ENT-011

Maintain responsibilities on organizational relationships

Markdown
  • DocumentProposed

KindAcceptance test setProduct areaCRMModuleEntitiesRevision1

Read atservices-crm a8d1364freact-console baf6dae3

Coverage

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

Test Scenarios

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

01 Roles name the workspace’s roles and lie within the affiliationvalidationapinegativetest
Proves
BR-CAP-CRM-ENT-011-01 BR-CAP-CRM-ENT-011-02 INV-DOM-CRM-ENT-003-08
Preconditions
Prepare an affiliation from 2024-01-01.
Steps
Add a role starting 2023-12-01; a role id the workspace lacks; shorten the affiliation under a dated role.
Expected
400 naming the field; rejected; rejected at commit.
Data
No additional fixtures.
Bound to
Source
services-crm:modules/entities/tests/unit/services/persistence/contact-affiliations.spec.js#refuses a role whose dates lie outside its affiliation's
02 No role overlaps itself; 25 per affiliationboundarybrowsernegativetest
Proves
BR-CAP-CRM-ENT-011-03 INV-DOM-CRM-ENT-003-07
Preconditions
Prepare an affiliation.
Steps
Add Billing twice in overlapping periods; in separate periods; add 26 roles.
Expected
Rejected; accepted; rejected at 26.
Data
No additional fixtures.
Bound to
Source
services-crm:modules/entities/tests/unit/services/persistence/contact-affiliations.spec.js#refuses the same role overlapping itself on one affiliation
03 Ending a affiliation ends its open rolestransitionapitest
Proves
BR-CAP-CRM-ENT-011-04
Preconditions
Prepare a affiliation with an undated role.
Steps
Patch the affiliation's end date.
Expected
The role ends the same day.
Data
No additional fixtures.
Bound to
Source
services-crm:modules/entities/tests/e2e/contact-affiliations.e2e.spec.js#ends the open roles of the ended affiliation the same day
04 Restricted types refuse other roles; unmodified roles not re-checkedvalidationbrowsernegativetest
Proves
BR-CAP-CRM-ENT-011-05
Preconditions
Prepare an organization whose type allows three roles.
Steps
Add an allowed role; a forbidden one new, added and changed; re-save a role stored before the restriction.
Expected
Accepted; rejected naming role, type and allowed list; accepted.
Data
No additional fixtures.
Bound to
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
05 Joining gives automatic and first-contact rolesrulebrowsertest
Proves
BR-CAP-CRM-ENT-011-06
Preconditions
Prepare automatic and first-contact roles; an empty company.
Steps
Create two contacts joining it; Make Primary on an existing affiliation; save with the primary unmodified.
Expected
First gets both, second only automatic; roles on the affiliation made primary; nothing.
Data
No additional fixtures.
Bound to
Source
services-crm:modules/entities/tests/integration/services/contacts/role-assignment/contact-role-assignment.integration.spec.js#gives the organization's first contact the automatic and first-contact roles, besides the roles it states
06 Future affiliations get their roles on the start day, corrections followedtransitionapitest
Proves
BR-CAP-CRM-ENT-011-07
Preconditions
Prepare a affiliation starting tomorrow in the workspace’s calendar.
Steps
Reconcile on the eve and on the day; correct the start earlier, later; end it before the day.
Expected
Nothing on the eve; roles on the day; roles in the correcting save; on the new day; nothing.
Data
No additional fixtures.
Bound to
Source
services-crm:modules/entities/tests/integration/services/contacts/role-assignment/automatic-role-reconciliation.integration.spec.js#gives the automatic and first-contact roles on the start day in the tenant calendar
07 Automatic roles only add and are never given backedgeapitest
Proves
BR-CAP-CRM-ENT-011-08 INV-DOM-CRM-ENT-003-10
Preconditions
Prepare a affiliation given automatic roles.
Steps
End the affiliation; remove a role then reconcile; lock the contact.
Expected
Roles end with it; not given back; nothing while locked.
Data
No additional fixtures.
Bound to
Source
services-crm:modules/entities/tests/integration/services/contacts/role-assignment/automatic-role-reconciliation.integration.spec.js#does not give back a role a person removed after it was given
08 Inactive and deceased contacts get no automatic rolesedgebrowsertest
Proves
BR-CAP-CRM-ENT-011-09
Preconditions
Prepare automatic roles.
Steps
Create inactive and deceased contacts with a primary; make one inactive in the moving save; reconcile a deceased contact's due affiliation.
Expected
No roles; preserved roles; still counted as belonging.
Data
No additional fixtures.
Bound to
Source
services-crm:modules/entities/tests/integration/services/contacts/role-assignment/contact-role-assignment.integration.spec.js#counts an inactive contact as already belonging to the organization, so the next contact is not its first
09 the restriction wins over the automatic flaginteractionapitest
Proves
BR-CAP-CRM-ENT-011-10
Preconditions
Prepare a restricting type and an automatic role it does not allow.
Steps
Save a primary affiliation there; reconcile a due affiliation there.
Expected
The role skipped at save and on the day, reported as not allowed.
Data
No additional fixtures.
Bound to
Source
services-crm:modules/entities/tests/integration/services/affiliations/affiliation-date-reconciliation.follow-ups.integration.spec.js#skips the forbidden role on the start day
10 Re-joining gives the automatic roles againtransitionapiproposed
Proves
BR-CAP-CRM-ENT-011-11
Preconditions
Prepare a person who retained the automatic roles on an ended affiliation at Acme.
Steps
Make Acme their primary organization again on a new affiliation.
Expected
The new affiliation holds the automatic roles; the old affiliation preserves its ended roles.
Data
No additional fixtures.
Source
services-crm:modules/entities/services/contacts/role-assignment/contact-role-assignment.ts:automaticRolesDecidedFor
11 One first contact among simultaneous joinersconcurrencyapitest
Proves
BR-CAP-CRM-ENT-011-12 INV-DOM-CRM-ENT-003-11
Preconditions
Prepare an empty organization with a first-contact role.
Steps
Several contacts join at once.
Expected
Exactly one holds the first-contact role.
Data
No additional fixtures.
Bound to
Source
services-crm:modules/entities/tests/integration/services/contacts/role-assignment/contact-role-assignment.integration.spec.js#gives the first-contact roles to exactly one of several contacts joining an empty organization at once
12 Refuse an unknown role without changing the affiliationfailureapinegativeproposed
Proves
BR-CAP-CRM-ENT-011-01 BR-CAP-CRM-ENT-009-02
Preconditions
A person has a current affiliation and a known role period.
Steps
Add a role identifier absent from the workspace while changing the affiliation title.
Expected
The complete save is refused; the known role and original title remain.
Data
Run-owned records and configuration in an isolated workspace.
Source
services-crm:modules/entities/services/persistence/contact-affiliations.ts:affiliationRefusal
13 End a primary tie and its open responsibility periodinteractionapiproposed
Proves
BR-CAP-CRM-ENT-009-06 BR-CAP-CRM-ENT-011-04
Preconditions
A person’s primary affiliation has an open role period.
Steps
Save an end date for that affiliation; read the relationship and role periods.
Expected
Primary designation clears and the open role ends with the affiliation without promoting another tie.
Data
Run-owned records and configuration in an isolated workspace.
Source
services-crm:modules/entities/tests/integration/services/persistence/contact-affiliations.integration.spec.js#makes nothing primary in its place; services-crm:modules/entities/tests/unit/services/persistence/contact-affiliations.spec.js#ends the open roles of an affiliation the save ends, on the same day
14 Due dates settle automatic responsibilitiesinteractionapiproposed
Proves
BR-CAP-CRM-ENT-010-05 BR-CAP-CRM-ENT-011-07
Preconditions
A future affiliation has an eligible active automatic role.
Steps
Reconcile before the local start day, then on that day and once again.
Expected
No role is assigned early; the due pass assigns it and the repeated pass adds no duplicate.
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/contacts/role-assignment/automatic-role-reconciliation.integration.spec.js#gives the automatic and first-contact roles on the start day in the tenant calendar
15 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
16 Automatic assignment creates a catalogue dependencyinteractionapiproposed
Proves
BR-CAP-CRM-ENT-011-06 BR-CAP-CRM-ENT-017-03
Preconditions
An active catalogue role is automatic and has no holder yet.
Steps
Join an eligible person as primary; try deleting the assigned role.
Expected
The new affiliation holds the role and deletion is refused while that role period remains.
Data
Run-owned records and configuration in an isolated workspace.
Source
services-crm:modules/entities/tests/integration/services/contacts/role-assignment/contact-role-assignment.integration.spec.js#gives the organization's first contact the automatic and first-contact roles, besides the roles it states; services-crm:modules/entities/tests/integration/services/persistence/contact-roles.integration.spec.js#refuses it with the legacy words, naming the organization types whose rules depend on it
17 Exercise every declared authority independentlypermissionapinegativeproposed
Proves
BR-CAP-CRM-ENT-003-07 BR-CAP-CRM-ENT-003-09
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.