Skip to main content

CrmContact

The CrmContact entity, mapped to the crm_contact table.

Tablecrm_contact
Tenant-scopedYes — extends TenantOwned
Columns10
Relationships3
Sourcebackend/src/main/java/com/motorph/payroll/model/CrmContact.java

Columns​

FieldTypeColumnNullNotes
contactIdIntegercontact_id—primary key, generated
firstNameStringfirst_name——
lastNameStringlast_name——
emailStringemailYes—
phoneStringphoneYes—
jobTitleStringjob_titleYes—
isPrimaryBooleanis_primary——
statusStringstatus——
createdAtLocalDateTimecreated_at——
updatedAtLocalDateTimeupdated_atYes—

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​

FieldKindTargetJoin columnRequired
organization@ManyToOneCrmOrganizationorg_id—
owner@ManyToOneEmployeeowner_id—
createdBy@ManyToOneEmployeecreated_by—

Referenced by​

EntityFieldKind
CrmActivitycontact@ManyToOne
CrmDealcontact@ManyToOne
CrmNotecontact@ManyToOne

Neighbourhood​

Repository​

CrmContactRepository​

Declared over CrmContact with id type Integer, with JpaSpecificationExecutor for dynamic filtering. Source: backend/src/main/java/com/motorph/payroll/repository/CrmContactRepository.java

MethodReturnsNotes
findWithDetailsByContactId(Integer contactId)Optional<CrmContact>derived
findAllByOrganization_OrgId(Integer orgId)List<CrmContact>derived

Reached by​

These controllers hold — directly or through a service they depend on — a repository over CrmContact.

ControllerBase pathEndpointsModule
CrmActivityController/api/crm/activities5CRM
CrmContactController/api/crm/contacts6CRM
CrmDealController/api/crm/deals11CRM
CrmLeadController/api/crm/leads7CRM

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/.