Conversation
The Conversation entity, mapped to the conversation table.
| Table | conversation |
| Tenant-scoped | Yes — extends TenantOwned |
| Columns | 4 |
| Relationships | 2 |
| Source | backend/src/main/java/com/motorph/payroll/model/Conversation.java |
Columns
| Field | Type | Column | Null | Notes |
|---|---|---|---|---|
conversationId | Integer | conversation_id | — | primary key, generated |
lastMessageTimestamp | LocalDateTime | last_message_timestamp | — | — |
lastMessageContent | String | last_message_content | — | — |
unreadCount | Integer | unread_count | — | — |
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 |
|---|---|---|---|---|
participant1 | @ManyToOne | Employee | participant1_employee_id | Yes |
participant2 | @ManyToOne | Employee | participant2_employee_id | Yes |
Referenced by
| Entity | Field | Kind |
|---|---|---|
| ChatMessage | conversation | @ManyToOne |
Neighbourhood
Repository
ConversationRepository
Declared over Conversation with id type Integer. Source: backend/src/main/java/com/motorph/payroll/repository/ConversationRepository.java
| Method | Returns | Notes |
|---|---|---|
findAllByParticipant(@Param("empId") Integer empId) | List<Conversation> | explicit @Query |
findBetween(@Param("id1") Integer id1, @Param("id2") Integer id2) | Optional<Conversation> | explicit @Query |
existsByIdAndParticipant(@Param("conversationId") Integer conversationId, @Param("employeeId") Integer employeeId) | boolean | explicit @Query |
Reached by
These controllers hold — directly or through a service they depend on — a repository over Conversation.
| Controller | Base path | Endpoints | Module |
|---|---|---|---|
| ConversationController | /api/conversations | 5 | Platform Misc |
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/.