/*
|--------------------------------------------------------------------------
| Agência PSI
|--------------------------------------------------------------------------
| Arquivo: src/features/conversations/services/conversationsSelects.js
|
| SELECTs canônicos de conversation_threads e conversation_messages.
| Threads usa `*` porque a UI usa muitos campos derivados (last_message_at,
| unread_count, assigned_to, contact_number, patient_name, etc).
|--------------------------------------------------------------------------
*/

/** Thread — UI usa praticamente todos os campos. */
export const CONVERSATION_THREAD_SELECT = '*';

/** Mensagem — campos canônicos pra timeline. */
export const CONVERSATION_MESSAGE_SELECT = `
    id, tenant_id, thread_id, patient_id, body, direction, channel,
    created_at, sent_at, delivered_at, read_at,
    kanban_status, status, contact_number, attachments
`
    .replace(/\s+/g, ' ')
    .trim();

/** Mensagem brief — listings em prontuário (sem campos pesados). */
export const CONVERSATION_MESSAGE_SELECT_BRIEF = `
    id, body, direction, created_at, channel, kanban_status
`
    .replace(/\s+/g, ' ')
    .trim();

/**
 * Canais identificados no sistema (memória audit baseline M6).
 */
export const CHANNEL_TYPES = Object.freeze(['whatsapp', 'sms', 'email', 'in_app']);
