text changes to registration mail content
[namibia] / public / js / app / brochure-workspace / customercompletevaluation.js
1 ;(function(){
2
3     window._w.customercompletevaluation = {
4
5         itemId : null,
6         itemData : null,
7         formMeta : null,
8         ti : null,
9         limited : false,
10         newItem : false,
11         validations : 0,
12         highestOfferId : false,
13         priceGuideId : false,
14         publicCentreList : {},
15         currentStep : 1,
16
17         onCustomerCompleteValuationViewTemplateReady : function( template, event, eventData )
18         {
19             //console.log('onCustomerCompleteValuationViewTemplateReady');
20
21             _w.customercompletevaluation.itemData = null;
22             _w.customercompletevaluation.ti = _t[template];
23             _w.customercompletevaluation.limited = false;
24             // Retrieve initial view data.
25             _w.customercompletevaluation.itemId = 0;
26
27             var customerHash = App.Util.getUrlParam('customer');
28             //console.log('hash', customerHash);
29
30             App.Ajax.JSON({
31                     "url"  : 'workspace/complete-valuation-get-customer',
32                     "data" : {'customerHash' : customerHash}
33                 },
34                 $.proxy(function(response) {
35
36                     console.log('response',response);
37
38                     if(response.Error)
39                     {
40                         alert(response.Error);
41                         return;
42                     }
43
44                     _w.customercompletevaluation.itemId = response.Success.valuationId;
45                     App.API.getTask(
46                         'updateValuation:' + _w.customercompletevaluation.itemId, 'Valuation', 'Valuation.UpdateCompleteCustomerPublic', null,
47                         {'id':_w.customercompletevaluation.itemId}, $.proxy( _w.customercompletevaluation._onCustomerCompleteValuationViewDataReceived, this ), _w.taskContractError
48                     );
49
50
51                     App.Ajax.JSON({
52                             "url"  : 'workspace/populate-complete-valuation-appointment-table',
53                             "data" : {'currentPosition' : '0','valuationId' : _w.customercompletevaluation.itemId}
54                         },
55                         $.proxy(function(response) {
56                             $('#completeValuationGridColumnHeaders').html(response.outputTableHeader);
57                             $('#completeValuationGridRowRepeater').html(response.outputTableBody);
58
59
60                         },this),
61                         $.proxy(function(response) {
62                             console.log('App.Notification.remove Error', response);
63                         },this)
64                     );
65
66                 },this),
67                 $.proxy(function(response) {
68                     console.log('App.Notification.remove Error', response);
69                 },this)
70             );
71
72
73             _w.customercompletevaluation.setValuationViewFormMeta();
74             _w.customercompletevaluation.ti.hydrate(_w.customercompletevaluation.formMeta);
75
76
77             _w.customercompletevaluation.newItem = true;
78             _w.customercompletevaluation.itemData = {stock:{}};
79             App.API.getTask(
80                 'createCustomerValuation', 'Valuation', 'Valuation.CreateCompleteCustomerPublic',
81                 null, {}, function(){}, _w.taskContractError
82             );
83         },
84
85         onCustomerCompleteValuationViewPublished : function( template, event, eventData )
86         {
87
88             App.API.getTask(
89                 'createCustomerValuation', 'Valuation', 'Valuation.CreateCompleteCustomerPublic',
90                 null, {}, function(){}, _w.taskContractError
91             );
92
93             $('#table-form-actions-prev').click(function () {
94
95                 App.Ajax.JSON({
96                         "url"  : 'workspace/populate-complete-valuation-appointment-table',
97                         "data" : {'currentPosition' : '-1','valuationId' : _w.customercompletevaluation.itemId}
98                     },
99                     $.proxy(function(response) {
100
101                         //console.log('response',response.outputTableHeader);
102
103                         $('#completeValuationGridColumnHeaders').html(response.outputTableHeader);
104
105                         $('#completeValuationGridRowRepeater').html(response.outputTableBody);
106
107
108                     },this),
109                     $.proxy(function(response) {
110                         console.log('App.Notification.remove Error', response);
111                     },this)
112                 );
113             });
114
115             $('#table-form-actions-next').click(function () {
116
117                 App.Ajax.JSON({
118                         "url"  : 'workspace/populate-complete-valuation-appointment-table',
119                         "data" : {'currentPosition' : '+1','valuationId' : _w.customercompletevaluation.itemId}
120                     },
121                     $.proxy(function(response) {
122
123                         //console.log('response',response.outputTableHeader);
124
125                         $('#completeValuationGridColumnHeaders').html(response.outputTableHeader);
126
127                         $('#completeValuationGridRowRepeater').html(response.outputTableBody);
128
129
130                     },this),
131                     $.proxy(function(response) {
132                         console.log('App.Notification.remove Error', response);
133                     },this)
134                 );
135             });
136
137
138
139             // Do a check here for the ie browser - if ie show upload file buttons
140             // IE browsers prevent submitting files when the input field didn't receive a direct click
141
142             if(navigator.appVersion.indexOf("MSIE ")!=-1)
143             {
144                 $('#terms').parent().addClass("IE");
145             }
146
147
148             _w.customercompletevaluation.limited = false;
149             _w.customercompletevaluation._setupValidation();
150
151             $('.back-btn').on('click', function(){
152                 window.history.back();
153             });
154
155             $('#btnContinue1').click(function () {
156
157                 $('.btn-next').click();
158             });
159
160             $('#btnContinue2').click(function () {
161
162                 $('.btn-next').click();
163             });
164
165             $('#btnContinue3').click(function () {
166
167             });
168             $('#btnContinue4').click(function () {
169                 //$('#frmCustomerCompleteValuationView').submit();
170                 _w.customercompletevaluation._setupValidation();
171
172
173                 var data = _w.customercompletevaluation._prepValuationUpdateData();
174
175                 console.log('updateValuation '  + _w.customercompletevaluation.itemId + ' data',data);
176
177                 App.API.execTask(
178                     'updateValuation:' + _w.customercompletevaluation.itemId, data, {},
179                     _w.customercompletevaluation._onValuationUpdated,
180                     _w.customercompletevaluation._onValuationFail
181                 );
182             });
183             $('.btn-prev').click($.proxy(function () {
184                 _w.customercompletevaluation.currentStep--;
185             }, this));
186             //$('.btn-next').click($.proxy(function () {
187             //    console.log('button .btn-next','click');
188             //
189             //    $('.btn-next').prop('disabled', true);
190             //    _w.customercompletevaluation.currentStep++;
191             //    //_w.customercompletevaluation.validatePage(_w.customercompletevaluation.currentStep);
192             //}, this));
193
194             $('.btn-next').click($.proxy(function () {
195                 //console.log('button .btn-next','click');
196                 //console.log('button .btn-next _w.customervaluation.currentStep',_w.customervaluation.currentStep);
197                 $('.btn-next').prop('disabled', true);
198                 _w.customercompletevaluation.currentStep++;
199                 //_w.customercompletevaluation.validatePage(_w.customercompletevaluation.currentStep);
200             }, this));
201
202             $('#btnContinue2').hide();
203             $('#btnContinue3').hide();
204
205             $('#btnContinue4').prop('disabled', true);
206
207             $('#terms').change($.proxy(function () {
208
209                 if($('#terms').is(':checked'))
210                 {
211                     $('#btnContinue4').prop('disabled', false);
212                 }
213                 else
214                 {
215                     $('#btnContinue4').prop('disabled', true);
216                 }
217             }, this));
218
219         },
220
221         _onCustomerCompleteValuationViewDataReceived : function( response )
222         {
223             console.log('response.Data',response.Data);
224
225             _w.customercompletevaluation.itemId = response.Data.id;
226             _w.customercompletevaluation.itemData = response.Data;
227             _w.customercompletevaluation.setValuationViewFormMeta(response.Data);
228             _w.customercompletevaluation.ti.hydratePartial(_w.customercompletevaluation.formMeta);
229             if (_w.customercompletevaluation.ti.published)
230             {
231                 _w.customercompletevaluation._setupValidation();
232             }
233         },
234
235         goToNext : function(profile,dateNo,valuatorNo)
236         {
237             //console.log('profile',profile);
238             //console.log('dateNo',dateNo);
239
240             App.Ajax.JSON({
241                     "url"  : 'workspace/populate-complete-valuation-appointment-time-table',
242                     "data" : {'profileId' : profile,'dateNo' : dateNo,'valuatorNo' : valuatorNo}
243                 },
244                 $.proxy(function(response) {
245
246                     //console.log('goToNext response',response);
247
248
249                     $('#valuatorSelected').val(profile);
250                     $('#dateSelected').val(response.dateSelected);
251
252                     $('#completeValuationGridColumnHeadersTime').html(response.outputTableHeader);
253
254                     $('#completeValuationGridRowRepeaterTime').html(response.outputTableBody);
255
256                     $('.btn-next').click();
257
258                 },this),
259                 $.proxy(function(response) {
260                     console.log('App.Notification.remove Error', response);
261                 },this)
262             );
263         },
264
265         goToFinish : function(timeSlotId,timeSlot)
266         {
267             //console.log('timeSlot',timeSlot);
268
269             $('#timeSelected').val(timeSlot);
270             $('#timeIdSelected').val(timeSlotId);
271
272             var rules1 = {
273                 firstName: {required: true, minlength: 3},
274                 familyName: {required: true, minlength: 3},
275                 email: {required: true, email: true},
276                 mobile: {required: true, mobile: true},
277                 customerAddressStreet: {required: true},
278                 customerAddressStreetName: {required: true},
279                 customerAddressSuburb: {required: true},
280                 customerAddressCity: {required: true},
281                 customerAddressPostalCode: { required: true, digits: true }
282             };
283             $('#frmCustomerCompleteValuationView').validate({
284                 "rules": rules1,
285                 messages: {
286                     firstName: {
287                         minlength: "This field is required."
288                     },
289                     familyName: {
290                         minlength: "This field is required."
291                     },
292                     email: {
293                         required: "This field is required.",
294                         email: "Please enter a valid<br/>email address."
295                     },
296                     customerAddressStreet : "This field is required.",
297                     customerAddressStreetName : "This field is required.",
298                     customerAddressSuburb : "This field is required.",
299                     customerAddressCity : "This field is required.",
300                     customerAddressPostalCode : {required: "This field is required."}
301                 },
302                 invalidHandler: function(event, validator) {
303                     var errors = validator.numberOfInvalids();
304                     if (0 < _w.customercompletevaluation.validations && errors) {
305                         var message = errors == 1
306                             ? 'You missed 1 field. It has been highlighted'
307                             : 'You missed ' + errors + ' fields. They have been highlighted';
308                         alert(message);
309                     }
310                     _w.customercompletevaluation.validations++;
311                 },
312                 submitHandler: function( form ) {
313                     return;
314                 }
315             });
316             try {
317                 _w.customercompletevaluation.validations = 0;
318                 var formValid = $('#frmCustomerCompleteValuationView').valid();
319
320                 if(formValid)
321                 {
322                     var confirmationOfpublicDealer = $('#publicDealer').val();
323                     var confirmationOfpublicDealerContactNumber = $('#publicDealerContactNumber').val();
324
325                     var confirmationOffirstName = $('#firstName').val();
326                     var confirmationOffamilyName = $('#familyName').val();
327                     var confirmationOfmobile = $('#mobile').val();
328                     var confirmationOfemail = $('#email').val();
329
330                     var confirmationOfcustomerAddressStreet = $('#customerAddressStreet').val();
331                     var confirmationOfpublicustomerAddressStreetName = $('#customerAddressStreetName').val();
332                     var confirmationOfcustomerAddressSuburb = $('#customerAddressSuburb').val();
333                     var confirmationOfcustomerAddressCity = $('#customerAddressCity').val();
334                     var confirmationOfcustomerAddressPostalCode = $('#customerAddressPostalCode').val();
335
336                     var confirmationOfdateSelected = $('#dateSelected').val();
337                     var confirmationOftimeSelected = $('#timeSelected').val();
338
339                     var confirmationOfInfoHtml =
340                         '<div class="span12">'
341                         + '<h3>'
342                         + confirmationOfpublicDealer
343                         + ' ('
344                         + confirmationOfpublicDealerContactNumber
345                         + ')'
346                         + '</h3>'
347
348                         + '<br>'
349                         + '<br>'
350
351                         + '<h4>Date / Time:<h4>'
352                         + '<br>'
353                         + '<h5>' + confirmationOfdateSelected + '</h5>'
354                         + '<h5>' + confirmationOftimeSelected + '</h5>'
355
356                         + '<br>'
357                         + '<br>'
358
359                         + '<h4>Your Address:<h4>'
360                         + '<br>'
361                         + '<h5>' + confirmationOfcustomerAddressStreet + '</h5>'
362                         + '<h5>' + confirmationOfpublicustomerAddressStreetName + '</h5>'
363                         + '<h5>' + confirmationOfcustomerAddressSuburb + '</h5>'
364                         + '<h5>' + confirmationOfcustomerAddressCity + '</h5>'
365                         + '<h5>' + confirmationOfcustomerAddressPostalCode + '</h5>'
366
367                         + '<br>'
368                         + '<br>'
369
370                         + '<h4>Email:<h4>'
371                         + '<br>'
372                         + '<h5>' + confirmationOfemail + '</h5>'
373                         + '</div>';
374
375                     $('#confirmationOfInfo').html(confirmationOfInfoHtml);
376
377                     $('.btn-next').click();
378                 }
379
380             } catch(err) {}
381             $('label.error').remove();
382             $('.valid').removeClass('valid');
383
384             //$('.btn-next').click();
385         },
386
387         validatePage : function(step)
388         {
389             //console.log('validatePage step',step)
390
391             var errors = false;
392
393             switch (step)
394             {
395                 case 1:
396                     var fields = {
397                         '#firstName': true,
398                         '#familyName': true,
399                         '#email': true,
400                         '#mobile': true,
401                         '#customerAddressStreet': true,
402                         '#customerAddressStreetName': true,
403                         '#customerAddressSuburb': true,
404                         '#customerAddressCity': true,
405                         '#customerAddressPostalCode': true
406                     };
407                     break;
408             }
409
410             for (var field in fields)
411             {
412                 if ('' !== $(field).val() && null !== $(field).val())
413                 {
414                     if (!$(field).valid())
415                     {
416                         $('.btn-next').prop('disabled', true);
417                         $('#btnContinue' + step).prop('disabled', true);
418                         return;
419                     }
420                 }
421                 else if (fields[field])
422                 {
423                     $('.btn-next').prop('disabled', true);
424                     $('#btnContinue' + step).prop('disabled', true);
425                     return;
426                 }
427
428             }
429
430             $('.btn-next').prop('disabled', false);
431             $('#btnContinue' + step).prop('disabled', false);
432
433         },
434
435         setValuationViewFormMeta : function(data)
436         {
437             if (!data)
438             {
439                 data = {"stock":{}};
440             }
441             else
442             {
443                 $('#vehicleYear').val(data.stock.vehicleYear);
444                 $('#registrationNumber').val(data.stock.registrationNumber);
445                 $('#fuelType').val(data.stock.fuelType);
446                 $('#transmissionType').val(data.stock.transmissionType);
447
448                 $('#publicDealer').val(data.stock.company.name);
449                 $('#publicDealerContactNumber').val(null != data.stock.company.contact.office && '' != data.stock.company.contact.office ? data.stock.company.contact.office : data.stock.company.contact.mobile);
450             }
451
452             //console.log('data',data);
453
454             _w.customercompletevaluation.formMeta = {
455                 'firstName' : {
456                     type  : 'input',
457                     id    : 'firstName',
458                     title : 'Name',
459                     value : data.firstName ? data.firstName : '',
460                     onChange    : function (evt) {
461                         var value = $(evt.currentTarget).val();
462                         if (null == value || '' == value)
463                         {
464                             return;
465                         }
466                         _w.customercompletevaluation.validatePage(1);
467                     }
468                 },
469                 'familyName' : {
470                     type  : 'input',
471                     id    : 'familyName',
472                     title : 'Surname',
473                     value : data.familyName ? data.familyName : '',
474                     onChange    : function (evt) {
475                         var value = $(evt.currentTarget).val();
476                         if (null == value || '' == value)
477                         {
478                             return;
479                         }
480                         _w.customercompletevaluation.validatePage(1);
481                     }
482                 },
483                 'email' : {
484                     type  : 'input',
485                     id    : 'email',
486                     title : 'Email address',
487                     value : data.email ? data.email : '',
488                     onChange    : function (evt) {
489                         var value = $(evt.currentTarget).val();
490                         if (null == value || '' == value)
491                         {
492                             return;
493                         }
494                         _w.customercompletevaluation.validatePage(1);
495                     }
496                 },
497                 'mobile' : {
498                     type  : 'mobile',
499                     id    : 'mobile',
500                     title : 'Mobile',
501                     value : data.mobile ? data.mobile : '',
502                     onChange    : function (evt) {
503                         var value = $(evt.currentTarget).val();
504                         if (null == value || '' == value)
505                         {
506                             return;
507                         }
508                         _w.customercompletevaluation.validatePage(1);
509                     }
510                 },
511                 'customerAddressStreet' : {
512                     type  : 'input',
513                     id    : 'customerAddressStreet',
514                     title : 'Street/Unit/Building No',
515                     value : data.customerAddressStreet ? data.customerAddressStreet : '',
516                     onChange    : function (evt) {
517                         var value = $(evt.currentTarget).val();
518                         if (null == value || '' == value)
519                         {
520                             return;
521                         }
522                         _w.customercompletevaluation.validatePage(1);
523                     }
524                 },
525                 'customerAddressStreetName' : {
526                     type  : 'input',
527                     id    : 'customerAddressStreetName',
528                     title : 'Street Name',
529                     value : data.customerAddressStreetName ? data.customerAddressStreetName : '',
530                     onChange    : function (evt) {
531                         var value = $(evt.currentTarget).val();
532                         if (null == value || '' == value)
533                         {
534                             return;
535                         }
536                         _w.customercompletevaluation.validatePage(1);
537                     }
538                 },
539                 'customerAddressSuburb' : {
540                     type  : 'input',
541                     id    : 'customerAddressSuburb',
542                     title : 'Suburb / District',
543                     value : data.customerAddressSuburb ? data.customerAddressSuburb : '',
544                     onChange    : function (evt) {
545                         var value = $(evt.currentTarget).val();
546                         if (null == value || '' == value)
547                         {
548                             return;
549                         }
550                         _w.customercompletevaluation.validatePage(1);
551                     }
552                 },
553                 'customerAddressCity' : {
554                     type  : 'input',
555                     id    : 'customerAddressCity',
556                     title : 'City / Town',
557                     value : data.customerAddressCity ? data.customerAddressCity : '',
558                     onChange    : function (evt) {
559                         var value = $(evt.currentTarget).val();
560                         if (null == value || '' == value)
561                         {
562                             return;
563                         }
564                         _w.customercompletevaluation.validatePage(1);
565                     }
566                 },
567                 'customerAddressPostalCode' : {
568                     type  : 'input',
569                     id    : 'customerAddressPostalCode',
570                     title : 'Postal Code',
571                     value : data.customerAddressPostalCode ? data.customerAddressPostalCode : '',
572                     onChange    : function (evt) {
573                         var value = $(evt.currentTarget).val();
574                         if (null == value || '' == value)
575                         {
576                             return;
577                         }
578                         _w.customercompletevaluation.validatePage(1);
579                     }
580                 }
581             };
582         },
583
584         _listMakesModelsTypes : function( fromItemData, callback )
585         {
586         },
587
588         _setupValidation : function ()
589         {
590             var rules = {
591                 firstName: {required: true, minlength: 3},
592                 familyName: {required: true, minlength: 3},
593                 email: {required: true, email: true},
594                 mobile: {required: true, mobile: true},
595                 customerAddressStreet: {required: true},
596                 customerAddressStreetName: {required: true},
597                 customerAddressSuburb: {required: true},
598                 customerAddressCity: {required: true},
599                 customerAddressPostalCode: { required: true, digits: true }
600             };
601             $('#frmCustomerCompleteValuationView').validate({
602                 "rules": rules,
603                 messages: {
604                     firstName: {
605                         minlength: "This field is required."
606                     },
607                     familyName: {
608                         minlength: "This field is required."
609                     },
610                     email: {
611                         required: "This field is required.",
612                         email: "Please enter a valid<br/>email address."
613                     },
614                     customerAddressStreet : "This field is required.",
615                     customerAddressStreetName : "This field is required.",
616                     customerAddressSuburb : "This field is required.",
617                     customerAddressCity : "This field is required.",
618                     customerAddressPostalCode : {required: "This field is required."}
619                 },
620                 invalidHandler: function(event, validator) {
621                     var errors = validator.numberOfInvalids();
622                     if (0 < _w.customercompletevaluation.validations && errors) {
623                         var message = errors == 1
624                             ? 'You missed 1 field. It has been highlighted'
625                             : 'You missed ' + errors + ' fields. They have been highlighted';
626                         alert(message);
627                     }
628                     _w.customercompletevaluation.validations++;
629                 },
630                 submitHandler: function( form ) {
631                     return;
632                 }
633             });
634             try {
635                 _w.customercompletevaluation.validations = 0;
636                 $('#frmCustomerCompleteValuationView').valid();
637             } catch(err) {}
638             $('label.error').remove();
639             $('.valid').removeClass('valid');
640         },
641
642
643         _prepValuationUpdateData : function()
644         {
645             function isValidEmailAddress(emailAddress) {
646                 var pattern = new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i);
647                 return pattern.test(emailAddress);
648             };
649
650             var data = _w.customercompletevaluation.ti.harvest();
651
652             data.valuatorId = $('#valuatorSelected').val();
653             data.dateSelected = $('#dateSelected').val();
654             data.timeIdSelected = $('#timeIdSelected').val();
655             data.vehicleYear = $('#vehicleYear').val();
656             data.registrationNumber = $('#registrationNumber').val();
657             data.fuelType = $('#fuelType').val();
658             data.transmissionType = $('#transmissionType').val();
659
660             //console.log('data',data);
661
662             var postData = {Stock:{}, Valuation:{}};
663             var valuationFields = [
664                 "firstName","familyName","mobile", "email", "customerAddressStreet", "customerAddressStreetName", "customerAddressSuburb", "customerAddressCity", "customerAddressPostalCode"
665             ];
666             for (var field in data)
667             {
668                 if (-1 == valuationFields.indexOf(field))
669                 {
670                     postData.Stock[field] = data[field];
671                 }
672                 else
673                 {
674                     postData.Valuation[field] = data[field];
675                 }
676             }
677
678
679             if( !isValidEmailAddress( postData.Valuation.email ) )
680             {
681                 testEmail = postData.Valuation.email;
682                 //console.log("went through check", testEmail);
683                 postData.Valuation.email = null;
684             }
685
686
687             postData.Valuation.valuatorSelected = data.valuatorId;
688             postData.Valuation.dateSelected = data.dateSelected;
689             postData.Valuation.timeIdSelected = data.timeIdSelected;
690
691             if ('' == postData.Valuation.email)
692             {
693                 postData.Valuation.email = null;
694             }
695
696             return postData;
697         },
698
699         _onValuationUpdated : function( response )
700         {
701             //alert('Your vehicle has successfully been submitted.');
702             window.location.hash = '/thankyouvaluation';
703
704             //send customer valuation email
705         },
706         _onValuationFail : function( response )
707         {
708             console.log('_onValuationFail response',response);
709
710             alert('Oops, something went wrong, please check your data carefully and try again.');
711             //window.location.hash = '/public-landing';
712         }
713
714     };
715
716 })();