 analytics = require './analytics.coffee'
 
 module.exports = (options = {}) ->
-  { user } = options
+  { user, inquiry } = options
 
   questionnaire = new InquiryQuestionnaireView options
   modal = modalize questionnaire,

    # Try to get a location incase one doesn't exist,
    # don't wait for it though
    user.approximateLocation()
    user.instantiate()
      .then -> user.related().collectorProfile.instantiate()
      .then done

  # Abort by clicking 'nevermind'
  questionnaire.state.on 'abort', ->


  # End of complete flow
  questionnaire.state.on 'done', ->
    # Send the inquiry
    inquiry.save()

    # Simultaneously close the modal and
    # display a success message, regardless
    modal.close ->
      new FlashMessage message: '
        Your inquiry has been sent.<br>
