(function () { 'use strict'; var ngAntiForgeryService = angular.module('ngAntiForgeryService', ['ngResource']); ngAntiForgeryService.service('AntiForgery', ['$resource', function ($resource) { this.getAntiForgery = function (prefix) { // Initiates the AJAX call var req = $.ajax("/acs-refresh-forgery-token") , chained = req.then( function(html) { return $('
').html(html).find('input[type="hidden"]').val(); }); return chained; } }]); })(); (function () { 'use strict'; var ngChartsService = angular.module('ngChartsService', ['ngResource']); ngChartsService.service('Charts', ['$resource', '$http', function ($resource) { this.getClientChartData = function (url, dataaux, prefix) { return $resource(prefix + '/webapi/clientdashboard/getchartdata?chartName=' + url, {}, { query: { method: 'POST', params: { data: dataaux }, isArray: false } }).query().$promise; }; this.getInternalChartData = function (url, dataaux, prefix) { return $resource(prefix + '/webapi/internaldashboard/getchartdata?chartName=' + url, {}, { query: { method: 'POST', params: { data: dataaux }, isArray: false } }).query().$promise; }; this.drawLineDoubleChart = function (labels, values, div) { var table = []; var aux = ['void']; aux = aux.concat(labels); table.push(aux); for (var i = 0; i < values.length; i++) { var aux1 = []; aux1.push(values[i].label); aux1 = aux1.concat(values[i].data) table.push(aux1); } var rows = this.transpose(table); var data = google.visualization.arrayToDataTable( rows ); var columns = []; var series = {}; for (var i = 0; i < data.getNumberOfColumns(); i++) { columns.push(i); if (i > 0) { series[i - 1] = {}; } } var options = { legend: { position: 'top' }, //chartArea: { 'width': '85%', 'height': '80%' }, series: { 0: { targetAxisIndex: 0 }, 1: { targetAxisIndex: 1 }, 2: { targetAxisIndex: 0 }, 3: { targetAxisIndex: 1 } }, vAxes: { 0: { }, 1: { }, }, }; var chart = new google.visualization.LineChart( document.getElementById(div)); chart.draw(data, options); google.visualization.events.addListener(chart, 'select', function () { var sel = chart.getSelection(); // if selection length is 0, we deselected an element if (sel.length > 0) { // if row is undefined, we clicked on the legend if (typeof sel[0].row === 'undefined' || sel[0].row == null) { var col = sel[0].column; if (columns[col] == col) { // hide the data series columns[col] = { label: data.getColumnLabel(col), type: data.getColumnType(col), calc: function () { return null; } }; // grey out the legend entry series[col - 1].color = '#CCCCCC'; } else { // show the data series columns[col] = col; series[col - 1].color = null; } var view = new google.visualization.DataView(data); view.setColumns(columns); chart.draw(view, options); } } }); } this.drawGauges = function (data, div) { var dat = google.visualization.arrayToDataTable(data ); var options = { width: 400, height: 120, redFrom: 90, redTo: 100, yellowFrom: 75, yellowTo: 90, minorTicks: 5 }; var chart = new google.visualization.Gauge(document.getElementById(div)); chart.draw(dat, options); } this.drawLineSimpleChart = function (labels, values, div) { var table = []; var aux = ['void']; aux = aux.concat(labels); table.push(aux); for (var i = 0; i < values.length; i++) { var aux1 = []; aux1.push(values[i].label); aux1 = aux1.concat(values[i].data) table.push(aux1); } var rows = this.transpose(table); var data = google.visualization.arrayToDataTable( rows ); var columns = []; var series = {}; for (var i = 0; i < data.getNumberOfColumns(); i++) { columns.push(i); if (i > 0) { series[i - 1] = {}; } } var options = { legend: { position: 'top' }, //chartArea: { 'width': '85%', 'height': '80%' }, series: { 0: { targetAxisIndex: 0 }, 1: { targetAxisIndex: 1 } }, vAxes: { 0: { }, 1: { }, }, }; var chart = new google.visualization.LineChart( document.getElementById(div)); chart.draw(data, options); google.visualization.events.addListener(chart, 'select', function () { var sel = chart.getSelection(); // if selection length is 0, we deselected an element if (sel.length > 0) { // if row is undefined, we clicked on the legend if (typeof sel[0].row === 'undefined' || sel[0].row == null) { var col = sel[0].column; if (columns[col] == col) { // hide the data series columns[col] = { label: data.getColumnLabel(col), type: data.getColumnType(col), calc: function () { return null; } }; // grey out the legend entry series[col - 1].color = '#CCCCCC'; } else { // show the data series columns[col] = col; series[col - 1].color = null; } var view = new google.visualization.DataView(data); view.setColumns(columns); chart.draw(view, options); } } }); }; this.drawLineSimpleChartNoAxis = function (labels, values, div, title) { var table = []; var aux = ['void']; aux = aux.concat(labels); table.push(aux); for (var i = 0; i < values.length; i++) { var aux1 = []; aux1.push(values[i].label.toLowerCase()); aux1 = aux1.concat(values[i].data) table.push(aux1); } var rows = this.transpose(table); var data = google.visualization.arrayToDataTable( rows ); var columns = []; var series = {}; for (var i = 0; i < data.getNumberOfColumns(); i++) { columns.push(i); if (i > 0) { series[i - 1] = {}; } } var options = { legend: { position: 'top' }, //chartArea: { 'width': '85%', 'height': '80%' }, series: { }, title: title, vAxes: { 0: { }, }, }; var chart = new google.visualization.LineChart( document.getElementById(div)); chart.draw(data, options); google.visualization.events.addListener(chart, 'select', function () { var sel = chart.getSelection(); // if selection length is 0, we deselected an element if (sel.length > 0) { // if row is undefined, we clicked on the legend if (typeof sel[0].row === 'undefined' || sel[0].row == null) { var col = sel[0].column; if (columns[col] == col) { // hide the data series columns[col] = { label: data.getColumnLabel(col), type: data.getColumnType(col), calc: function () { return null; } }; // grey out the legend entry series[col - 1].color = '#CCCCCC'; } else { // show the data series columns[col] = col; series[col - 1].color = null; } var view = new google.visualization.DataView(data); view.setColumns(columns); chart.draw(view, options); } } }); } this.drawLinePositiveChart = function (labels, values, div) { var table = []; var aux = ['void']; aux = aux.concat(labels); table.push(aux); for (var i = 0; i < values.length; i++) { var aux1 = []; aux1.push(values[i].label); aux1 = aux1.concat(values[i].data) table.push(aux1); } var rows = this.transpose(table); var data = google.visualization.arrayToDataTable( rows ); var columns = []; var series = {}; for (var i = 0; i < data.getNumberOfColumns(); i++) { columns.push(i); if (i > 0) { series[i - 1] = {}; } } var options = { pointSize: 5, colors: ['#1ABB9C'], legend: { position: 'top' }, //chartArea: { 'width': '85%', 'height': '80%' }, series: { 0: { targetAxisIndex: 0 }, }, vAxes: { 0: { viewWindowMode: "explicit", viewWindow: { min: 0 } }, }, }; var chart = new google.visualization.LineChart( document.getElementById(div)); chart.draw(data, options); google.visualization.events.addListener(chart, 'select', function () { var sel = chart.getSelection(); // if selection length is 0, we deselected an element if (sel.length > 0) { // if row is undefined, we clicked on the legend if (typeof sel[0].row === 'undefined' || sel[0].row == null) { var col = sel[0].column; if (columns[col] == col) { // hide the data series columns[col] = { label: data.getColumnLabel(col), type: data.getColumnType(col), calc: function () { return null; } }; // grey out the legend entry series[col - 1].color = '#CCCCCC'; } else { // show the data series columns[col] = col; series[col - 1].color = null; } var view = new google.visualization.DataView(data); view.setColumns(columns); chart.draw(view, options); } } }); } this.drawPieChart = function (values, div) { var table = []; var aux = ['void', 'Euros']; table.push(aux); for (var i = 0; i < values.length; i++) { var aux1 = []; aux1.push(values[i].label); aux1 = aux1.concat(values[i].value) table.push(aux1); } var data = google.visualization.arrayToDataTable( table ); var chart = new google.visualization.PieChart( document.getElementById(div)); var options = { hAxis: { title: '', }, vAxis: { title: '' }, legend: { position: 'top' }, //chartArea: { // 'width': '85%', 'height': '80%' //}, //sliceVisibilityThreshold: .15 }; chart.draw(data, options); } this.drawPieChartLib = function (values, div) { var table = []; var aux = ['void', 'Data']; table.push(aux); for (var i = 0; i < values.Labels.length; i++) { var aux1 = []; aux1.push(values.Labels[i]); aux1 = aux1.concat(values.Series[0].Values[i]) table.push(aux1); } var data = google.visualization.arrayToDataTable( table ); var chart = new google.visualization.PieChart( document.getElementById(div)); var options = values.Options; chart.draw(data, options); } this.getColor = function (index) { switch (index % 6) { case (0): return "rgba(031, 157, 212, 0.4)"; case (1): return "rgba(193, 02, 163, 0.4)"; case (2): return "rgba(163, 193, 02, 0.4)"; case (3): return "rgba(02, 68, 193, 0.4)"; case (4): return "rgba(02, 193, 128,0.4)"; case (5): return "rgba(193, 32, 02, 0.4)"; } } this.getSolidColor = function (index) { switch (index % 6) { case (0): return "rgba(031, 157, 212, 1)"; case (1): return "rgba(193, 02, 163, 1)"; case (2): return "rgba(163, 193, 02, 1)"; case (3): return "rgba(02, 68, 193, 1)"; case (4): return "rgba(02, 193, 128,1)"; case (5): return "rgba(193, 32, 02, 1)"; } } //Metodo de transpose para representas las gráficas this.transpose = function (table) { // Calculate the width and height of the Array var a = table, w = a.length ? a.length : 0, h = a[0] instanceof Array ? a[0].length : 0; // In case it is a zero matrix, no transpose routine needed. if (h === 0 || w === 0) { return []; } /** * @var {Number} i Counter * @var {Number} j Counter * @var {Array} t Transposed data is stored in this array. */ var i, j, t = []; // Loop through every item in the outer array (height) for (i = 0; i < h; i++) { // Insert a new row (array) t[i] = []; // Loop through every item per item in outer array (width) for (j = 0; j < w; j++) { // Save transposed data. t[i][j] = a[j][i]; } } return t; }; //Metodo para inicializar las graficas de google. //Recibe como parametro una función para pintar las graficas que se quieran this.initCharts = function (printCharts) { // Load the Visualization API and the corechart package. google.charts.load('current', { 'packages': ['corechart'] }); // Set a callback to run when the Google Visualization API is loaded. google.charts.setOnLoadCallback(printCharts); } this.formatDataToPrint = function (values) { var table = []; var aux = ['void']; aux = aux.concat(values.Labels); table.push(aux); for (var i = 0; i < values.Series.length; i++) { var aux1 = []; aux1.push(values.Series[i].Legend); aux1 = aux1.concat(values.Series[i].Values); table.push(aux1); } var rows = this.transpose(table); var data = google.visualization.arrayToDataTable( rows ); return data; } this.printMultiChart = function (div, values) { var data = this.formatDataToPrint(values); var options = values.Options; var chart = new google.visualization.ComboChart( document.getElementById(div)); var columns = []; var series = {}; for (var i = 0; i < data.getNumberOfColumns(); i++) { columns.push(i); if (i > 0) { series[i - 1] = {}; } } chart.draw(data, options); google.visualization.events.addListener(chart, 'select', function () { var sel = chart.getSelection(); // if selection length is 0, we deselected an element if (sel.length > 0) { // if row is undefined, we clicked on the legend if (typeof sel[0].row === 'undefined' || sel[0].row == null) { var col = sel[0].column; if (columns[col] == col) { // hide the data series columns[col] = { label: data.getColumnLabel(col), type: data.getColumnType(col), calc: function () { return null; } }; // grey out the legend entry series[col - 1].color = '#CCCCCC'; } else { // show the data series columns[col] = col; series[col - 1].color = null; } var view = new google.visualization.DataView(data); view.setColumns(columns); chart.draw(view, options); } } }); }; }]); })(); (function () { 'use strict'; var ngLookupsService = angular.module('ngLookupsService', ['ngResource']); ngLookupsService.service('Lookups', ['$resource', function ($resource) { // --- General Purpouses --- this.getAllCities = function (filter, prefix) { return $resource(prefix + '/webapi/cities/:flt', { flt: filter }, { query: { method: 'GET', params: {}, isArray: true } }).query().$promise; }; this.getAllAirports = function (filter, prefix) { return $resource(prefix + '/webapi/airport/:flt', { flt: filter }, { query: { method: 'GET', params: {}, isArray: true } }).query().$promise; }; this.getCityByName = function (filter, prefix) { return $resource(prefix + '/webapi/citybyname/:flt', { flt: filter }, { query: { method: 'GET', params: {}, isArray: false } }).query().$promise; }; this.getCountries = function (filter, prefix) { return $resource(prefix + '/webapi/countries/:flt', { flt: filter }, { query: { method: 'GET', params: {}, isArray: true } }).query().$promise; }; this.getPartners = function (filter, prefix) { return $resource(prefix + '/webapi/partners/:flt', { flt: filter }, { query: { method: 'GET', params: {}, isArray: true } }).query().$promise; }; this.getAgenciesByPartner = function (partnerUid, filter, withRef, prefix) { return $resource(prefix + '/webapi/agencies/:pe/:flt/:wr', { pe: partnerUid, flt: filter, wr: withRef }, { query: { method: 'GET', params: {}, isArray: true } }).query().$promise; }; this.getProviders = function (filter, prefix) { var filterBase64 = btoa(filter); return $resource(prefix + '/webapi/providers/:flt', { flt: filterBase64 }, { query: { method: 'GET', params: {}, isArray: true } }).query().$promise; }; this.getAllDomains = function (filter, prefix) { return $resource(prefix + '/webapi/domains/:flt', { flt: filter }, { query: { method: 'GET', params: {}, isArray: true } }).query().$promise; }; // --- End General Purpouses --- // --- Professional Registration --- this.getRegistrationLanguages = function (filter, prefix, simplified) { return $resource(prefix + '/webapi/internaldashboard/languages/:sim/:flt', { sim: simplified, flt: filter }, { query: { method: 'GET', params: {}, isArray: true } }).query().$promise; }; // --- End Professional Registration --- this.getUserPurchaseServices = function (cityName, countryCode, prefix) { return $resource(prefix + '/webapi/userpurchase/services/:city/:ctry', { city: cityName, ctry: countryCode }, { query: { method: 'GET', params: {}, isArray: true } }).query().$promise; }; this.getUserPurchaseAirports = function (cityName, countryCode, prefix) { return $resource(prefix + '/webapi/userpurchase/airports/:city/:ctry', { city: cityName, ctry: countryCode }, { query: { method: 'GET', params: {}, isArray: true } }).query().$promise; }; this.getPurchaseLanguages = function (filter, simplified, prefix) { return $resource(prefix + '/webapi/v2/purchases/availablelanguages?filter=:flt&simplified=:sim', { sim: simplified, flt: filter }, { query: { method: 'GET', params: {}, isArray: true } }).query().$promise; }; // --- End User Purchase --- }]); })(); (function () { 'use strict'; var ngPurchasesService = angular.module('ngPurchasesService', ['ngResource']); ngPurchasesService.service('Purchases', ['$resource', function ($resource) { this.getMeetingPointAddressesCart = function (filter, prefix, latitude, longitude, radious) { return $resource(prefix + '/webapi/v2/purchases/meetingpointaddressescart?filter=:flt&latitude=:lat&longitude=:long&radious=:rad', { flt: filter, lat: latitude, long: longitude, rad: radious }, { query: { method: 'GET', params: {}, isArray: true } }).query().$promise; }; // Services this.getMaterializedServices = function (filters, rqType, partner, rqId, prefix, skip, take, currencyCode, agentUid) { return $resource(prefix + '/webapi/v2/userpurchase/materializedservices', {}, { query: { method: 'POST', params: { filterData: filters, partnerCode: partner, currencyCode: currencyCode, rqType: rqType, rqId: rqId, skip: skip, take: take, agentUid: agentUid }, isArray: false } }).query().$promise; }; // Services this.getActivityMaterializedServicesByIds = function (ids, date, partner, rqId, prefix, mainId, sortType, currencyCode) { return $resource(prefix + '/webapi/v2/userpurchase/activitymaterializedservicesbylist', {}, { query: { method: 'POST', params: { ids: ids, mainId: mainId, date: date, rqId: rqId, partnerCode: partner, sortType: sortType, currencyCode: currencyCode }, isArray: false } }).query().$promise; }; this.getApartmentsFullInformation = function (materializedlist, prefix) { return $resource(prefix + '/webapi/v2/userpurchase/apartments', {}, { query: { method: 'POST', params: { materializeduids: materializedlist, }, isArray: true, } }).query().$promise; }; this.getActivitiesFullInformation = function (materializedlist, currencyCode, prefix) { return $resource(prefix + '/webapi/v2/userpurchase/activities', {}, { query: { method: 'POST', params: { materializeduids: materializedlist, currencyCode: currencyCode, }, isArray: true, } }).query().$promise; }; this.getActivityCoverData = function (prefix, partner, currencyCode) { return $resource(prefix + '/webapi/v2/userpurchase/activitycoverdata', {}, { query: { method: 'POST', params: { partnerCode: partner, currencyCode: currencyCode }, isArray: false } }).query().$promise; }; this.getActivityLanguages = function (prefix) { return $resource(prefix + '/webapi/v2/purchases/activityavailablelanguages', { query: { method: 'GET', params: {}, isArray: true } }).query().$promise; }; //Only addresses, streets, stablishment this.getAddressesPrediction = function (filter, placeId, prefix, session, latitude, longitude) { return $resource(prefix + '/webapi/v2/userpurchase/addressesprediction', {}, { query: { method: 'POST', params: { filter: filter, placeId: placeId, session: session, latitude: latitude, longitude: longitude }, isArray: true } }).query().$promise; }; this.getAddressesPickup = function (filter, prefix) { return $resource(prefix + '/webapi/v2/purchases/addressespickup', {}, { query: { method: 'POST', params: { filter: filter }, isArray: true } }).query().$promise; }; //Point resolution this.resolvePlace = function (placeId, prefix, session) { return $resource(prefix + '/webapi/v2/userpurchase/getplaceinfo?placeId=:placeId&sessionToken=:session', { placeId: placeId, session: session }, { query: { method: 'GET', params: {}, isArray: false } }).query().$promise; }; //Only cities/regions this.getDestinationPrediction = function (filter, prefix) { return $resource(prefix + '/webapi/v2/userpurchase/destinationprediction?filter=:filter', { filter: filter }, { query: { method: 'GET', params: {}, isArray: true } }).query().$promise; }; //Addresses and cities this.getUserPurchaseAddresses = function (filter, prefix, cityName, countryCode, serviceCode) { return $resource(prefix + '/webapi/v2/userpurchase/addresses?filter=:flt&cityName=:city&countryCode=:country&serviceCode=:srv', { flt: filter, city: cityName, country: countryCode, srv: serviceCode }, { query: { method: 'GET', params: {}, isArray: true } }).query().$promise; }; //Airports this.getAirportsToComplete = function (filter) { return $resource('/webapi/v2/userpurchase/airport?filter=:filter', { filter: filter }, { query: { method: 'GET', params: {}, isArray: true } }).query().$promise; }; //Cities/Venues this.getActivitiesDestinationPrediction = function (filter, prefix, placeId) { return $resource(prefix + '/webapi/v2/userpurchase/activitiesdestinationprediction?filter=:filter&placeId=:placeId', { filter: filter, placeId: placeId }, { query: { method: 'GET', params: {}, isArray: true } }).query().$promise; }; this.getActivitiesDestinationPredictionWhitoutRegions = function (filter, prefix, placeId) { return $resource(prefix + '/webapi/v2/userpurchase/activitiesdestinationpredictionwithoutregions?filter=:filter&placeId=:placeId', { filter: filter, placeId: placeId }, { query: { method: 'GET', params: {}, isArray: true } }).query().$promise; }; //this.getApartmentsDestinationPrediction = function (filter, prefix, placeId) { // return $resource(prefix + '/webapi/v2/userpurchase/apartmentsdestinationprediction?filter=:filter&placeId=:placeId', { filter: filter, placeId: placeId }, // { // query: { method: 'GET', params: {}, isArray: true } // }).query().$promise; //}; this.getApartmentsDestinationPrediction = function (filter, placeId, prefix, session) { return $resource(prefix + '/webapi/v2/userpurchase/apartmentsdestinationprediction?filter=:filter&placeId=:placeId&sessionToken=:session', { filter: filter, placeId: placeId, session: session }, { query: { method: 'GET', params: {}, isArray: true } }).query().$promise; }; //Internal purchase this.getPurchaseInternalAvailableServices = function (mainService, prefix) { return $resource(prefix + '/webapi/v2/internaldashboard/availableinternalservices?mainService=:srv', { srv: mainService }, { query: { method: 'GET', params: {}, isArray: true } }).query().$promise; }; this.getPurchaseInternalApartmentCategories = function (prefix) { return $resource(prefix + '/webapi/v2/internaldashboard/availableinternalapartmentcategories', { query: { method: 'GET', params: {}, isArray: true } }).query().$promise; }; this.getPuchaseInternalCurrencies = function (prefix) { return $resource(prefix + '/webapi/v2/internaldashboard/currencies', { query: { method: 'GET', params: {}, isArray: true } }).query().$promise; }; this.getFlightInfo = function (filter, date, dateArr, prefix, iataOrigin, iataDestination) { return $resource(prefix + '/webapi/v2/purchases/flightInfo', {}, { query: { method: 'POST', params: { filter: filter, departureDate: date, arrivalDate: dateArr, iataOrigin: iataOrigin, iataDestination: iataDestination }, isArray: false } }).query().$promise; }; ////// function transformGetToInt(json, headerGetter) { var fromJson = angular.fromJson({ raw: json }); return fromJson; } }]); })(); (function () { 'use strict'; var ngTabulatorHelperService = angular.module('ngTabulatorHelperService', ['ngResource']); ngTabulatorHelperService.service('TabulatorHelper', ['$resource', '$http', function ($resource) { this.setDefaultCell = function (cell) { //Put default params color for the cell. cell.addClass("tb-default-cell"); }; this.setModifiedCell = function (cell) { //Put modified color to the cell. cell.addClass("tb-modified-cell"); }; //custom header filter this.dateFilterEditor = function(cell, onRendered, success, cancel, editorParams) { var container = $("") //create and style input var selectfield = $(""); var start = $(""); var end = $(""); container.append(selectfield).append(start).append(end); var inputs = $("input", container); inputs.css({ "padding": "4px", "width": "50%", "box-sizing": "border-box", }) .val(cell.getValue()); function buildDateString() { var json = { type:selectfield.val(), start: start.val(), end: end.val() }; return JSON.stringify(json); } function buildTypeString() { var json = { type:selectfield.val()}; return JSON.stringify(json); } selectfield.change(function() { var selectvalue = selectfield.val(); if (selectvalue != "beetween_reservations") { start.val(""); end.val(""); start.hide(); end.hide(); success(buildTypeString()); } else { start.show(); end.show(); } }); //submit new value on blur inputs.on("change blur", function(e) { success(buildDateString()); }); //submit new value on enter inputs.on("keydown", function(e) { if (e.keyCode == 13) { success(buildDateString()); } if (e.keyCode == 27) { cancel(); } }); return container; }; //custom filter function this.dateFilterFunction=function(headerValue, rowValue, rowData, filterParams){ //headerValue - the value of the header filter element //rowValue - the value of the column in this row //rowData - the data for the row being filtered //filterParams - params object passed to the headerFilterFuncParams property var format = filterParams.format || "DD/MM/YYYY"; var start = moment(headerValue.start); var end = moment(headerValue.end); var value = moment(rowValue, format) if(rowValue){ if(start.isValid()){ if(end.isValid()){ return value >= start && value <= end; }else{ return value >= start; } }else{ if(end.isValid()){ return value <= end; } } } return false; //must return a boolean, true if it passes the filter. } }]); })(); (function () { 'use strict'; var ngValidationsService = angular.module('ngValidationsService', ['ngResource']); ngValidationsService.service('Validations', ['$resource', function ($resource) { this.existsUserEmail = function (email, prefix) { return $resource(prefix + '/webapi/registrationvalidation/email/:mail', { mail: email }, { get: { method: 'GET', transformResponse: transformGetToBoolean }, }).get().$promise; }; this.existsPartnerEmail = function (email, prefix) { return $resource(prefix + '/webapi/registrationpartnervalidation/email/:mail', { mail: email }, { get: { method: 'GET', transformResponse: transformGetToBoolean }, }).get().$promise; }; this.existsClientEmail = function (email, prefix) { if (email == undefined || email.length == 0) return; return $resource(prefix + '/webapi/clientregistrationvalidation/email/:mail/', { mail: email }, { get: { method: 'GET', transformResponse: transformGetToBoolean }, }).get().$promise; }; this.existsCompanyVat = function (vatnumber, prefix) { return $resource(prefix + '/webapi/registrationvalidation/vatnumber/:vatnumber', { vatnumber: vatnumber }, { get: { method: 'GET', transformResponse: transformGetToBoolean }, }).get().$promise; }; this.existsInternalUserEmail = function (email, prefix) { return $resource(prefix + '/webapi/internaluserregistrationvalidation/email/:mail', { mail: email }, { get: { method: 'GET', transformResponse: transformGetToBoolean }, }).get().$promise; }; this.existsUserEmailInternalDashboard = function (email, prefix) { return $resource(prefix + '/webapi/registerprofessionalvalidation/email/:mail', { mail: email }, { get: { method: 'GET', transformResponse: transformGetToBoolean }, }).get().$promise; }; this.existsDiscountCode = function (code, prefix) { return $resource(prefix + '/webapi/internaldiscountvalidation/discountCode/:discountCode', { discountCode: code }, { get: { method: 'GET', transformResponse: transformGetToBoolean }, }).get().$promise; }; }]); function transformGetToBoolean(json, headerGetter) { var fromJson = angular.fromJson({ raw: (json === "true") }); return fromJson; } })();