/**
 * Angular module for production component. This component is divided to following logical components:
 *
 *  frontend.production.product
 *  frontend.production.printdata
 *
 * Each component has it own configuration for ui-router.
 */
(function() {
  'use strict';

  // Define frontend.admin module
  angular.module('frontend.production', [
    'frontend.production.printdata',
    'frontend.production.product',
    'frontend.production.substrate',
    'frontend.production.color'
  ]);

  // Module configuration
  angular.module('frontend.production')
    .config([
      '$stateProvider',
      function($stateProvider) {
        $stateProvider
          .state('production', {
            parent: 'frontend',
            data: {
              access: 1
            },
            views: {
              'content@': {
                controller: [
                  '$state',
                  function($state) {
                    $state.go('production.printdatas');
                  }
                ]
              },
              'pageNavigation@': {
                templateUrl: '/frontend/core/layout/partials/navigation.html',
                controller: 'NavigationController',
                resolve: {
                  _items: [
                    'ContentNavigationItems',
                    function resolve(ContentNavigationItems) {
                      return ContentNavigationItems.getItems('production');
                    }
                  ]
                }
              }
            }
          })
        ;
      }
    ])
  ;
}());
