thm-p3-configurator 0.0.305 → 0.0.306

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -121,6 +121,24 @@ function _toPrimitive(t, r) {
121
121
  return ("string" === r ? String : Number)(t);
122
122
  }
123
123
  const licensePlateValidator = new _LicensePlateValidator.default();
124
+
125
+ // Empty customer state template
126
+ const getEmptyCustomerState = () => ({
127
+ firstName: '',
128
+ infix: '',
129
+ lastName: '',
130
+ email: '',
131
+ phoneNumber: '',
132
+ zipCode: '',
133
+ houseNumber: '',
134
+ houseNumberAddition: '',
135
+ streetName: '',
136
+ city: '',
137
+ companyName: '',
138
+ kvkNumber: '',
139
+ vatNumber: '',
140
+ countryId: ''
141
+ });
124
142
  const internalQuotationFormSchema = (0, _yup.object)({
125
143
  ownershipType: (0, _yup.string)().required(_constants__.FORM_ERROR_MESSAGES.required),
126
144
  leaseNumber: (0, _yup.string)().nullable(),
@@ -162,7 +180,7 @@ const InternalQuotationForm = _ref => {
162
180
  } = _ref;
163
181
  const [{
164
182
  vehicle,
165
- customer,
183
+ customer: contextCustomer,
166
184
  licensePlate,
167
185
  licensePlateBrandModel,
168
186
  model,
@@ -191,6 +209,97 @@ const InternalQuotationForm = _ref => {
191
209
  const [errors, setErrors] = (0, _react.useState)({});
192
210
  const [companySearchTerm, setCompanySearchTerm] = (0, _react.useState)('');
193
211
  const [isCompanyInputFocused, setIsCompanyInputFocused] = (0, _react.useState)(false);
212
+ const [refreshKey, setRefreshKey] = (0, _react.useState)(Date.now());
213
+
214
+ // Track the original ownership type from context
215
+ const [originalOwnershipType] = (0, _react.useState)(() => (vehicle === null || vehicle === void 0 ? void 0 : vehicle.ownershipType) || _constants__.VEHICLE_OWNERSHIP_TYPE.Particulier);
216
+
217
+ // Current active ownership type (local state for tab switching)
218
+ const [activeOwnershipType, setActiveOwnershipType] = (0, _react.useState)(originalOwnershipType);
219
+
220
+ // Separate customer state for each ownership type
221
+ const [customerDataPerType, setCustomerDataPerType] = (0, _react.useState)(() => {
222
+ const emptyState = getEmptyCustomerState();
223
+ const initialCustomerData = {
224
+ firstName: (contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.firstName) || '',
225
+ infix: (contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.infix) || '',
226
+ lastName: (contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.lastName) || '',
227
+ email: (contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.email) || '',
228
+ phoneNumber: (contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.phoneNumber) || '',
229
+ zipCode: (contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.zipCode) || '',
230
+ houseNumber: (contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.houseNumber) || '',
231
+ houseNumberAddition: (contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.houseNumberAddition) || '',
232
+ streetName: (contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.streetName) || '',
233
+ city: (contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.city) || '',
234
+ companyName: (contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.companyName) || '',
235
+ kvkNumber: (contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.kvkNumber) || '',
236
+ vatNumber: (contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.vatNumber) || '',
237
+ countryId: (contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.countryId) || ''
238
+ };
239
+
240
+ // Only the original ownership type gets the initial data
241
+ return {
242
+ [_constants__.VEHICLE_OWNERSHIP_TYPE.Particulier]: originalOwnershipType === _constants__.VEHICLE_OWNERSHIP_TYPE.Particulier ? _objectSpread({}, initialCustomerData) : _objectSpread({}, emptyState),
243
+ [_constants__.VEHICLE_OWNERSHIP_TYPE.Zakelijk]: originalOwnershipType === _constants__.VEHICLE_OWNERSHIP_TYPE.Zakelijk ? _objectSpread({}, initialCustomerData) : _objectSpread({}, emptyState),
244
+ [_constants__.VEHICLE_OWNERSHIP_TYPE.Leasemaatschappij]: originalOwnershipType === _constants__.VEHICLE_OWNERSHIP_TYPE.Leasemaatschappij ? _objectSpread({}, initialCustomerData) : _objectSpread({}, emptyState)
245
+ };
246
+ });
247
+
248
+ // Get customer data for the active ownership type
249
+ const customer = customerDataPerType[activeOwnershipType];
250
+
251
+ // Helper to update customer data for the active ownership type
252
+ const updateCustomerField = (0, _react.useCallback)((field, value) => {
253
+ setCustomerDataPerType(prev => _objectSpread(_objectSpread({}, prev), {}, {
254
+ [activeOwnershipType]: _objectSpread(_objectSpread({}, prev[activeOwnershipType]), {}, {
255
+ [field]: value
256
+ })
257
+ }));
258
+ }, [activeOwnershipType]);
259
+
260
+ // Sync active ownership type to context when it changes
261
+ (0, _react.useEffect)(() => {
262
+ if (activeOwnershipType !== (vehicle === null || vehicle === void 0 ? void 0 : vehicle.ownershipType)) {
263
+ dispatch({
264
+ type: _OrderSessionContext.orderSessionActions.SET_VEHICLE_OWNERSHIP_TYPE,
265
+ payload: {
266
+ ownershipType: activeOwnershipType
267
+ }
268
+ });
269
+ }
270
+ }, [activeOwnershipType, vehicle === null || vehicle === void 0 ? void 0 : vehicle.ownershipType, dispatch]);
271
+
272
+ // Sync customer data to context when it changes (for the active tab)
273
+ (0, _react.useEffect)(() => {
274
+ const currentData = customerDataPerType[activeOwnershipType];
275
+ const actionMap = {
276
+ firstName: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_FIRST_NAME,
277
+ infix: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_INFIX,
278
+ lastName: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_LAST_NAME,
279
+ email: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_EMAIL,
280
+ phoneNumber: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_PHONE_NUMBER,
281
+ zipCode: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_ZIP_CODE,
282
+ houseNumber: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_HOUSE_NUMBER,
283
+ houseNumberAddition: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_HOUSE_NUMBER_ADDITION,
284
+ streetName: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_STREET_NAME,
285
+ city: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_CITY,
286
+ companyName: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_COMPANY_NAME,
287
+ kvkNumber: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_KVK_NUMBER,
288
+ vatNumber: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_VAT_NUMBER,
289
+ countryId: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_COUNTRY_ID
290
+ };
291
+ Object.entries(currentData).forEach(_ref2 => {
292
+ let [field, value] = _ref2;
293
+ if (actionMap[field]) {
294
+ dispatch({
295
+ type: actionMap[field],
296
+ payload: {
297
+ [field]: value
298
+ }
299
+ });
300
+ }
301
+ });
302
+ }, [activeOwnershipType, customerDataPerType, dispatch]);
194
303
  const [_licensePlate, _setLicensePlate] = (0, _react.useState)(licensePlate);
195
304
  const isTmg = (0, _useIsTmg.useIsTmg)();
196
305
  const {
@@ -237,7 +346,7 @@ const InternalQuotationForm = _ref => {
237
346
  isTowCenterBranch,
238
347
  searchTerm: companySearchTerm,
239
348
  formula,
240
- ownershipType: vehicle === null || vehicle === void 0 ? void 0 : vehicle.ownershipType,
349
+ ownershipType: activeOwnershipType,
241
350
  organisationType: branchType
242
351
  });
243
352
  const countryOptions = (0, _react.useMemo)(() => {
@@ -308,7 +417,7 @@ const InternalQuotationForm = _ref => {
308
417
  */
309
418
  const handleSubmit = async () => {
310
419
  try {
311
- var _customer$firstName, _customer$lastName, _customer$phoneNumber, _customer$houseNumber, _customer$houseNumber2, _customer$streetName, _customer$countryId, _customer$city, _customer$email, _customer$note, _customer$zipCode, _customer$companyName, _ref2;
420
+ var _customer$firstName, _customer$lastName, _customer$phoneNumber, _customer$houseNumber, _customer$houseNumber2, _customer$streetName, _customer$countryId, _customer$city, _customer$email, _customer$note, _customer$zipCode, _customer$companyName, _ref3;
312
421
  setErrors(null);
313
422
  if (!model) {
314
423
  // Note: this does not throw on error.
@@ -322,7 +431,7 @@ const InternalQuotationForm = _ref => {
322
431
  }
323
432
 
324
433
  // Validate lease number for lease company vehicles
325
- if ((vehicle === null || vehicle === void 0 ? void 0 : vehicle.ownershipType) === _constants__.VEHICLE_OWNERSHIP_TYPE.Leasemaatschappij) {
434
+ if (activeOwnershipType === _constants__.VEHICLE_OWNERSHIP_TYPE.Leasemaatschappij) {
326
435
  if ((!(vehicle !== null && vehicle !== void 0 && vehicle.leaseNumber) || (vehicle === null || vehicle === void 0 ? void 0 : vehicle.leaseNumber) === '') && !(vehicle !== null && vehicle !== void 0 && vehicle.leaseNumberUnknown)) {
327
436
  setErrors(prev => _objectSpread(_objectSpread({}, prev), {}, {
328
437
  leaseNumber: _constants__.FORM_ERROR_MESSAGES.leaseNumber || 'Goedkeuringsnummer is verplicht of geef aan dat het onbekend is'
@@ -365,7 +474,7 @@ const InternalQuotationForm = _ref => {
365
474
  })),
366
475
  chassisNumber: chassisNumber !== null && chassisNumber !== void 0 ? chassisNumber : undefined,
367
476
  channel,
368
- licensePlate: (_ref2 = licensePlate || _licensePlate) === null || _ref2 === void 0 ? void 0 : _ref2.replace(/-/g, ''),
477
+ licensePlate: (_ref3 = licensePlate || _licensePlate) === null || _ref3 === void 0 ? void 0 : _ref3.replace(/-/g, ''),
369
478
  model,
370
479
  answers: (0, _helpers__.removeNullishProps)({
371
480
  duration: durationAnswer,
@@ -425,79 +534,11 @@ const InternalQuotationForm = _ref => {
425
534
  input.value = '';
426
535
  });
427
536
 
428
- // Display success message
429
- setClearSuccess(true);
430
-
431
- // Hide success message after 2 seconds
432
- setTimeout(() => {
433
- setClearSuccess(false);
434
- }, 2000);
435
- dispatch({
436
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_FIRST_NAME,
437
- payload: {
438
- firstName: ''
439
- }
440
- });
441
- dispatch({
442
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_INFIX,
443
- payload: {
444
- infix: ''
445
- }
446
- });
447
- dispatch({
448
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_LAST_NAME,
449
- payload: {
450
- lastName: ''
451
- }
452
- });
453
- dispatch({
454
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_EMAIL,
455
- payload: {
456
- email: ''
457
- }
458
- });
459
- dispatch({
460
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_PHONE_NUMBER,
461
- payload: {
462
- phoneNumber: ''
463
- }
464
- });
465
- dispatch({
466
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_ZIP_CODE,
467
- payload: {
468
- zipCode: ''
469
- }
470
- });
471
- dispatch({
472
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_HOUSE_NUMBER,
473
- payload: {
474
- houseNumber: ''
475
- }
476
- });
477
- dispatch({
478
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_HOUSE_NUMBER_ADDITION,
479
- payload: {
480
- houseNumberAddition: ''
481
- }
482
- });
483
- dispatch({
484
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_STREET_NAME,
485
- payload: {
486
- streetName: ''
487
- }
488
- });
489
- dispatch({
490
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_CITY,
491
- payload: {
492
- city: ''
493
- }
494
- });
495
- dispatch({
496
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_COMPANY_NAME,
497
- payload: {
498
- companyName: ''
499
- }
500
- });
537
+ // Clear all customer fields in the local state for the active ownership type
538
+ const emptyState = getEmptyCustomerState();
539
+ setCustomerDataPerType(prev => _objectSpread(_objectSpread({}, prev), {}, {
540
+ [activeOwnershipType]: emptyState
541
+ }));
501
542
  };
502
543
  return /*#__PURE__*/_react.default.createElement("div", {
503
544
  className: (0, _helpers__.withStyle)('row gx-5 mt-3 mt-lg-5')
@@ -526,12 +567,12 @@ const InternalQuotationForm = _ref => {
526
567
  placeholder: "Maak een keuze",
527
568
  errorMessage: (errors === null || errors === void 0 ? void 0 : errors['channelId']) || (errors === null || errors === void 0 ? void 0 : errors['channelType']),
528
569
  initialValue: initialChannel,
529
- onChange: _ref3 => {
570
+ onChange: _ref4 => {
530
571
  var _value$kanaalType;
531
572
  let {
532
573
  label,
533
574
  value
534
- } = _ref3;
575
+ } = _ref4;
535
576
  return dispatch({
536
577
  type: _OrderSessionContext.orderSessionActions.SET_MARKETING_CHANNEL,
537
578
  payload: {
@@ -546,14 +587,10 @@ const InternalQuotationForm = _ref => {
546
587
  name: "ownershipType",
547
588
  form: "quotation",
548
589
  label: "Type:",
549
- initialValue: vehicle === null || vehicle === void 0 ? void 0 : vehicle.ownershipType,
590
+ initialValue: activeOwnershipType,
550
591
  onChange: val => {
551
- dispatch({
552
- type: _OrderSessionContext.orderSessionActions.SET_VEHICLE_OWNERSHIP_TYPE,
553
- payload: {
554
- ownershipType: val
555
- }
556
- });
592
+ // Switch to the new ownership type - each type maintains its own separate state
593
+ setActiveOwnershipType(val);
557
594
  },
558
595
  options: Object.values(_constants__.VEHICLE_OWNERSHIP_TYPE),
559
596
  isRequired: true,
@@ -562,7 +599,7 @@ const InternalQuotationForm = _ref => {
562
599
  className: (0, _helpers__.withStyle)('my-2')
563
600
  }, "Persoonlijke gegevens"), /*#__PURE__*/_react.default.createElement("div", {
564
601
  className: (0, _helpers__.withStyle)('col-12 mb-2')
565
- }, (vehicle === null || vehicle === void 0 ? void 0 : vehicle.ownershipType) === _constants__.VEHICLE_OWNERSHIP_TYPE.Zakelijk && /*#__PURE__*/_react.default.createElement("div", {
602
+ }, activeOwnershipType === _constants__.VEHICLE_OWNERSHIP_TYPE.Zakelijk && /*#__PURE__*/_react.default.createElement("div", {
566
603
  className: (0, _helpers__.withStyle)('company-search-container position-relative mb-3')
567
604
  }, /*#__PURE__*/_react.default.createElement(_TextInput.default, {
568
605
  placeholder: "Placeholderbedrijf",
@@ -579,12 +616,7 @@ const InternalQuotationForm = _ref => {
579
616
  name: "companyName",
580
617
  onChange: value => {
581
618
  // Update company name in state
582
- dispatch({
583
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_COMPANY_NAME,
584
- payload: {
585
- companyName: value
586
- }
587
- });
619
+ updateCustomerField('companyName', value);
588
620
 
589
621
  // Also update search term if value is different
590
622
  if (value !== companySearchTerm) {
@@ -630,77 +662,32 @@ const InternalQuotationForm = _ref => {
630
662
  onMouseDown: e => {
631
663
  var _branch$vatNumber, _branch$kvkNumber;
632
664
  e.preventDefault();
633
- dispatch({
634
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_COMPANY_NAME,
635
- payload: {
636
- companyName: branch.name
637
- }
638
- });
665
+ updateCustomerField('companyName', branch.name);
639
666
  if (branch.postalCode) {
640
- dispatch({
641
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_ZIP_CODE,
642
- payload: {
643
- zipCode: branch.postalCode
644
- }
645
- });
667
+ updateCustomerField('zipCode', branch.postalCode);
646
668
  }
647
669
  if (branch.street) {
648
- dispatch({
649
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_STREET_NAME,
650
- payload: {
651
- streetName: branch.street
652
- }
653
- });
670
+ updateCustomerField('streetName', branch.street);
654
671
  }
655
672
  if (branch.city) {
656
- dispatch({
657
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_CITY,
658
- payload: {
659
- city: branch.city
660
- }
661
- });
673
+ updateCustomerField('city', branch.city);
662
674
  }
663
675
  if (branch.street2) {
664
- dispatch({
665
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_HOUSE_NUMBER,
666
- payload: {
667
- houseNumber: branch.street2
668
- }
669
- });
676
+ updateCustomerField('houseNumber', branch.street2);
670
677
  }
671
678
  const vatNumber = (_branch$vatNumber = branch.vatNumber) !== null && _branch$vatNumber !== void 0 ? _branch$vatNumber : branch.btwNummer;
672
679
  if (vatNumber) {
673
- dispatch({
674
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_VAT_NUMBER,
675
- payload: {
676
- vatNumber
677
- }
678
- });
680
+ updateCustomerField('vatNumber', vatNumber);
679
681
  }
680
682
  const kvkNumber = (_branch$kvkNumber = branch.kvkNumber) !== null && _branch$kvkNumber !== void 0 ? _branch$kvkNumber : branch.kvkNummer;
681
683
  if (kvkNumber) {
682
- dispatch({
683
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_KVK_NUMBER,
684
- payload: {
685
- kvkNumber
686
- }
687
- });
684
+ updateCustomerField('kvkNumber', kvkNumber);
688
685
  }
689
686
  if (branch.huisnummerToevoeging) {
690
- dispatch({
691
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_HOUSE_NUMBER_ADDITION,
692
- payload: {
693
- houseNumberAddition: branch.huisnummerToevoeging
694
- }
695
- });
687
+ updateCustomerField('houseNumberAddition', branch.huisnummerToevoeging);
696
688
  }
697
689
  if (branch.country && branch.country.entityId) {
698
- dispatch({
699
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_COUNTRY_ID,
700
- payload: {
701
- countryId: branch.country.entityId
702
- }
703
- });
690
+ updateCustomerField('countryId', branch.country.entityId);
704
691
  setRefreshKey(Date.now());
705
692
  }
706
693
  setCompanySearchTerm('');
@@ -710,12 +697,7 @@ const InternalQuotationForm = _ref => {
710
697
  placeholder: "",
711
698
  value: customer.firstName,
712
699
  name: "firstName",
713
- onChange: value => dispatch({
714
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_FIRST_NAME,
715
- payload: {
716
- firstName: value
717
- }
718
- }),
700
+ onChange: value => updateCustomerField('firstName', value),
719
701
  isRequired: true,
720
702
  form: "quotation",
721
703
  label: "Voornaam:",
@@ -724,12 +706,7 @@ const InternalQuotationForm = _ref => {
724
706
  placeholder: "",
725
707
  value: customer.infix,
726
708
  name: "infix",
727
- onChange: value => dispatch({
728
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_INFIX,
729
- payload: {
730
- infix: value
731
- }
732
- }),
709
+ onChange: value => updateCustomerField('infix', value),
733
710
  isRequired: false,
734
711
  form: "quotation",
735
712
  label: "Tussenvoegsel:",
@@ -738,12 +715,7 @@ const InternalQuotationForm = _ref => {
738
715
  placeholder: "",
739
716
  value: customer.lastName,
740
717
  name: "lastName",
741
- onChange: value => dispatch({
742
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_LAST_NAME,
743
- payload: {
744
- lastName: value
745
- }
746
- }),
718
+ onChange: value => updateCustomerField('lastName', value),
747
719
  isRequired: true,
748
720
  form: "quotation",
749
721
  label: "Achternaam:",
@@ -752,17 +724,12 @@ const InternalQuotationForm = _ref => {
752
724
  placeholder: "",
753
725
  value: customer.email,
754
726
  name: "email",
755
- onChange: value => dispatch({
756
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_EMAIL,
757
- payload: {
758
- email: value
759
- }
760
- }),
727
+ onChange: value => updateCustomerField('email', value),
761
728
  isRequired: true,
762
729
  form: "quotation",
763
730
  label: "E-mailadres:",
764
731
  errorMessage: errors === null || errors === void 0 ? void 0 : errors['email']
765
- }), (vehicle === null || vehicle === void 0 ? void 0 : vehicle.ownershipType) === _constants__.VEHICLE_OWNERSHIP_TYPE.Leasemaatschappij && /*#__PURE__*/_react.default.createElement("div", {
732
+ }), activeOwnershipType === _constants__.VEHICLE_OWNERSHIP_TYPE.Leasemaatschappij && /*#__PURE__*/_react.default.createElement("div", {
766
733
  className: (0, _helpers__.withStyle)('company-search-container position-relative mt-2 mb-2')
767
734
  }, /*#__PURE__*/_react.default.createElement(_TextInput.default, {
768
735
  placeholder: "Zoek leasemaatschappijen...",
@@ -770,12 +737,7 @@ const InternalQuotationForm = _ref => {
770
737
  name: "companyName",
771
738
  onChange: value => {
772
739
  // Update company name in state
773
- dispatch({
774
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_COMPANY_NAME,
775
- payload: {
776
- companyName: value
777
- }
778
- });
740
+ updateCustomerField('companyName', value);
779
741
 
780
742
  // Also update search term if value is different
781
743
  if (value !== companySearchTerm) {
@@ -835,12 +797,7 @@ const InternalQuotationForm = _ref => {
835
797
  placeholder: "",
836
798
  value: customer.phoneNumber,
837
799
  name: "phoneNumber",
838
- onChange: value => dispatch({
839
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_PHONE_NUMBER,
840
- payload: {
841
- phoneNumber: value
842
- }
843
- }),
800
+ onChange: value => updateCustomerField('phoneNumber', value),
844
801
  isRequired: true,
845
802
  form: "quotation",
846
803
  label: "Telefoonnummer:",
@@ -853,7 +810,7 @@ const InternalQuotationForm = _ref => {
853
810
  className: (0, _helpers__.withStyle)('modal-title col-12 mb-2')
854
811
  }, "Gegevens van de auto ", /*#__PURE__*/_react.default.createElement("br", null)), /*#__PURE__*/_react.default.createElement("div", {
855
812
  className: (0, _helpers__.withStyle)('col-12')
856
- }, (vehicle === null || vehicle === void 0 ? void 0 : vehicle.ownershipType) === _constants__.VEHICLE_OWNERSHIP_TYPE.Leasemaatschappij && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_TextInput.default, {
813
+ }, activeOwnershipType === _constants__.VEHICLE_OWNERSHIP_TYPE.Leasemaatschappij && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_TextInput.default, {
857
814
  placeholder: "",
858
815
  value: vehicle === null || vehicle === void 0 ? void 0 : vehicle.leaseNumber,
859
816
  name: "leaseNumber",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thm-p3-configurator",
3
- "version": "0.0.305",
3
+ "version": "0.0.306",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "author": "EnoRm.",