CompanyPerson
entity represents the relationship between a company and a person in the Well system. It allows defining the type of relationship (employee, contact, owner, etc.) and serves as a Many-to-Many linking table.
Table structure
Table name:company_people
Main fields
Name | Type | Required | Constraints | Allowed Values | Description | Example |
---|---|---|---|---|---|---|
id | string, UUID, π system | β Yes | Unique identifier (read-only) | β | Unique identifier of the company-person relationship | βcompany-person-uuid-123β |
company | Company (UUID) | β Yes | Foreign key reference | β | Reference to the company | βcompany-uuid-456β |
person | People (UUID) | β Yes | Foreign key reference | β | Reference to the person | βperson-uuid-789β |
relationship_type | string (enum) | βͺ No | default: βotherβ | contact , employee , owner , other | Type of relationship between company and person | βownerβ |
created_at | string (ISO 8601) π system | β | auto timestamp | β | Creation timestamp | β2023-01-01T12:00:00Zβ |
deleted_at | string | null π system | βͺ No | nullable ISO 8601 | β | Deletion timestamp (soft delete) | β2024-01-01T12:00:00Zβ |
Relationship types
CompanyPersonRelationshipType enum
Type descriptions
Type | Description | Common usage |
---|---|---|
CONTACT | Business contact | Main point of contact, sales representative |
EMPLOYEE | Employee | Team member, collaborator |
OWNER | Owner | CEO, founder, majority owner |
OTHER | Other | Uncategorized relationships, external consultants |
Relations
Many-to-One relations
- Company: The company in the relationship
- People: The person in the relationship