Skip to content

ATS-CRM-ENT-009Maintain a person’s organizational relationships

Markdown

ATS-CRM-ENT-009

Maintain a person’s 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 covered
  • Interaction covered

Test Scenarios

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

01 an affiliation needs the workspace’s organization and typefailureapinegativetest
Proves
BR-CAP-CRM-ENT-009-01 INV-DOM-CRM-ENT-003-01
Preconditions
No additional setup is required.
Steps
Create a contact with an affiliation to an organization the workspace lacks.
Expected
400; no contact saved.
Data
No additional fixtures.
Bound to
Source
services-crm:modules/entities/tests/e2e/contact-affiliations.e2e.spec.js#answers 400 for an organization the tenant does not have
02 Affiliations are written only through the contactinteractionbrowsertest
Proves
BR-CAP-CRM-ENT-009-02
Preconditions
Prepare an organization with people.
Steps
Add Person, Edit and End from the organization's Contacts tab; look for an organization-side write route.
Expected
Each writes the person’s record; none exists.
Data
No additional fixtures.
Bound to
Source
react-console:acceptance/crm/playwright/journeys/affiliations/CRM-ACC-0202.spec.ts#CRM-ACC-0202
03 Omitted affiliations are unmodified; an explicit list is the collectionedgebrowsernegativetest
Proves
BR-CAP-CRM-ENT-009-03
Preconditions
Prepare a contact with two affiliations.
Steps
Replace without affiliations; replace with an empty list; replace with affiliations without ids matching the stored ones.
Expected
Unmodified; removed; matched, not duplicated.
Data
No additional fixtures.
Bound to
Source
react-console:acceptance/crm/playwright/journeys/affiliations/CRM-ACC-0177.spec.ts#CRM-ACC-0177
04 One primary; Make Primary unmarks the oldinvariantapinegativetest
Proves
BR-CAP-CRM-ENT-009-04 INV-DOM-CRM-ENT-003-02
Preconditions
Prepare acme primary, Globex current.
Steps
Mark Globex primary; mark two non-primaries primary.
Expected
Globex primary, Acme current; rejected.
Data
No additional fixtures.
Bound to
Source
services-crm:modules/entities/tests/unit/services/persistence/contact-affiliations.spec.js#refuses two affiliations newly marked primary at once
05 a primary is open-ended and has startedvalidationbrowsernegativetest
Proves
BR-CAP-CRM-ENT-009-05
Preconditions
No additional setup is required.
Steps
Save a primary with an end date; one starting tomorrow.
Expected
Rejected each, naming the field.
Data
No additional fixtures.
Bound to
Source
services-crm:modules/entities/tests/unit/services/persistence/contact-affiliations.spec.js#refuses a primary affiliation that starts after today
06 Ending the primary promotes nothingtransitionbrowsertest
Proves
BR-CAP-CRM-ENT-009-06
Preconditions
Prepare acme primary, Globex open.
Steps
Give the primary affiliation an end date equal to the workspace’s current day; read it that day and on the following day.
Expected
Primary designation clears immediately and no replacement is selected. The affiliation remains current on its inclusive end day and reads as past the next day.
Data
No additional fixtures.
Bound to
Source
services-crm:modules/entities/tests/integration/services/persistence/contact-affiliations.integration.spec.js#makes nothing primary in its place
07 Dates are ordered and inclusiveboundarybrowsernegativetest
Proves
BR-CAP-CRM-ENT-009-07 INV-DOM-CRM-ENT-003-04
Preconditions
No additional setup is required.
Steps
Save an affiliation ending before it starts; a one-day affiliation.
Expected
Rejected; accepted and current that day.
Data
No additional fixtures.
Bound to
Source
services-crm:modules/entities/tests/integration/services/persistence/contacts.integration.spec.js#refuses an affiliation that ends before it starts
08 No overlapping affiliations of one type at one organizationinvariantbrowsernegativetest
Proves
BR-CAP-CRM-ENT-009-08 INV-DOM-CRM-ENT-003-03
Preconditions
Prepare employer at Acme 2019-2021.
Steps
Add Employer at Acme from 2021-12-31; from 2024; Board Member at Acme overlapping.
Expected
Rejected; accepted; accepted.
Data
No additional fixtures.
Bound to
Source
services-crm:modules/entities/tests/unit/services/persistence/contact-affiliations.spec.js#refuses two overlapping affiliations to the same organization of the same type
09 an affiliation's organization never changesvalidationbrowsernegativetest
Proves
BR-CAP-CRM-ENT-009-09 INV-DOM-CRM-ENT-003-05
Preconditions
Prepare an existing affiliation.
Steps
Send it with another organization; use the editor.
Expected
Rejected; the editor offers End and Add Another.
Data
No additional fixtures.
Bound to
Source
services-crm:modules/entities/tests/integration/services/persistence/contacts.integration.spec.js#refuses to move the affiliation to another organization under the same id (docs/affiliations/README.md §0b.2)
10 At most 100 current and upcoming affiliationsboundaryunitnegativetest
Proves
BR-CAP-CRM-ENT-009-10 INV-DOM-CRM-ENT-003-06
Preconditions
Prepare a contact with 100 ended affiliations.
Steps
Add one current affiliation; then 101 current affiliations.
Expected
Accepted; rejected.
Data
No additional fixtures.
Bound to
Source
services-crm:modules/entities/tests/unit/services/persistence/contact-affiliations.spec.js#counts only current and upcoming affiliations against the limit: ended history is unlimited (M2-D5)
11 the Organization field commandruleapinegativetest
Proves
BR-CAP-CRM-ENT-009-11
Preconditions
Prepare contacts with and without a primary.
Steps
Pick Acme; change to Globex with end and keep; backdate; clear; change on the day the primary started; effective date tomorrow.
Expected
Primary of the default type from today; old ended yesterday or preserved; old ends the day before; none; removed; 400.
Data
No additional fixtures.
Bound to
Source
services-crm:modules/entities/tests/e2e/contact-affiliations.e2e.spec.js#ends the previous primary affiliation yesterday by default ('end'), no longer primary and now past
12 Did they leave?transitionbrowsernegativeproposed
Proves
BR-CAP-CRM-ENT-009-12
Preconditions
Prepare a person primary at Harbor.
Steps
Add Bayview as primary and answer Yes; repeat answering No; Make Primary on an existing affiliation.
Expected
The old affiliation ends the day before the new start, or on its own start date if later; choosing to stay preserves it current, and Make Primary asks no question.
Data
Use two organizations.
Source
react-console:lib/affiliations/section.ts:affiliationBeingLeft
13 Job title follows the primary both waysinteractionbrowsertest
Proves
BR-CAP-CRM-ENT-009-13 INV-DOM-CRM-ENT-003-09
Preconditions
Prepare a contact with a primary affiliation.
Steps
Change the contact's title; change the primary's title; add a primary with no title.
Expected
Each side takes the other's; the new primary takes the contact's.
Data
No additional fixtures.
Bound to
Source
services-crm:modules/entities/tests/unit/services/persistence/contact-affiliations.spec.js#gives the contact the primary affiliation's job title when the save changed only the affiliation's
14 Client affiliation ids are lowercase UUIDv7 and uniquevalidationbrowsernegativetest
Proves
BR-CAP-CRM-ENT-009-14
Preconditions
No additional setup is required.
Steps
Send a lowercase UUIDv7, an uppercase one, a UUIDv4, a used id and one id twice.
Expected
Accepted; rejected for each other case.
Data
No additional fixtures.
Bound to
Source
react-console:acceptance/crm/playwright/journeys/affiliations/CRM-ACC-0208.spec.ts#CRM-ACC-0208
15 the organization's people listpermissionbrowsernegativetest
Proves
BR-CAP-CRM-ENT-009-15
Preconditions
Prepare an organization with current, ended and upcoming affiliations.
Steps
List by default, past, future, all, as_of, by type, by role, paged; as an organizations-only reader.
Expected
Each filter as named with totals; 403 permission_missing.
Data
No additional fixtures.
Bound to
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
16 the journey: record an employer and move to a new primaryinteractionbrowsertest
Proves
AS-JNY-CRM-ENT-002-01 AS-JNY-CRM-ENT-002-02 AS-JNY-CRM-ENT-002-03
Preconditions
Prepare two organizations with an Employer type and default links.
Steps
Run JNY-CRM-ENT-002.
Expected
One primary at the new employer; the old affiliation history with ended roles, listed under Past; only ticked links made.
Data
Use organizations, roles and default links.
Bound to
Source
react-console:acceptance/crm/playwright/journeys/affiliations/CRM-ACC-0201.spec.ts#CRM-ACC-0201
17 Preserve the first relationship correction when edits competeconcurrencyapinegativeproposed
Proves
BR-CAP-CRM-ENT-009-02 BR-CAP-CRM-ENT-004-01
Preconditions
Two editors read one person with a current affiliation.
Steps
Save a title correction from the first editor; submit a different relationship correction from the second at the old person version.
Expected
The second save conflicts and the first relationship correction remains stored.
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
18 Find a person through a secondary tieinteractionapiproposed
Proves
BR-CAP-CRM-ENT-003-03 BR-CAP-CRM-ENT-009-04
Preconditions
A person has a primary tie to one organization and a current secondary tie to another.
Steps
Filter people by the secondary organization and open the matching person.
Expected
The person appears once through that current secondary tie while retaining the separate primary designation.
Data
Run-owned records and configuration in an isolated workspace.
Source
services-crm:modules/entities/tests/integration/services/persistence/contacts.queries.integration.spec.js#answers a contact whose affiliation to the organization is not its primary one; services-crm:modules/entities/tests/unit/services/persistence/contact-affiliations.spec.js#refuses two affiliations newly marked primary at once
19 Relationship edits invalidate an open contact editinteractionapiproposed
Proves
BR-CAP-CRM-ENT-004-01 BR-CAP-CRM-ENT-009-02
Preconditions
Two editors read the same person; one uses the organization people workflow.
Steps
Save an affiliation correction from the organization, then submit the original contact edit at its old version.
Expected
The second editor receives a conflict and the relationship correction remains.
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; react-console:acceptance/crm/playwright/journeys/affiliations/CRM-ACC-0202.spec.ts#CRM-ACC-0202
20 Remove a relationship and resolve its dependent details togetherinteractionapiproposed
Proves
BR-CAP-CRM-ENT-006-10 BR-CAP-CRM-ENT-009-02
Preconditions
A person has one affiliation supplying a linked address and phone.
Steps
Try removing only the affiliation; then remove it while copying the address and removing the phone.
Expected
The incomplete removal changes nothing; the complete save removes the tie and handles both dependent details.
Data
Run-owned records and configuration in an isolated workspace.
Source
services-crm:modules/entities/tests/integration/services/persistence/contact-information-sources.integration.spec.js#refuses a save that removes the affiliation and keeps the rows linked through it; react-console:acceptance/crm/playwright/journeys/affiliations/CRM-ACC-0202.spec.ts#CRM-ACC-0202
21 Keep a one-day affiliation current on its last dayinteractionapiproposed
Proves
BR-CAP-CRM-ENT-009-07 BR-CAP-CRM-ENT-010-02
Preconditions
A person has an affiliation whose start and end are the same workspace date.
Steps
Read the people list on that date and again on the next workspace date.
Expected
The tie is current on its single day and past on the following day.
Data
Run-owned records and configuration in an isolated workspace.
Source
services-crm:modules/entities/tests/integration/services/persistence/contacts.integration.spec.js#refuses an affiliation that ends before it starts; services-crm:modules/entities/tests/integration/services/persistence/contact-affiliations.business-dates.integration.spec.js#reads a tie ending on the tenant's today as current
22 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
23 The configured default supplies the Organization commandinteractionapiproposed
Proves
BR-CAP-CRM-ENT-009-11 BR-CAP-CRM-ENT-017-06
Preconditions
An administrator selects a nondefault affiliation type for the workspace.
Steps
Set a person’s primary organization using the Organization command and inspect the created tie.
Expected
The saved relationship uses the selected workspace default type.
Data
Run-owned records and configuration in an isolated workspace.
Source
services-crm:modules/entities/tests/unit/services/persistence/contact-affiliations.spec.js#ends the previous primary the day before the effective date by default, and its open roles with it; services-crm:modules/entities/tests/e2e/affiliation-types.e2e.spec.js#refuses a caller who may only read affiliation types the change of the default (403)
24 Establish current and future ties and remove an erroneous past tietransitionapiproposed
Proves
BR-CAP-CRM-ENT-009-03 BR-CAP-CRM-ENT-009-07
Preconditions
A person has one ended affiliation and two unused organization and type combinations.
Steps
Add one future affiliation and one current affiliation; then submit an explicit list without the erroneous past affiliation.
Expected
The new ties read as upcoming and current; the explicitly omitted past tie and its owned role periods are removed.
Data
Run-owned records and configuration in an isolated workspace.
Source
services-crm:modules/entities/tests/integration/services/persistence/contact-information-sources.integration.spec.js#refuses a new link through an upcoming affiliation, naming the path
25 Exercise every declared authority independentlypermissionapinegativeproposed
Proves
BR-CAP-CRM-ENT-009-15
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.