// User types
export const UserType = Object.freeze({
  CUSTOMER: 'customer',
  MITRA: 'mitra',
  CC_USER: 'cc_user',
})

// Chat session statuses
export const SessionStatus = Object.freeze({
  SEARCHING: 'searching',
  PENDING_ACCEPTANCE: 'pending_acceptance',
  PENDING_PAYMENT: 'pending_payment',
  ACTIVE: 'active',
  EXTENDING: 'extending',
  CLOSING: 'closing',
  COMPLETED: 'completed',
  CANCELLED: 'cancelled',
  EXPIRED: 'expired',
})

// Chat message statuses
export const MessageStatus = Object.freeze({
  SENT: 'sent',
  DELIVERED: 'delivered',
  READ: 'read',
})

// Chat message types
export const MessageType = Object.freeze({
  TEXT: 'text',
})

// Chat request notification responses
export const NotificationResponse = Object.freeze({
  ACCEPTED: 'accepted',
  DECLINED: 'declined',
  MISSED: 'missed',
  IGNORED: 'ignored',
})

// Session extension statuses
export const ExtensionStatus = Object.freeze({
  PENDING: 'pending',
  ACCEPTED: 'accepted',
  REJECTED: 'rejected',
  TIMEOUT: 'timeout',
})

// Customer transaction types
export const TransactionType = Object.freeze({
  FREE_TRIAL: 'free_trial',
  PAID: 'paid',
  EXTENSION: 'extension',
})

// Who ended a session
export const EndedBy = Object.freeze({
  SYSTEM: 'system',
  SYSTEM_AUTO_CLOSE: 'system_auto_close',
  CUSTOMER: 'customer',
  MITRA: 'mitra',
})

// Session topic sensitivity
export const TopicSensitivity = Object.freeze({
  REGULAR: 'regular',
  SENSITIVE: 'sensitive',
})

// Auth provider used to establish a session
export const AuthProvider = Object.freeze({
  ANONYMOUS: 'anonymous',
  PHONE: 'phone',
  GOOGLE: 'google',
  APPLE: 'apple',
  PASSWORD: 'password',
})

// OTP delivery channel
export const OtpChannel = Object.freeze({
  WHATSAPP: 'whatsapp',
  SMS: 'sms',
})

// WebSocket message types
export const WsMessage = Object.freeze({
  // Auth
  AUTH: 'auth',
  AUTH_OK: 'auth_ok',
  ERROR: 'error',

  // Chat
  MESSAGE: 'message',
  MESSAGE_ACK: 'message_ack',
  MESSAGE_STATUS: 'message_status',
  TYPING: 'typing',

  // Pairing
  CHAT_REQUEST: 'chat_request',
  CHAT_REQUEST_CLOSED: 'chat_request_closed',
  PAIRED: 'paired',

  // Session lifecycle
  SESSION_TIMER: 'session_timer',
  SESSION_EXPIRED: 'session_expired',
  SESSION_CLOSING: 'session_closing',
  SESSION_COMPLETED: 'session_completed',
  SESSION_ENDED: 'session_ended',
  SESSION_PAUSED: 'session_paused',
  SESSION_RESUMED: 'session_resumed',
  SESSION_ASSIGNED: 'session_assigned',
  SESSION_REROUTED: 'session_rerouted',
  REROUTED: 'rerouted',

  // Extension
  EXTENSION_REQUEST: 'extension_request',
  EXTENSION_RESPONSE: 'extension_response',

  // Topic sensitivity
  SESSION_TOPIC_UPDATED: 'session_topic_updated',

  // Early end
  EARLY_END: 'early_end',

  // Delivery
  DELIVERED: 'delivered',
  READ: 'read',
})
