CrmOrganization
The CrmOrganization entity, mapped to the crm_organization table.
| Table | crm_organization |
| Tenant-scoped | Yes — extends TenantOwned |
| Columns | 12 |
| Relationships | 2 |
| Source | backend/src/main/java/com/motorph/payroll/model/CrmOrganization.java |
Columns
| Field | Type | Column | Null | Notes |
|---|---|---|---|---|
orgId | Integer | org_id | — | primary key, generated |
name | String | name | — | — |
industry | String | industry | Yes | — |
website | String | website | Yes | — |
phone | String | phone | Yes | — |
email | String | email | Yes | — |
address | String | address | Yes | — |
annualRevenue | BigDecimal | annual_revenue | Yes | — |
employeeCount | Integer | employee_count | Yes | — |
status | String | status | — | — |
createdAt | LocalDateTime | created_at | — | — |
updatedAt | LocalDateTime | updated_at | Yes | — |
Plus tenant_id, inherited from TenantOwned. Hibernate stamps it on insert and adds where tenant_id = ? to every query, so it is never written or read by application code.
Relationships
| Field | Kind | Target | Join column | Required |
|---|---|---|---|---|
owner | @ManyToOne | Employee | owner_id | — |
createdBy | @ManyToOne | Employee | created_by | — |
Referenced by
| Entity | Field | Kind |
|---|---|---|
| CrmActivity | organization | @ManyToOne |
| CrmContact | organization | @ManyToOne |
| CrmDeal | organization | @ManyToOne |
| CrmNote | organization | @ManyToOne |
Neighbourhood
Repository
CrmOrganizationRepository
Declared over CrmOrganization with id type Integer, with JpaSpecificationExecutor for dynamic filtering. Source: backend/src/main/java/com/motorph/payroll/repository/CrmOrganizationRepository.java
| Method | Returns | Notes |
|---|---|---|
findWithDetailsByOrgId(Integer orgId) | Optional<CrmOrganization> | derived |
Reached by
These controllers hold — directly or through a service they depend on — a repository over CrmOrganization.
| Controller | Base path | Endpoints | Module |
|---|---|---|---|
| CrmActivityController | /api/crm/activities | 5 | CRM |
| CrmContactController | /api/crm/contacts | 6 | CRM |
| CrmDealController | /api/crm/deals | 11 | CRM |
| CrmLeadController | /api/crm/leads | 7 | CRM |
| CrmOrganizationController | /api/crm/organizations | 5 | CRM |
Generated page
This page is rebuilt from the source on every docs build by docs-site/scripts/gen-code-wiki.mjs. Editing it has no effect — change the code, or, if what you want to say is prose, write it in docs/.