6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit 7a655b88

AuthorEdmir Suljic<esu@dwarf.dk>
Date2026-02-27 14:20:35 +0100
updated prereg model

Changed files

.../cubit/preregistration_state.freezed.dart       | 43 +++++++++++----------
 .../pregistration/cubit/preregistration_cubit.dart | 45 +++++++++-------------
 .../pregistration/cubit/preregistration_state.dart |  1 +
 .../pregistration/pages/prereg_profile_page.dart   |  4 +-
 .../pregistration/prereg_request_model.dart        | 30 ++++++++++++++-
 5 files changed, 73 insertions(+), 50 deletions(-)

Diff

diff --git a/comwell_key_app/lib/.generated/presentation/screens/pregistration/cubit/preregistration_state.freezed.dart b/comwell_key_app/lib/.generated/presentation/screens/pregistration/cubit/preregistration_state.freezed.dart
index fb39c98e..62173409 100644
--- a/comwell_key_app/lib/.generated/presentation/screens/pregistration/cubit/preregistration_state.freezed.dart
+++ b/comwell_key_app/lib/.generated/presentation/screens/pregistration/cubit/preregistration_state.freezed.dart
@@ -14,7 +14,7 @@ T _$identity<T>(T value) => value;
/// @nodoc
mixin _$PreregistrationState {
- bool get isLoading; bool get selected; List<AddOnUpgrade> get addOnUpgrades; List<RoomUpgrade> get availableRoomUpgrades; String get selectedRoomUpgrade; bool get missingInformation; int get extrasTotalPrice; bool get termsAndConditionsAccepted; bool get forceUpdate; User? get user; CountryCode? get countryCode; String get selectedCountry; String? get phoneNumber; bool get isPhoneNumberValid; bool get isFirstNameValid; bool get isLastNameValid; bool get isAddressValid; bool get isPostalCodeValid; bool get isCityValid; bool get isBirthDateValid; String get selectedDocumentType; StoredPaymentMethod? get selectedPaymentMethod; TimeOfDay? get servingTime; AppError get error;
+ bool get isLoading; bool get selected; List<AddOnUpgrade> get addOnUpgrades; List<RoomUpgrade> get availableRoomUpgrades; String get selectedRoomUpgrade; bool get missingInformation; int get extrasTotalPrice; bool get termsAndConditionsAccepted; bool get forceUpdate; User? get user; CountryCode? get countryCode; String get selectedCountry; CountryCode? get nationalityCode; String? get phoneNumber; bool get isPhoneNumberValid; bool get isFirstNameValid; bool get isLastNameValid; bool get isAddressValid; bool get isPostalCodeValid; bool get isCityValid; bool get isBirthDateValid; String get selectedDocumentType; StoredPaymentMethod? get selectedPaymentMethod; TimeOfDay? get servingTime; AppError get error;
/// Create a copy of PreregistrationState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@@ -25,16 +25,16 @@ $PreregistrationStateCopyWith<PreregistrationState> get copyWith => _$Preregistr
@override
bool operator ==(Object other) {
- return identical(this, other) || (other.runtimeType == runtimeType&&other is PreregistrationState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.selected, selected) || other.selected == selected)&&const DeepCollectionEquality().equals(other.addOnUpgrades, addOnUpgrades)&&const DeepCollectionEquality().equals(other.availableRoomUpgrades, availableRoomUpgrades)&&(identical(other.selectedRoomUpgrade, selectedRoomUpgrade) || other.selectedRoomUpgrade == selectedRoomUpgrade)&&(identical(other.missingInformation, missingInformation) || other.missingInformation == missingInformation)&&(identical(other.extrasTotalPrice, extrasTotalPrice) || other.extrasTotalPrice == extrasTotalPrice)&&(identical(other.termsAndConditionsAccepted, termsAndConditionsAccepted) || other.termsAndConditionsAccepted == termsAndConditionsAccepted)&&(identical(other.forceUpdate, forceUpdate) || other.forceUpdate == forceUpdate)&&(identical(other.user, user) || other.user == user)&&(identical(other.countryCode, countryCode) || other.countryCode == countryCode)&&(identical(other.selectedCountry, selectedCountry) || other.selectedCountry == selectedCountry)&&(identical(other.phoneNumber, phoneNumber) || other.phoneNumber == phoneNumber)&&(identical(other.isPhoneNumberValid, isPhoneNumberValid) || other.isPhoneNumberValid == isPhoneNumberValid)&&(identical(other.isFirstNameValid, isFirstNameValid) || other.isFirstNameValid == isFirstNameValid)&&(identical(other.isLastNameValid, isLastNameValid) || other.isLastNameValid == isLastNameValid)&&(identical(other.isAddressValid, isAddressValid) || other.isAddressValid == isAddressValid)&&(identical(other.isPostalCodeValid, isPostalCodeValid) || other.isPostalCodeValid == isPostalCodeValid)&&(identical(other.isCityValid, isCityValid) || other.isCityValid == isCityValid)&&(identical(other.isBirthDateValid, isBirthDateValid) || other.isBirthDateValid == isBirthDateValid)&&(identical(other.selectedDocumentType, selectedDocumentType) || other.selectedDocumentType == selectedDocumentType)&&(identical(other.selectedPaymentMethod, selectedPaymentMethod) || other.selectedPaymentMethod == selectedPaymentMethod)&&(identical(other.servingTime, servingTime) || other.servingTime == servingTime)&&(identical(other.error, error) || other.error == error));
+ return identical(this, other) || (other.runtimeType == runtimeType&&other is PreregistrationState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.selected, selected) || other.selected == selected)&&const DeepCollectionEquality().equals(other.addOnUpgrades, addOnUpgrades)&&const DeepCollectionEquality().equals(other.availableRoomUpgrades, availableRoomUpgrades)&&(identical(other.selectedRoomUpgrade, selectedRoomUpgrade) || other.selectedRoomUpgrade == selectedRoomUpgrade)&&(identical(other.missingInformation, missingInformation) || other.missingInformation == missingInformation)&&(identical(other.extrasTotalPrice, extrasTotalPrice) || other.extrasTotalPrice == extrasTotalPrice)&&(identical(other.termsAndConditionsAccepted, termsAndConditionsAccepted) || other.termsAndConditionsAccepted == termsAndConditionsAccepted)&&(identical(other.forceUpdate, forceUpdate) || other.forceUpdate == forceUpdate)&&(identical(other.user, user) || other.user == user)&&(identical(other.countryCode, countryCode) || other.countryCode == countryCode)&&(identical(other.selectedCountry, selectedCountry) || other.selectedCountry == selectedCountry)&&(identical(other.nationalityCode, nationalityCode) || other.nationalityCode == nationalityCode)&&(identical(other.phoneNumber, phoneNumber) || other.phoneNumber == phoneNumber)&&(identical(other.isPhoneNumberValid, isPhoneNumberValid) || other.isPhoneNumberValid == isPhoneNumberValid)&&(identical(other.isFirstNameValid, isFirstNameValid) || other.isFirstNameValid == isFirstNameValid)&&(identical(other.isLastNameValid, isLastNameValid) || other.isLastNameValid == isLastNameValid)&&(identical(other.isAddressValid, isAddressValid) || other.isAddressValid == isAddressValid)&&(identical(other.isPostalCodeValid, isPostalCodeValid) || other.isPostalCodeValid == isPostalCodeValid)&&(identical(other.isCityValid, isCityValid) || other.isCityValid == isCityValid)&&(identical(other.isBirthDateValid, isBirthDateValid) || other.isBirthDateValid == isBirthDateValid)&&(identical(other.selectedDocumentType, selectedDocumentType) || other.selectedDocumentType == selectedDocumentType)&&(identical(other.selectedPaymentMethod, selectedPaymentMethod) || other.selectedPaymentMethod == selectedPaymentMethod)&&(identical(other.servingTime, servingTime) || other.servingTime == servingTime)&&(identical(other.error, error) || other.error == error));
}
@override
-int get hashCode => Object.hashAll([runtimeType,isLoading,selected,const DeepCollectionEquality().hash(addOnUpgrades),const DeepCollectionEquality().hash(availableRoomUpgrades),selectedRoomUpgrade,missingInformation,extrasTotalPrice,termsAndConditionsAccepted,forceUpdate,user,countryCode,selectedCountry,phoneNumber,isPhoneNumberValid,isFirstNameValid,isLastNameValid,isAddressValid,isPostalCodeValid,isCityValid,isBirthDateValid,selectedDocumentType,selectedPaymentMethod,servingTime,error]);
+int get hashCode => Object.hashAll([runtimeType,isLoading,selected,const DeepCollectionEquality().hash(addOnUpgrades),const DeepCollectionEquality().hash(availableRoomUpgrades),selectedRoomUpgrade,missingInformation,extrasTotalPrice,termsAndConditionsAccepted,forceUpdate,user,countryCode,selectedCountry,nationalityCode,phoneNumber,isPhoneNumberValid,isFirstNameValid,isLastNameValid,isAddressValid,isPostalCodeValid,isCityValid,isBirthDateValid,selectedDocumentType,selectedPaymentMethod,servingTime,error]);
@override
String toString() {
- return 'PreregistrationState(isLoading: $isLoading, selected: $selected, addOnUpgrades: $addOnUpgrades, availableRoomUpgrades: $availableRoomUpgrades, selectedRoomUpgrade: $selectedRoomUpgrade, missingInformation: $missingInformation, extrasTotalPrice: $extrasTotalPrice, termsAndConditionsAccepted: $termsAndConditionsAccepted, forceUpdate: $forceUpdate, user: $user, countryCode: $countryCode, selectedCountry: $selectedCountry, phoneNumber: $phoneNumber, isPhoneNumberValid: $isPhoneNumberValid, isFirstNameValid: $isFirstNameValid, isLastNameValid: $isLastNameValid, isAddressValid: $isAddressValid, isPostalCodeValid: $isPostalCodeValid, isCityValid: $isCityValid, isBirthDateValid: $isBirthDateValid, selectedDocumentType: $selectedDocumentType, selectedPaymentMethod: $selectedPaymentMethod, servingTime: $servingTime, error: $error)';
+ return 'PreregistrationState(isLoading: $isLoading, selected: $selected, addOnUpgrades: $addOnUpgrades, availableRoomUpgrades: $availableRoomUpgrades, selectedRoomUpgrade: $selectedRoomUpgrade, missingInformation: $missingInformation, extrasTotalPrice: $extrasTotalPrice, termsAndConditionsAccepted: $termsAndConditionsAccepted, forceUpdate: $forceUpdate, user: $user, countryCode: $countryCode, selectedCountry: $selectedCountry, nationalityCode: $nationalityCode, phoneNumber: $phoneNumber, isPhoneNumberValid: $isPhoneNumberValid, isFirstNameValid: $isFirstNameValid, isLastNameValid: $isLastNameValid, isAddressValid: $isAddressValid, isPostalCodeValid: $isPostalCodeValid, isCityValid: $isCityValid, isBirthDateValid: $isBirthDateValid, selectedDocumentType: $selectedDocumentType, selectedPaymentMethod: $selectedPaymentMethod, servingTime: $servingTime, error: $error)';
}
@@ -45,7 +45,7 @@ abstract mixin class $PreregistrationStateCopyWith<$Res> {
factory $PreregistrationStateCopyWith(PreregistrationState value, $Res Function(PreregistrationState) _then) = _$PreregistrationStateCopyWithImpl;
@useResult
$Res call({
- bool isLoading, bool selected, List<AddOnUpgrade> addOnUpgrades, List<RoomUpgrade> availableRoomUpgrades, String selectedRoomUpgrade, bool missingInformation, int extrasTotalPrice, bool termsAndConditionsAccepted, bool forceUpdate, User? user, CountryCode? countryCode, String selectedCountry, String? phoneNumber, bool isPhoneNumberValid, bool isFirstNameValid, bool isLastNameValid, bool isAddressValid, bool isPostalCodeValid, bool isCityValid, bool isBirthDateValid, String selectedDocumentType, StoredPaymentMethod? selectedPaymentMethod, TimeOfDay? servingTime, AppError error
+ bool isLoading, bool selected, List<AddOnUpgrade> addOnUpgrades, List<RoomUpgrade> availableRoomUpgrades, String selectedRoomUpgrade, bool missingInformation, int extrasTotalPrice, bool termsAndConditionsAccepted, bool forceUpdate, User? user, CountryCode? countryCode, String selectedCountry, CountryCode? nationalityCode, String? phoneNumber, bool isPhoneNumberValid, bool isFirstNameValid, bool isLastNameValid, bool isAddressValid, bool isPostalCodeValid, bool isCityValid, bool isBirthDateValid, String selectedDocumentType, StoredPaymentMethod? selectedPaymentMethod, TimeOfDay? servingTime, AppError error
});
@@ -62,7 +62,7 @@ class _$PreregistrationStateCopyWithImpl<$Res>
/// Create a copy of PreregistrationState
/// with the given fields replaced by the non-null parameter values.
-@pragma('vm:prefer-inline') @override $Res call({Object? isLoading = null,Object? selected = null,Object? addOnUpgrades = null,Object? availableRoomUpgrades = null,Object? selectedRoomUpgrade = null,Object? missingInformation = null,Object? extrasTotalPrice = null,Object? termsAndConditionsAccepted = null,Object? forceUpdate = null,Object? user = freezed,Object? countryCode = freezed,Object? selectedCountry = null,Object? phoneNumber = freezed,Object? isPhoneNumberValid = null,Object? isFirstNameValid = null,Object? isLastNameValid = null,Object? isAddressValid = null,Object? isPostalCodeValid = null,Object? isCityValid = null,Object? isBirthDateValid = null,Object? selectedDocumentType = null,Object? selectedPaymentMethod = freezed,Object? servingTime = freezed,Object? error = null,}) {
+@pragma('vm:prefer-inline') @override $Res call({Object? isLoading = null,Object? selected = null,Object? addOnUpgrades = null,Object? availableRoomUpgrades = null,Object? selectedRoomUpgrade = null,Object? missingInformation = null,Object? extrasTotalPrice = null,Object? termsAndConditionsAccepted = null,Object? forceUpdate = null,Object? user = freezed,Object? countryCode = freezed,Object? selectedCountry = null,Object? nationalityCode = freezed,Object? phoneNumber = freezed,Object? isPhoneNumberValid = null,Object? isFirstNameValid = null,Object? isLastNameValid = null,Object? isAddressValid = null,Object? isPostalCodeValid = null,Object? isCityValid = null,Object? isBirthDateValid = null,Object? selectedDocumentType = null,Object? selectedPaymentMethod = freezed,Object? servingTime = freezed,Object? error = null,}) {
return _then(_self.copyWith(
isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
as bool,selected: null == selected ? _self.selected : selected // ignore: cast_nullable_to_non_nullable
@@ -76,7 +76,8 @@ as bool,forceUpdate: null == forceUpdate ? _self.forceUpdate : forceUpdate // ig
as bool,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable
as User?,countryCode: freezed == countryCode ? _self.countryCode : countryCode // ignore: cast_nullable_to_non_nullable
as CountryCode?,selectedCountry: null == selectedCountry ? _self.selectedCountry : selectedCountry // ignore: cast_nullable_to_non_nullable
-as String,phoneNumber: freezed == phoneNumber ? _self.phoneNumber : phoneNumber // ignore: cast_nullable_to_non_nullable
+as String,nationalityCode: freezed == nationalityCode ? _self.nationalityCode : nationalityCode // ignore: cast_nullable_to_non_nullable
+as CountryCode?,phoneNumber: freezed == phoneNumber ? _self.phoneNumber : phoneNumber // ignore: cast_nullable_to_non_nullable
as String?,isPhoneNumberValid: null == isPhoneNumberValid ? _self.isPhoneNumberValid : isPhoneNumberValid // ignore: cast_nullable_to_non_nullable
as bool,isFirstNameValid: null == isFirstNameValid ? _self.isFirstNameValid : isFirstNameValid // ignore: cast_nullable_to_non_nullable
as bool,isLastNameValid: null == isLastNameValid ? _self.isLastNameValid : isLastNameValid // ignore: cast_nullable_to_non_nullable
@@ -185,10 +186,10 @@ return $default(_that);case _:
/// }
/// ```
-@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool isLoading, bool selected, List<AddOnUpgrade> addOnUpgrades, List<RoomUpgrade> availableRoomUpgrades, String selectedRoomUpgrade, bool missingInformation, int extrasTotalPrice, bool termsAndConditionsAccepted, bool forceUpdate, User? user, CountryCode? countryCode, String selectedCountry, String? phoneNumber, bool isPhoneNumberValid, bool isFirstNameValid, bool isLastNameValid, bool isAddressValid, bool isPostalCodeValid, bool isCityValid, bool isBirthDateValid, String selectedDocumentType, StoredPaymentMethod? selectedPaymentMethod, TimeOfDay? servingTime, AppError error)? $default,{required TResult orElse(),}) {final _that = this;
+@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool isLoading, bool selected, List<AddOnUpgrade> addOnUpgrades, List<RoomUpgrade> availableRoomUpgrades, String selectedRoomUpgrade, bool missingInformation, int extrasTotalPrice, bool termsAndConditionsAccepted, bool forceUpdate, User? user, CountryCode? countryCode, String selectedCountry, CountryCode? nationalityCode, String? phoneNumber, bool isPhoneNumberValid, bool isFirstNameValid, bool isLastNameValid, bool isAddressValid, bool isPostalCodeValid, bool isCityValid, bool isBirthDateValid, String selectedDocumentType, StoredPaymentMethod? selectedPaymentMethod, TimeOfDay? servingTime, AppError error)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _PreregistrationState() when $default != null:
-return $default(_that.isLoading,_that.selected,_that.addOnUpgrades,_that.availableRoomUpgrades,_that.selectedRoomUpgrade,_that.missingInformation,_that.extrasTotalPrice,_that.termsAndConditionsAccepted,_that.forceUpdate,_that.user,_that.countryCode,_that.selectedCountry,_that.phoneNumber,_that.isPhoneNumberValid,_that.isFirstNameValid,_that.isLastNameValid,_that.isAddressValid,_that.isPostalCodeValid,_that.isCityValid,_that.isBirthDateValid,_that.selectedDocumentType,_that.selectedPaymentMethod,_that.servingTime,_that.error);case _:
+return $default(_that.isLoading,_that.selected,_that.addOnUpgrades,_that.availableRoomUpgrades,_that.selectedRoomUpgrade,_that.missingInformation,_that.extrasTotalPrice,_that.termsAndConditionsAccepted,_that.forceUpdate,_that.user,_that.countryCode,_that.selectedCountry,_that.nationalityCode,_that.phoneNumber,_that.isPhoneNumberValid,_that.isFirstNameValid,_that.isLastNameValid,_that.isAddressValid,_that.isPostalCodeValid,_that.isCityValid,_that.isBirthDateValid,_that.selectedDocumentType,_that.selectedPaymentMethod,_that.servingTime,_that.error);case _:
return orElse();
}
@@ -206,10 +207,10 @@ return $default(_that.isLoading,_that.selected,_that.addOnUpgrades,_that.availab
/// }
/// ```
-@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool isLoading, bool selected, List<AddOnUpgrade> addOnUpgrades, List<RoomUpgrade> availableRoomUpgrades, String selectedRoomUpgrade, bool missingInformation, int extrasTotalPrice, bool termsAndConditionsAccepted, bool forceUpdate, User? user, CountryCode? countryCode, String selectedCountry, String? phoneNumber, bool isPhoneNumberValid, bool isFirstNameValid, bool isLastNameValid, bool isAddressValid, bool isPostalCodeValid, bool isCityValid, bool isBirthDateValid, String selectedDocumentType, StoredPaymentMethod? selectedPaymentMethod, TimeOfDay? servingTime, AppError error) $default,) {final _that = this;
+@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool isLoading, bool selected, List<AddOnUpgrade> addOnUpgrades, List<RoomUpgrade> availableRoomUpgrades, String selectedRoomUpgrade, bool missingInformation, int extrasTotalPrice, bool termsAndConditionsAccepted, bool forceUpdate, User? user, CountryCode? countryCode, String selectedCountry, CountryCode? nationalityCode, String? phoneNumber, bool isPhoneNumberValid, bool isFirstNameValid, bool isLastNameValid, bool isAddressValid, bool isPostalCodeValid, bool isCityValid, bool isBirthDateValid, String selectedDocumentType, StoredPaymentMethod? selectedPaymentMethod, TimeOfDay? servingTime, AppError error) $default,) {final _that = this;
switch (_that) {
case _PreregistrationState():
-return $default(_that.isLoading,_that.selected,_that.addOnUpgrades,_that.availableRoomUpgrades,_that.selectedRoomUpgrade,_that.missingInformation,_that.extrasTotalPrice,_that.termsAndConditionsAccepted,_that.forceUpdate,_that.user,_that.countryCode,_that.selectedCountry,_that.phoneNumber,_that.isPhoneNumberValid,_that.isFirstNameValid,_that.isLastNameValid,_that.isAddressValid,_that.isPostalCodeValid,_that.isCityValid,_that.isBirthDateValid,_that.selectedDocumentType,_that.selectedPaymentMethod,_that.servingTime,_that.error);case _:
+return $default(_that.isLoading,_that.selected,_that.addOnUpgrades,_that.availableRoomUpgrades,_that.selectedRoomUpgrade,_that.missingInformation,_that.extrasTotalPrice,_that.termsAndConditionsAccepted,_that.forceUpdate,_that.user,_that.countryCode,_that.selectedCountry,_that.nationalityCode,_that.phoneNumber,_that.isPhoneNumberValid,_that.isFirstNameValid,_that.isLastNameValid,_that.isAddressValid,_that.isPostalCodeValid,_that.isCityValid,_that.isBirthDateValid,_that.selectedDocumentType,_that.selectedPaymentMethod,_that.servingTime,_that.error);case _:
throw StateError('Unexpected subclass');
}
@@ -226,10 +227,10 @@ return $default(_that.isLoading,_that.selected,_that.addOnUpgrades,_that.availab
/// }
/// ```
-@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool isLoading, bool selected, List<AddOnUpgrade> addOnUpgrades, List<RoomUpgrade> availableRoomUpgrades, String selectedRoomUpgrade, bool missingInformation, int extrasTotalPrice, bool termsAndConditionsAccepted, bool forceUpdate, User? user, CountryCode? countryCode, String selectedCountry, String? phoneNumber, bool isPhoneNumberValid, bool isFirstNameValid, bool isLastNameValid, bool isAddressValid, bool isPostalCodeValid, bool isCityValid, bool isBirthDateValid, String selectedDocumentType, StoredPaymentMethod? selectedPaymentMethod, TimeOfDay? servingTime, AppError error)? $default,) {final _that = this;
+@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool isLoading, bool selected, List<AddOnUpgrade> addOnUpgrades, List<RoomUpgrade> availableRoomUpgrades, String selectedRoomUpgrade, bool missingInformation, int extrasTotalPrice, bool termsAndConditionsAccepted, bool forceUpdate, User? user, CountryCode? countryCode, String selectedCountry, CountryCode? nationalityCode, String? phoneNumber, bool isPhoneNumberValid, bool isFirstNameValid, bool isLastNameValid, bool isAddressValid, bool isPostalCodeValid, bool isCityValid, bool isBirthDateValid, String selectedDocumentType, StoredPaymentMethod? selectedPaymentMethod, TimeOfDay? servingTime, AppError error)? $default,) {final _that = this;
switch (_that) {
case _PreregistrationState() when $default != null:
-return $default(_that.isLoading,_that.selected,_that.addOnUpgrades,_that.availableRoomUpgrades,_that.selectedRoomUpgrade,_that.missingInformation,_that.extrasTotalPrice,_that.termsAndConditionsAccepted,_that.forceUpdate,_that.user,_that.countryCode,_that.selectedCountry,_that.phoneNumber,_that.isPhoneNumberValid,_that.isFirstNameValid,_that.isLastNameValid,_that.isAddressValid,_that.isPostalCodeValid,_that.isCityValid,_that.isBirthDateValid,_that.selectedDocumentType,_that.selectedPaymentMethod,_that.servingTime,_that.error);case _:
+return $default(_that.isLoading,_that.selected,_that.addOnUpgrades,_that.availableRoomUpgrades,_that.selectedRoomUpgrade,_that.missingInformation,_that.extrasTotalPrice,_that.termsAndConditionsAccepted,_that.forceUpdate,_that.user,_that.countryCode,_that.selectedCountry,_that.nationalityCode,_that.phoneNumber,_that.isPhoneNumberValid,_that.isFirstNameValid,_that.isLastNameValid,_that.isAddressValid,_that.isPostalCodeValid,_that.isCityValid,_that.isBirthDateValid,_that.selectedDocumentType,_that.selectedPaymentMethod,_that.servingTime,_that.error);case _:
return null;
}
@@ -241,7 +242,7 @@ return $default(_that.isLoading,_that.selected,_that.addOnUpgrades,_that.availab
class _PreregistrationState implements PreregistrationState {
- const _PreregistrationState({this.isLoading = false, this.selected = false, final List<AddOnUpgrade> addOnUpgrades = const [], final List<RoomUpgrade> availableRoomUpgrades = const [], this.selectedRoomUpgrade = '', this.missingInformation = false, this.extrasTotalPrice = 0, this.termsAndConditionsAccepted = false, this.forceUpdate = false, this.user = null, this.countryCode = null, this.selectedCountry = '', this.phoneNumber = null, this.isPhoneNumberValid = false, this.isFirstNameValid = false, this.isLastNameValid = false, this.isAddressValid = false, this.isPostalCodeValid = false, this.isCityValid = false, this.isBirthDateValid = false, this.selectedDocumentType = '', this.selectedPaymentMethod = null, this.servingTime = null, this.error = AppError.none}): _addOnUpgrades = addOnUpgrades,_availableRoomUpgrades = availableRoomUpgrades;
+ const _PreregistrationState({this.isLoading = false, this.selected = false, final List<AddOnUpgrade> addOnUpgrades = const [], final List<RoomUpgrade> availableRoomUpgrades = const [], this.selectedRoomUpgrade = '', this.missingInformation = false, this.extrasTotalPrice = 0, this.termsAndConditionsAccepted = false, this.forceUpdate = false, this.user = null, this.countryCode = null, this.selectedCountry = '', this.nationalityCode = null, this.phoneNumber = null, this.isPhoneNumberValid = false, this.isFirstNameValid = false, this.isLastNameValid = false, this.isAddressValid = false, this.isPostalCodeValid = false, this.isCityValid = false, this.isBirthDateValid = false, this.selectedDocumentType = '', this.selectedPaymentMethod = null, this.servingTime = null, this.error = AppError.none}): _addOnUpgrades = addOnUpgrades,_availableRoomUpgrades = availableRoomUpgrades;
@override@JsonKey() final bool isLoading;
@@ -268,6 +269,7 @@ class _PreregistrationState implements PreregistrationState {
@override@JsonKey() final User? user;
@override@JsonKey() final CountryCode? countryCode;
@override@JsonKey() final String selectedCountry;
+@override@JsonKey() final CountryCode? nationalityCode;
@override@JsonKey() final String? phoneNumber;
@override@JsonKey() final bool isPhoneNumberValid;
@override@JsonKey() final bool isFirstNameValid;
@@ -291,16 +293,16 @@ _$PreregistrationStateCopyWith<_PreregistrationState> get copyWith => __$Preregi
@override
bool operator ==(Object other) {
- return identical(this, other) || (other.runtimeType == runtimeType&&other is _PreregistrationState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.selected, selected) || other.selected == selected)&&const DeepCollectionEquality().equals(other._addOnUpgrades, _addOnUpgrades)&&const DeepCollectionEquality().equals(other._availableRoomUpgrades, _availableRoomUpgrades)&&(identical(other.selectedRoomUpgrade, selectedRoomUpgrade) || other.selectedRoomUpgrade == selectedRoomUpgrade)&&(identical(other.missingInformation, missingInformation) || other.missingInformation == missingInformation)&&(identical(other.extrasTotalPrice, extrasTotalPrice) || other.extrasTotalPrice == extrasTotalPrice)&&(identical(other.termsAndConditionsAccepted, termsAndConditionsAccepted) || other.termsAndConditionsAccepted == termsAndConditionsAccepted)&&(identical(other.forceUpdate, forceUpdate) || other.forceUpdate == forceUpdate)&&(identical(other.user, user) || other.user == user)&&(identical(other.countryCode, countryCode) || other.countryCode == countryCode)&&(identical(other.selectedCountry, selectedCountry) || other.selectedCountry == selectedCountry)&&(identical(other.phoneNumber, phoneNumber) || other.phoneNumber == phoneNumber)&&(identical(other.isPhoneNumberValid, isPhoneNumberValid) || other.isPhoneNumberValid == isPhoneNumberValid)&&(identical(other.isFirstNameValid, isFirstNameValid) || other.isFirstNameValid == isFirstNameValid)&&(identical(other.isLastNameValid, isLastNameValid) || other.isLastNameValid == isLastNameValid)&&(identical(other.isAddressValid, isAddressValid) || other.isAddressValid == isAddressValid)&&(identical(other.isPostalCodeValid, isPostalCodeValid) || other.isPostalCodeValid == isPostalCodeValid)&&(identical(other.isCityValid, isCityValid) || other.isCityValid == isCityValid)&&(identical(other.isBirthDateValid, isBirthDateValid) || other.isBirthDateValid == isBirthDateValid)&&(identical(other.selectedDocumentType, selectedDocumentType) || other.selectedDocumentType == selectedDocumentType)&&(identical(other.selectedPaymentMethod, selectedPaymentMethod) || other.selectedPaymentMethod == selectedPaymentMethod)&&(identical(other.servingTime, servingTime) || other.servingTime == servingTime)&&(identical(other.error, error) || other.error == error));
+ return identical(this, other) || (other.runtimeType == runtimeType&&other is _PreregistrationState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.selected, selected) || other.selected == selected)&&const DeepCollectionEquality().equals(other._addOnUpgrades, _addOnUpgrades)&&const DeepCollectionEquality().equals(other._availableRoomUpgrades, _availableRoomUpgrades)&&(identical(other.selectedRoomUpgrade, selectedRoomUpgrade) || other.selectedRoomUpgrade == selectedRoomUpgrade)&&(identical(other.missingInformation, missingInformation) || other.missingInformation == missingInformation)&&(identical(other.extrasTotalPrice, extrasTotalPrice) || other.extrasTotalPrice == extrasTotalPrice)&&(identical(other.termsAndConditionsAccepted, termsAndConditionsAccepted) || other.termsAndConditionsAccepted == termsAndConditionsAccepted)&&(identical(other.forceUpdate, forceUpdate) || other.forceUpdate == forceUpdate)&&(identical(other.user, user) || other.user == user)&&(identical(other.countryCode, countryCode) || other.countryCode == countryCode)&&(identical(other.selectedCountry, selectedCountry) || other.selectedCountry == selectedCountry)&&(identical(other.nationalityCode, nationalityCode) || other.nationalityCode == nationalityCode)&&(identical(other.phoneNumber, phoneNumber) || other.phoneNumber == phoneNumber)&&(identical(other.isPhoneNumberValid, isPhoneNumberValid) || other.isPhoneNumberValid == isPhoneNumberValid)&&(identical(other.isFirstNameValid, isFirstNameValid) || other.isFirstNameValid == isFirstNameValid)&&(identical(other.isLastNameValid, isLastNameValid) || other.isLastNameValid == isLastNameValid)&&(identical(other.isAddressValid, isAddressValid) || other.isAddressValid == isAddressValid)&&(identical(other.isPostalCodeValid, isPostalCodeValid) || other.isPostalCodeValid == isPostalCodeValid)&&(identical(other.isCityValid, isCityValid) || other.isCityValid == isCityValid)&&(identical(other.isBirthDateValid, isBirthDateValid) || other.isBirthDateValid == isBirthDateValid)&&(identical(other.selectedDocumentType, selectedDocumentType) || other.selectedDocumentType == selectedDocumentType)&&(identical(other.selectedPaymentMethod, selectedPaymentMethod) || other.selectedPaymentMethod == selectedPaymentMethod)&&(identical(other.servingTime, servingTime) || other.servingTime == servingTime)&&(identical(other.error, error) || other.error == error));
}
@override
-int get hashCode => Object.hashAll([runtimeType,isLoading,selected,const DeepCollectionEquality().hash(_addOnUpgrades),const DeepCollectionEquality().hash(_availableRoomUpgrades),selectedRoomUpgrade,missingInformation,extrasTotalPrice,termsAndConditionsAccepted,forceUpdate,user,countryCode,selectedCountry,phoneNumber,isPhoneNumberValid,isFirstNameValid,isLastNameValid,isAddressValid,isPostalCodeValid,isCityValid,isBirthDateValid,selectedDocumentType,selectedPaymentMethod,servingTime,error]);
+int get hashCode => Object.hashAll([runtimeType,isLoading,selected,const DeepCollectionEquality().hash(_addOnUpgrades),const DeepCollectionEquality().hash(_availableRoomUpgrades),selectedRoomUpgrade,missingInformation,extrasTotalPrice,termsAndConditionsAccepted,forceUpdate,user,countryCode,selectedCountry,nationalityCode,phoneNumber,isPhoneNumberValid,isFirstNameValid,isLastNameValid,isAddressValid,isPostalCodeValid,isCityValid,isBirthDateValid,selectedDocumentType,selectedPaymentMethod,servingTime,error]);
@override
String toString() {
- return 'PreregistrationState(isLoading: $isLoading, selected: $selected, addOnUpgrades: $addOnUpgrades, availableRoomUpgrades: $availableRoomUpgrades, selectedRoomUpgrade: $selectedRoomUpgrade, missingInformation: $missingInformation, extrasTotalPrice: $extrasTotalPrice, termsAndConditionsAccepted: $termsAndConditionsAccepted, forceUpdate: $forceUpdate, user: $user, countryCode: $countryCode, selectedCountry: $selectedCountry, phoneNumber: $phoneNumber, isPhoneNumberValid: $isPhoneNumberValid, isFirstNameValid: $isFirstNameValid, isLastNameValid: $isLastNameValid, isAddressValid: $isAddressValid, isPostalCodeValid: $isPostalCodeValid, isCityValid: $isCityValid, isBirthDateValid: $isBirthDateValid, selectedDocumentType: $selectedDocumentType, selectedPaymentMethod: $selectedPaymentMethod, servingTime: $servingTime, error: $error)';
+ return 'PreregistrationState(isLoading: $isLoading, selected: $selected, addOnUpgrades: $addOnUpgrades, availableRoomUpgrades: $availableRoomUpgrades, selectedRoomUpgrade: $selectedRoomUpgrade, missingInformation: $missingInformation, extrasTotalPrice: $extrasTotalPrice, termsAndConditionsAccepted: $termsAndConditionsAccepted, forceUpdate: $forceUpdate, user: $user, countryCode: $countryCode, selectedCountry: $selectedCountry, nationalityCode: $nationalityCode, phoneNumber: $phoneNumber, isPhoneNumberValid: $isPhoneNumberValid, isFirstNameValid: $isFirstNameValid, isLastNameValid: $isLastNameValid, isAddressValid: $isAddressValid, isPostalCodeValid: $isPostalCodeValid, isCityValid: $isCityValid, isBirthDateValid: $isBirthDateValid, selectedDocumentType: $selectedDocumentType, selectedPaymentMethod: $selectedPaymentMethod, servingTime: $servingTime, error: $error)';
}
@@ -311,7 +313,7 @@ abstract mixin class _$PreregistrationStateCopyWith<$Res> implements $Preregistr
factory _$PreregistrationStateCopyWith(_PreregistrationState value, $Res Function(_PreregistrationState) _then) = __$PreregistrationStateCopyWithImpl;
@override @useResult
$Res call({
- bool isLoading, bool selected, List<AddOnUpgrade> addOnUpgrades, List<RoomUpgrade> availableRoomUpgrades, String selectedRoomUpgrade, bool missingInformation, int extrasTotalPrice, bool termsAndConditionsAccepted, bool forceUpdate, User? user, CountryCode? countryCode, String selectedCountry, String? phoneNumber, bool isPhoneNumberValid, bool isFirstNameValid, bool isLastNameValid, bool isAddressValid, bool isPostalCodeValid, bool isCityValid, bool isBirthDateValid, String selectedDocumentType, StoredPaymentMethod? selectedPaymentMethod, TimeOfDay? servingTime, AppError error
+ bool isLoading, bool selected, List<AddOnUpgrade> addOnUpgrades, List<RoomUpgrade> availableRoomUpgrades, String selectedRoomUpgrade, bool missingInformation, int extrasTotalPrice, bool termsAndConditionsAccepted, bool forceUpdate, User? user, CountryCode? countryCode, String selectedCountry, CountryCode? nationalityCode, String? phoneNumber, bool isPhoneNumberValid, bool isFirstNameValid, bool isLastNameValid, bool isAddressValid, bool isPostalCodeValid, bool isCityValid, bool isBirthDateValid, String selectedDocumentType, StoredPaymentMethod? selectedPaymentMethod, TimeOfDay? servingTime, AppError error
});
@@ -328,7 +330,7 @@ class __$PreregistrationStateCopyWithImpl<$Res>
/// Create a copy of PreregistrationState
/// with the given fields replaced by the non-null parameter values.
-@override @pragma('vm:prefer-inline') $Res call({Object? isLoading = null,Object? selected = null,Object? addOnUpgrades = null,Object? availableRoomUpgrades = null,Object? selectedRoomUpgrade = null,Object? missingInformation = null,Object? extrasTotalPrice = null,Object? termsAndConditionsAccepted = null,Object? forceUpdate = null,Object? user = freezed,Object? countryCode = freezed,Object? selectedCountry = null,Object? phoneNumber = freezed,Object? isPhoneNumberValid = null,Object? isFirstNameValid = null,Object? isLastNameValid = null,Object? isAddressValid = null,Object? isPostalCodeValid = null,Object? isCityValid = null,Object? isBirthDateValid = null,Object? selectedDocumentType = null,Object? selectedPaymentMethod = freezed,Object? servingTime = freezed,Object? error = null,}) {
+@override @pragma('vm:prefer-inline') $Res call({Object? isLoading = null,Object? selected = null,Object? addOnUpgrades = null,Object? availableRoomUpgrades = null,Object? selectedRoomUpgrade = null,Object? missingInformation = null,Object? extrasTotalPrice = null,Object? termsAndConditionsAccepted = null,Object? forceUpdate = null,Object? user = freezed,Object? countryCode = freezed,Object? selectedCountry = null,Object? nationalityCode = freezed,Object? phoneNumber = freezed,Object? isPhoneNumberValid = null,Object? isFirstNameValid = null,Object? isLastNameValid = null,Object? isAddressValid = null,Object? isPostalCodeValid = null,Object? isCityValid = null,Object? isBirthDateValid = null,Object? selectedDocumentType = null,Object? selectedPaymentMethod = freezed,Object? servingTime = freezed,Object? error = null,}) {
return _then(_PreregistrationState(
isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
as bool,selected: null == selected ? _self.selected : selected // ignore: cast_nullable_to_non_nullable
@@ -342,7 +344,8 @@ as bool,forceUpdate: null == forceUpdate ? _self.forceUpdate : forceUpdate // ig
as bool,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable
as User?,countryCode: freezed == countryCode ? _self.countryCode : countryCode // ignore: cast_nullable_to_non_nullable
as CountryCode?,selectedCountry: null == selectedCountry ? _self.selectedCountry : selectedCountry // ignore: cast_nullable_to_non_nullable
-as String,phoneNumber: freezed == phoneNumber ? _self.phoneNumber : phoneNumber // ignore: cast_nullable_to_non_nullable
+as String,nationalityCode: freezed == nationalityCode ? _self.nationalityCode : nationalityCode // ignore: cast_nullable_to_non_nullable
+as CountryCode?,phoneNumber: freezed == phoneNumber ? _self.phoneNumber : phoneNumber // ignore: cast_nullable_to_non_nullable
as String?,isPhoneNumberValid: null == isPhoneNumberValid ? _self.isPhoneNumberValid : isPhoneNumberValid // ignore: cast_nullable_to_non_nullable
as bool,isFirstNameValid: null == isFirstNameValid ? _self.isFirstNameValid : isFirstNameValid // ignore: cast_nullable_to_non_nullable
as bool,isLastNameValid: null == isLastNameValid ? _self.isLastNameValid : isLastNameValid // ignore: cast_nullable_to_non_nullable
diff --git a/comwell_key_app/lib/presentation/screens/pregistration/cubit/preregistration_cubit.dart b/comwell_key_app/lib/presentation/screens/pregistration/cubit/preregistration_cubit.dart
index ad5f2a69..9a796e29 100644
--- a/comwell_key_app/lib/presentation/screens/pregistration/cubit/preregistration_cubit.dart
+++ b/comwell_key_app/lib/presentation/screens/pregistration/cubit/preregistration_cubit.dart
@@ -46,10 +46,11 @@ class PreregistrationCubit extends BaseCubit<PreregistrationState> {
final commentTextController = TextEditingController();
CountryCode? countryCode;
+ CountryCode? nationalityCode;
String? phoneNumber;
final List<String> favoriteCountries = ['DK', 'SE', 'NO', 'FI'];
- List<String> documentTypes(BuildContext context) => [
+ List<String> documentTypes(BuildContext context) => [
context.strings.document_type_passport,
context.strings.document_type_id_card,
context.strings.document_type_driver_license,
@@ -74,6 +75,8 @@ class PreregistrationCubit extends BaseCubit<PreregistrationState> {
postalCodeTextController.text = user.address.zipCode;
cityTextController.text = user.address.city;
+ nationalityCode = getCountryCodeFromPhoneNumber(user.nationality).$1;
+
countryCode = getCountryCodeFromPhoneNumber(user.phoneNumber).$1;
phoneNumber = getCountryCodeFromPhoneNumber(user.phoneNumber).$2;
@@ -236,30 +239,31 @@ class PreregistrationCubit extends BaseCubit<PreregistrationState> {
void _onConfirmPressed(BuildContext context) async {
emit(state.copyWith(isLoading: true));
try {
- final hasUpSales =
- state.addOnUpgrades.any((e) => e.isAddedToCart) || state.selectedRoomUpgrade.isNotEmpty;
-
- if (hasUpSales) {
- addUpSalesToBooking();
- }
-
// Build the PreregRequestModel with all required fields
final preregRequest = PreregRequestDto(
firstName: state.user!.firstName,
lastName: state.user!.lastName,
email: state.user!.email,
phoneNumber: state.user!.phoneNumber,
- birthDay: state.user!.birthDate!.toIso8601String() ?? "",
+ birthDay: state.user!.birthDate!.toIso8601String(),
address: state.user!.address.street,
zipCode: state.user!.address.zipCode,
city: state.user!.address.city,
country: state.user!.address.country,
+ nationality: state.user!.nationality,
confirmationNumber: booking.confirmationNumber,
+ idType: selectedDocumentType,
+ idNumber: documentNumberTextController.text,
+ idCountry: nationalityCode?.code ?? '',
arrivalTime: state.servingTime?.toString() ?? '',
comment: commentTextController.text,
hotelCode: booking.hotelCode,
+ roomType: booking.roomType,
comwellClubTermsOfUseConsentChoice: state.termsAndConditionsAccepted,
comwellClubMarketingConsentChoice: false,
+ addOnList: state.addOnUpgrades
+ .map((e) => AddOnListDto(itemCode: e.id, quantity: e.quantity))
+ .toList(),
);
final preRegResponse = await _preregistrationRepository.createPreregistration(preregRequest);
@@ -280,23 +284,6 @@ class PreregistrationCubit extends BaseCubit<PreregistrationState> {
}
}
- Future<void> addUpSalesToBooking() async {
- // Extract RoomUpgrade from selectedUpSales to get the roomType
- final roomType = state.selectedRoomUpgrade;
-
- // Convert selected up sales to AddOnList objects using their individual quantities
- final List<AddOnList> addonList = state.addOnUpgrades
- .map((upgrade) => AddOnList(itemCode: upgrade.id, quantity: upgrade.quantity))
- .toList();
-
- await _upSalesRepository.addUpSalesToBooking(
- booking.confirmationNumber,
- booking.hotelCode,
- roomType,
- addonList,
- );
- }
-
void onEditProfileClicked() {
_navigateTo(PreregistrationPage.profile);
}
@@ -319,6 +306,11 @@ class PreregistrationCubit extends BaseCubit<PreregistrationState> {
emit(state.copyWith(countryCode: country, selectedCountry: country.code ?? ''));
}
+ void onNationalitySelected(CountryCode nationality) {
+ nationalityCode = nationality;
+ emit(state.copyWith(nationalityCode: nationality));
+ }
+
Future<void> onBirthDateSelected(DateTime date) async {
final updatedUser = state.user!.copyWith(birthDate: date);
emit(state.copyWith(user: updatedUser));
@@ -432,7 +424,6 @@ class PreregistrationCubit extends BaseCubit<PreregistrationState> {
final preregPage = PreregistrationPage.fromIndex(page);
switch (preregPage) {
-
case PreregistrationPage.profile:
return isFirstNameValid && isLastNameValid && isPhoneNumberValid && isBirthDateValid;
case PreregistrationPage.address:
diff --git a/comwell_key_app/lib/presentation/screens/pregistration/cubit/preregistration_state.dart b/comwell_key_app/lib/presentation/screens/pregistration/cubit/preregistration_state.dart
index 5c7b78ce..f2078ee9 100644
--- a/comwell_key_app/lib/presentation/screens/pregistration/cubit/preregistration_state.dart
+++ b/comwell_key_app/lib/presentation/screens/pregistration/cubit/preregistration_state.dart
@@ -25,6 +25,7 @@ abstract class PreregistrationState with _$PreregistrationState {
@Default(null) User? user,
@Default(null) CountryCode? countryCode,
@Default('') String selectedCountry,
+ @Default(null) CountryCode? nationalityCode,
@Default(null) String? phoneNumber,
@Default(false) bool isPhoneNumberValid,
@Default(false) bool isFirstNameValid,
diff --git a/comwell_key_app/lib/presentation/screens/pregistration/pages/prereg_profile_page.dart b/comwell_key_app/lib/presentation/screens/pregistration/pages/prereg_profile_page.dart
index e68e5f90..d0589e4b 100644
--- a/comwell_key_app/lib/presentation/screens/pregistration/pages/prereg_profile_page.dart
+++ b/comwell_key_app/lib/presentation/screens/pregistration/pages/prereg_profile_page.dart
@@ -151,7 +151,7 @@ class PreregProfilePage extends StatelessWidget {
child: CountryCodePicker(
alignLeft: true,
textOverflow: TextOverflow.visible,
- initialSelection: cubit.countryCode?.name,
+ initialSelection: cubit.nationalityCode?.name,
showFlag: false,
favorite: cubit.favoriteCountries,
showDropDownButton: true,
@@ -159,7 +159,7 @@ class PreregProfilePage extends StatelessWidget {
showCountryOnly: true,
showOnlyCountryWhenClosed: true,
onChanged: (CountryCode countryCode) {
- cubit.onCountryCodeSelected(countryCode);
+ cubit.onNationalitySelected(countryCode);
},
),
),
diff --git a/comwell_key_app/lib/presentation/screens/pregistration/prereg_request_model.dart b/comwell_key_app/lib/presentation/screens/pregistration/prereg_request_model.dart
index 9eb1c6f7..caefa188 100644
--- a/comwell_key_app/lib/presentation/screens/pregistration/prereg_request_model.dart
+++ b/comwell_key_app/lib/presentation/screens/pregistration/prereg_request_model.dart
@@ -8,13 +8,18 @@ class PreregRequestDto {
final String zipCode;
final String city;
final String country;
+ final String nationality;
final String confirmationNumber;
final String arrivalTime;
+ final String idType;
+ final String idNumber;
+ final String idCountry;
final String comment;
final String hotelCode;
+ final String roomType;
final bool comwellClubTermsOfUseConsentChoice;
final bool comwellClubMarketingConsentChoice;
-
+ final List<AddOnListDto> addOnList;
PreregRequestDto({
required this.firstName,
required this.lastName,
@@ -25,12 +30,18 @@ class PreregRequestDto {
required this.zipCode,
required this.city,
required this.country,
+ required this.nationality,
required this.confirmationNumber,
+ required this.idType,
+ required this.idNumber,
+ required this.idCountry,
required this.arrivalTime,
required this.comment,
required this.hotelCode,
+ required this.roomType,
required this.comwellClubTermsOfUseConsentChoice,
required this.comwellClubMarketingConsentChoice,
+ required this.addOnList,
});
Map<String, dynamic> toJson() {
@@ -44,12 +55,29 @@ class PreregRequestDto {
'zipCode': zipCode,
'city': city,
'country': country,
+ 'nationality': nationality,
'confirmationNumber': confirmationNumber,
+ 'idType': idType,
+ 'idNumber': idNumber,
+ 'idCountry': idCountry,
'arrivalTime': arrivalTime,
'comment': comment,
'hotelCode': hotelCode,
+ 'roomType': roomType,
'comwellClubTermsOfUseConsentChoice': comwellClubTermsOfUseConsentChoice,
'comwellClubMarketingConsentChoice': comwellClubMarketingConsentChoice,
+ 'addOnList': addOnList.map((e) => e.toJson()).toList(),
};
}
}
+
+class AddOnListDto {
+ final String itemCode;
+ final int quantity;
+
+ AddOnListDto({required this.itemCode, required this.quantity});
+
+ Map<String, dynamic> toJson() {
+ return {'itemCode': itemCode, 'quantity': quantity};
+ }
+}