/** * @ngdoc anticimexService * @name fasit.services.#anticimexService * @anticimexService * * @description * Service som hanterar beställning till anticimex. * */ angular.module('fbMocks')//angular.mock.module('fasit') .factory('anticimexService', ['$q', function ( $q: ng.IQService ): fb.IMockAnticimexService { var mockBase: fb.MockBase = new fb.MockBase($q); var resolve = function (type: fb.RequestType, identifier: string, returnValue: any): void { mockBase.resolve(mockBase.requestIdentifier(type, identifier), returnValue); }; var reject = function (type: fb.RequestType, identifier: string, returnValue: any): void { mockBase.reject(mockBase.requestIdentifier(type, identifier), returnValue); }; var getPendingRequests = function (): string[] { return mockBase.getPendingRequests(); }; var bestaellFoersaekring = function (foersaekring: fb.IAnticimexFoersaekringsBestaellning): fb.ResourceBase { var res = { $promise: mockBase.createRequest(mockBase.requestIdentifier(fb.RequestType.ADD, '')) }; return new fb.ResourceBase(res); }; return { bestaellFoersaekring: bestaellFoersaekring, resolve: resolve, reject: reject, getPendingRequests: getPendingRequests }; }]);