Skip to main content

CrmActivity

The CrmActivity entity, mapped to the crm_activity table.

Tablecrm_activity
Tenant-scopedYes — extends TenantOwned
Columns10
Relationships5
Sourcebackend/src/main/java/com/motorph/payroll/model/CrmActivity.java

Columns​

FieldTypeColumnNullNotes
activityIdIntegeractivity_id—primary key, generated
typeStringtype——
subjectStringsubject——
descriptionStringdescriptionYes—
scheduledAtLocalDateTimescheduled_atYes—
completedAtLocalDateTimecompleted_atYes—
statusStringstatus——
outcomeStringoutcomeYes—
durationMinutesIntegerduration_minutesYes—
createdAtLocalDateTimecreated_at——

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
deal@ManyToOneCrmDealdeal_id—
contact@ManyToOneCrmContactcontact_id—
organization@ManyToOneCrmOrganizationorg_id—
lead@ManyToOneCrmLeadlead_id—
owner@ManyToOneEmployeeowner_id—

Neighbourhood​

Repository​

CrmActivityRepository​

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

MethodReturnsNotes
findWithDetailsByActivityId(Integer activityId)Optional<CrmActivity>derived
findAllByDeal_DealIdOrderByScheduledAtDesc(Integer dealId)List<CrmActivity>derived
countByType(String type)longderived
countGroupedByType()List<Object[]>explicit @Query
renameType(@Param("oldName") String oldName, @Param("newName") String newName)intexplicit @Query, modifying

Reached by​

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

ControllerBase pathEndpointsModule
CrmActivityController/api/crm/activities5CRM
CrmDealController/api/crm/deals11CRM
CrmPicklistController/api/crm/picklists4CRM

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