text: const EnrollmentSerializer = (req, result) => ({
    id: result.get('id'),
    contact: contact(result.related('contact')),
    phone_number: phone_number(result.related('phone_number')),
    was_converted: result.get('was_converted'),
    call_id: result.get('call_id'),
    status: result.get('status'),
    unenrolled_at: result.get('unenrolled_at'),
    completed_at: result.get('completed_at'),
    error: result.get('error'),
    created_at: result.get('created_at'),
    updated_at: result.get('updated_at')
  })
  
  const contact = (contact) => {
    if(!contact.id) return null
    return {
      id: contact.get('id'),
      display_name: contact.get('display_name'),
      initials: contact.get('initials'),
      rfc822: contact.get('rfc822'),
      phone_name: contact.get('phone_name'),
      photo: contact.related('photo') ? contact.related('photo').get('path') : null
    }
  }
  
  const phone_number = (phone_number) => {
    if(!phone_number.id) return
    return {
      id: phone_number.get('id'),
      number: phone_number.get('number'),
      formatted: phone_number.get('formatted')
    }
  }
  
  export default EnrollmentSerializer
  