 'use strict'
 
 angular.module('taarifaWaterpointsApp')
+
   .controller 'NavCtrl', ($scope, $location) ->
     $scope.location = $location
+
   .controller 'MainCtrl', ($scope, Waterpoint) ->
     Waterpoint.query (waterpoints) ->
       $scope.waterpoints = waterpoints._items
+
   .controller 'MapCtrl', ($scope, Map) ->
     $scope.map = Map
+
   .controller 'WaterpointCreateCtrl', ($scope, Waterpoint, FacilityForm, flash) ->
     $scope.formTemplate = FacilityForm 'wpf001'
     # FIXME: Should not hardcode the facility code here

      Request.query query, (requests) ->
        $scope.requests = requests._items
    $scope.filterStatus()
  .controller 'RequestTriageCtrl', ($scope, $http, $routeParams, $filter, Request, Waterpoint, flash) ->
    Request.get id: $routeParams.id, (request) ->
      if request.expected_datetime

          if status == 200 and data._status == 'ERR'
            for field, message of data._issues
              flash.error = "#{field}: #{message}"

  .controller 'RequestCreateCtrl', ($scope, $location, Request, RequestForm, flash) ->
    $scope.formTemplate = RequestForm 'wps001', $location.search()
    # FIXME: Should not hardcode the service code here
