26 lines
1.0 KiB
Go
26 lines
1.0 KiB
Go
package model
|
|
|
|
// ContactMerge represents a merge operation between two contacts.
|
|
// Reference: Chatwoot app/actions/contact_merge_action.rb
|
|
//
|
|
// The merge operation:
|
|
// 1. Moves all conversations from mergee to base contact
|
|
// 2. Moves all messages (sender=mergee) to base contact
|
|
// 3. Moves all contact_inboxes from mergee to base contact
|
|
// 4. Moves all notes from mergee to base contact
|
|
// 5. Deletes the mergee contact
|
|
//
|
|
// This model is used for request/response only; actual merge logic is in service.
|
|
|
|
// ContactMergeRequest represents the request body for merging two contacts.
|
|
// Reference: Chatwoot ContactMergesController — params[:base_contact_id], params[:mergee_contact_id]
|
|
type ContactMergeRequest struct {
|
|
BaseContactID uint `json:"base_contact_id" binding:"required"`
|
|
MergeeContactID uint `json:"mergee_contact_id" binding:"required"`
|
|
}
|
|
|
|
// ContactMergeResponse represents the response after a successful merge.
|
|
// Returns the base contact after merge is complete.
|
|
type ContactMergeResponse struct {
|
|
Contact *Contact `json:"contact"`
|
|
} |