import { apiClient } from './apiClient'

export const historyService = {
  /**
   * Get Chat History
   */
  async getChatHistory(sessionId) {
    return apiClient(\`/api/v1/history/session/\${sessionId}\`)
  },

  /**
   * Get Lead Flow Data
   */
  async getLeadFlow(filters = {}) {
    return apiClient('/api/v1/leads/flow', {
      method: 'POST',
      data: filters
    })
  },

  /**
   * Merge User History (Anonymous -> Authenticated)
   */
  async mergeHistory(oldDeviceId, newUserId) {
    return apiClient('/api/v1/history/merge', {
      method: 'POST',
      data: { old_device_id: oldDeviceId, user_id: newUserId }
    })
  }
}
