(function() {
	"use strict";

	window.app.controller("InventoryTypeController",
	[
		"$uibModal", "inventoryTypeSvc", "downloadSvc",
		function($uibModal, inventoryTypeSvc, downloadSvc) {
			var vm = this;

			vm.inventoryTypes = inventoryTypeSvc.inventoryTypes;

			vm.add = function() {
				$uibModal.open({
					template: "<inventory-type-add />",
					backdrop: "static"
				});
			};
			vm.export = function() {
				inventoryTypeSvc.exportInventoryTypes()
					.success(downloadSvc.success);
			};
		}
	]);
})();