CrmActivity
The CrmActivity entity, mapped to the crm_activity table.
| Table | crm_activity |
| Tenant-scoped | Yes — extends TenantOwned |
| Columns | 10 |
| Relationships | 5 |
| Source | backend/src/main/java/com/motorph/payroll/model/CrmActivity.java |
Columns
| Field | Type | Column | Null | Notes |
|---|---|---|---|---|
activityId | Integer | activity_id | — | primary key, generated |
type | String | type | — | — |
subject | String | subject | — | — |
description | String | description | Yes | — |
scheduledAt | LocalDateTime | scheduled_at | Yes | — |
completedAt | LocalDateTime | completed_at | Yes | — |
status | String | status | — | — |
outcome | String | outcome | Yes | — |
durationMinutes | Integer | duration_minutes | Yes | — |
createdAt | LocalDateTime | created_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
| Field | Kind | Target | Join column | Required |
|---|---|---|---|---|
deal | @ManyToOne | CrmDeal | deal_id | — |
contact | @ManyToOne | CrmContact | contact_id | — |
organization | @ManyToOne | CrmOrganization | org_id | — |
lead | @ManyToOne | CrmLead | lead_id | — |
owner | @ManyToOne | Employee | owner_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
| Method | Returns | Notes |
|---|---|---|
findWithDetailsByActivityId(Integer activityId) | Optional<CrmActivity> | derived |
findAllByDeal_DealIdOrderByScheduledAtDesc(Integer dealId) | List<CrmActivity> | derived |
countByType(String type) | long | derived |
countGroupedByType() | List<Object[]> | explicit @Query |
renameType(@Param("oldName") String oldName, @Param("newName") String newName) | int | explicit @Query, modifying |
Reached by
These controllers hold — directly or through a service they depend on — a repository over CrmActivity.
| Controller | Base path | Endpoints | Module |
|---|---|---|---|
| CrmActivityController | /api/crm/activities | 5 | CRM |
| CrmDealController | /api/crm/deals | 11 | CRM |
| CrmPicklistController | /api/crm/picklists | 4 | 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/.