ContactDivision
Introduction
ContactDivision is a junction entity that enables multi-division access control for contacts. This allows a single contact (customer, vendor, carrier) to have access to multiple divisions within an organization, supporting complex organizational structures and shared customer scenarios.
Entity Structure
Properties
| Property Name | Type | Required | Description |
|---|---|---|---|
| ContactDivisionId | int | Yes | Primary key |
| ContactId | int | Yes | Foreign key to Contact |
| DivisionId | int | Yes | Foreign key to Division |
| Created | DateTime | Yes | Creation timestamp |
| CreatedBy | string | Yes | User who created the record |
| LastModified | DateTime | Yes | Last modification timestamp |
| LastModifiedBy | string | Yes | User who last modified |
Relationships
| Relationship | Type | Description |
|---|---|---|
| Contact | Contact | Parent contact |
| Division | Division | Division with access |
YAML Configuration
Multi-division access is managed through Contact update operations:
# Assign contact to multiple divisions
- task: Contact/Update@1
name: assignMultipleDivisions
inputs:
organizationId: ${organizationId}
contactId: ${contactId}
contact:
contactDivisions:
- divisionId: ${eastDivisionId}
- divisionId: ${westDivisionId}
- divisionId: ${centralDivisionId}
Usage
This junction entity is managed automatically when divisions are assigned to contacts. It supports scenarios where:
- A customer operates in multiple regions served by different divisions
- A carrier provides services across multiple business units
- An employee has responsibilities spanning multiple divisions
Domain Events
The Contact entity publishes a ContactChangedDivisions domain event when division assignments change, allowing downstream systems to react to access control modifications.
Related Topics
- Contact Entity - Parent contact entity
- Division Entity - Division organizational structure
- Organization Entity - Multi-tenancy root