Skip to main content
The 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

NameTypeRequiredConstraintsAllowed ValuesDescriptionExample
idstring, UUID, πŸ”’ systemβœ… YesUnique identifier (read-only)–Unique identifier of the company-person relationship”company-person-uuid-123”
companyCompany (UUID)βœ… YesForeign key reference–Reference to the company”company-uuid-456”
personPeople (UUID)βœ… YesForeign key reference–Reference to the person”person-uuid-789”
relationship_typestring (enum)βšͺ Nodefault: β€˜other’contact, employee, owner, otherType of relationship between company and person”owner”
created_atstring (ISO 8601) πŸ”’ system–auto timestamp–Creation timestamp”2023-01-01T12:00:00Z”
deleted_atstring | null πŸ”’ systemβšͺ Nonullable ISO 8601–Deletion timestamp (soft delete)β€œ2024-01-01T12:00:00Z”

Relationship types

CompanyPersonRelationshipType enum

enum CompanyPersonRelationshipType {
  CONTACT = 'contact',    // Business contact or point of contact
  EMPLOYEE = 'employee',  // Company employee
  OWNER = 'owner',       // Owner or manager
  OTHER = 'other'        // Other type of relationship
}

Type descriptions

TypeDescriptionCommon usage
CONTACTBusiness contactMain point of contact, sales representative
EMPLOYEEEmployeeTeam member, collaborator
OWNEROwnerCEO, founder, majority owner
OTHEROtherUncategorized relationships, external consultants

Relations

Many-to-One relations

  • Company: The company in the relationship
  • People: The person in the relationship

Relationship schema

CompanyPerson (N) ←→ (1) Company
CompanyPerson (N) ←→ (1) People

# Enables Many-to-Many relationship:
Company (N) ←→ (N) People via CompanyPerson
⌘I