Companies
Gordon CRM supports Business-to-Business (B2B) workflows through a Companies module that layers organization-level data on top of the existing contact-centric model. Companies are an optional, toggleable feature — workspaces that don't need B2B capabilities can leave the module disabled entirely.
Data Model
The Companies feature introduces two database tables:
Companies Table
Stores organization-level metadata:
| Column | Type | Description |
|---|---|---|
id | uuid | Primary key |
workspace_id | uuid | Tenant isolation |
name | text | Company name (required) |
domain | text | Company website domain (e.g. acme.com) |
phone | text | Main phone number |
address_line1 | text | Street address |
address_line2 | text | Suite, floor, etc. |
city | text | City |
state | text | State or province |
postal_code | text | ZIP / postal code |
country | text | Country |
notes | text | Free-form notes about the company |
created_by | uuid | User who created the record |
updated_by | uuid | Last user to edit the record |
created_at | timestamptz | Created timestamp |
updated_at | timestamptz | Last updated timestamp |
Company Contacts Junction Table
Links contacts to companies with a many-to-many relationship. A single contact can be linked to multiple companies (e.g. a consultant who serves several clients), and a company can have many linked contacts.
| Column | Type | Description |
|---|---|---|
company_id | uuid | FK → companies.id |
contact_id | uuid | FK → contacts.id |
job_title | text | The contact's role at this company (e.g. "VP of Sales") |
work_email | text | Business email address (separate from personal email on the contact record) |
work_phone | text | Business phone number |
is_primary | boolean | Marks this contact as the primary point of contact for the company |
Note: A unique constraint on
(company_id, contact_id)prevents duplicate links. Attempting to link the same contact twice returns a friendly "already linked" error.
Bidirectional Navigation
The company↔contact linkage is accessible from both directions in the dashboard:
-
Company → Contact: The company detail page has a Contacts tab that lists all linked contacts with their job title, work email, and work phone. Clicking a contact name navigates to the contact's detail page.
-
Contact → Company: The contact detail page has a Companies tab (visible only when the companies module is enabled) that lists all companies the contact is associated with.
RBAC
Companies follow the Operational Data access model:
| Role | Create | Read | Edit | Delete |
|---|---|---|---|---|
| Owner | ✅ | ✅ | ✅ | ✅ |
| Admin | ✅ | ✅ | ✅ | ✅ |
| Member | ✅ | ✅ | ✅ | ❌ |
Delete operations are restricted to admin and above using the requireRole helper, which preserves
audit trails by preventing members from accidentally removing organization records.
Cross-Module Integration
When the Deals module is also enabled, the company detail page gains an additional Deals tab that
lists all deals where this company is the primary entity. This tab is conditionally rendered based on
the deals module toggle — if Deals is disabled, the tab does not appear.
Next Steps
- Company Management — Create, edit, link contacts, and manage company records.
- Module Toggles — How optional modules (Companies, Deals, Appointments) are enabled or disabled per workspace.