angular.module('admin', ['ngRoute','menuDirective', 'angularUtils.directives.dirPagination'])
.config(function($routeProvider, $httpProvider){

  $httpProvider.interceptors.push('tokenInterceptor');

    // login
    $routeProvider.when('/', {
        templateUrl: 'partials/login.html',
        controller: 'LoginController'
    });

    // dashboard
    $routeProvider.when('/dash', {
        templateUrl: 'partials/dash.html',
        controller: 'DashController'
    });


    // faturados
    $routeProvider.when('/invoiced', {
      templateUrl: 'partials/orders/ordersList.html',
      controller: 'InvoicedController'
    });

    // cancelados
    $routeProvider.when('/canceled', {
      templateUrl: 'partials/orders/ordersList.html',
      controller: 'CanceledController'
    });

    // para faturar
    $routeProvider.when('/ready', {
      templateUrl: 'partials/orders/ordersList.html',
      controller: 'ReadyController'
    });


    // pedidos do seller
    $routeProvider.when('/orders', {
        templateUrl: 'partials/orders/ordersList.html',
        controller: 'OrderController'
    });

    // pedido detalhado  add valor de cada item
    $routeProvider.when('/orders/:orderId', {
        templateUrl: 'partials/orders/orderId.html',
        controller: 'OrderIdController'
    });

    //faturar pedido
    $routeProvider.when('/orders/:orderId/invoice', {
        templateUrl: 'partials/orders/invoice.html',
        controller: 'InvoiceOrderController'
    });

    // listar itens - ok add coluna com tamanho
    $routeProvider.when('/items', {
        templateUrl: 'partials/items/itemsList.html',
        controller: 'StockController'
    });

    // filtros de itens
    $routeProvider.when('/items/:action', {
        templateUrl: 'partials/items/itemsList.html',
        controller: 'StockController'
    });

    // alterar estoque - ok
    $routeProvider.when('/items/edit/:ean', {
        templateUrl: 'partials/items/altStock.html',
        controller: 'AltStockController'
    });

    $routeProvider.otherwise({redirectTo: '/dash'});

});
