6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit cce863a9

AuthorEdmir Suljic<esu@dwarf.dk>
Date2026-03-03 11:21:10 +0100
Fixed more bugs on prereg

Changed files

.../ios/Runner.xcodeproj/project.pbxproj           | 18 ++---
 .../cubit/preregistration_state.freezed.dart       | 52 +++++++-------
 comwell_key_app/lib/data/remote/msal_service.dart  |  8 ++-
 .../pregistration/cubit/preregistration_cubit.dart | 79 ++++++++--------------
 .../pregistration/cubit/preregistration_state.dart |  5 +-
 .../pregistration/pages/prereg_address_page.dart   |  4 +-
 .../pregistration/pages/prereg_profile_page.dart   | 23 ++++---
 .../pregistration/prereg_request_model.dart        | 69 ++++++++++++-------
 .../lib/services/utils/api_endpoints.dart          |  2 +-
 .../pages/processing/up_sales_processing_page.dart |  8 ++-
 10 files changed, 134 insertions(+), 134 deletions(-)

Diff

diff --git a/comwell_key_app/ios/Runner.xcodeproj/project.pbxproj b/comwell_key_app/ios/Runner.xcodeproj/project.pbxproj
index 04bccdf3..e39c19aa 100644
--- a/comwell_key_app/ios/Runner.xcodeproj/project.pbxproj
+++ b/comwell_key_app/ios/Runner.xcodeproj/project.pbxproj
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 60;
+ objectVersion = 54;
objects = {
/* Begin PBXBuildFile section */
@@ -204,8 +204,8 @@
);
mainGroup = 97C146E51CF9000F007C117D;
packageReferences = (
- 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */,
- 60BC597B2DEF216C00031449 /* XCLocalSwiftPackageReference "../../mobilekeys_sdk_plugin/ios/seos_mobile_keys_plugin" */,
+ 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */,
+ 60BC597B2DEF216C00031449 /* XCLocalSwiftPackageReference "seos_mobile_keys_plugin" */,
);
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
projectDirPath = "";
@@ -328,14 +328,10 @@
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
- inputPaths = (
- );
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
- outputPaths = (
- );
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
@@ -349,14 +345,10 @@
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
);
- inputPaths = (
- );
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
);
- outputPaths = (
- );
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
@@ -1128,11 +1120,11 @@
/* End XCConfigurationList section */
/* Begin XCLocalSwiftPackageReference section */
- 60BC597B2DEF216C00031449 /* XCLocalSwiftPackageReference "../../mobilekeys_sdk_plugin/ios/seos_mobile_keys_plugin" */ = {
+ 60BC597B2DEF216C00031449 /* XCLocalSwiftPackageReference "seos_mobile_keys_plugin" */ = {
isa = XCLocalSwiftPackageReference;
relativePath = ../../mobilekeys_sdk_plugin/ios/seos_mobile_keys_plugin;
};
- 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = {
+ 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = {
isa = XCLocalSwiftPackageReference;
relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage;
};
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 62173409..facfa3f0 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; 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;
+ 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 selectedNationality; String? get phoneNumber; bool get isPhoneNumberValid; bool get isFirstNameValid; bool get isLastNameValid; bool get isAddressValid; bool get isPostalCodeValid; bool get isCityValid; bool get isBirthDateValid; IdType 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.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));
+ 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.selectedNationality, selectedNationality) || other.selectedNationality == selectedNationality)&&(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,nationalityCode,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,selectedNationality,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, 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)';
+ 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, selectedNationality: $selectedNationality, 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, 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
+ 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 selectedNationality, String? phoneNumber, bool isPhoneNumberValid, bool isFirstNameValid, bool isLastNameValid, bool isAddressValid, bool isPostalCodeValid, bool isCityValid, bool isBirthDateValid, IdType 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? 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,}) {
+@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? selectedNationality = 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,}) {
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,8 +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,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,selectedNationality: null == selectedNationality ? _self.selectedNationality : selectedNationality // ignore: cast_nullable_to_non_nullable
+as String,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
@@ -86,7 +86,7 @@ as bool,isPostalCodeValid: null == isPostalCodeValid ? _self.isPostalCodeValid :
as bool,isCityValid: null == isCityValid ? _self.isCityValid : isCityValid // ignore: cast_nullable_to_non_nullable
as bool,isBirthDateValid: null == isBirthDateValid ? _self.isBirthDateValid : isBirthDateValid // ignore: cast_nullable_to_non_nullable
as bool,selectedDocumentType: null == selectedDocumentType ? _self.selectedDocumentType : selectedDocumentType // ignore: cast_nullable_to_non_nullable
-as String,selectedPaymentMethod: freezed == selectedPaymentMethod ? _self.selectedPaymentMethod : selectedPaymentMethod // ignore: cast_nullable_to_non_nullable
+as IdType,selectedPaymentMethod: freezed == selectedPaymentMethod ? _self.selectedPaymentMethod : selectedPaymentMethod // ignore: cast_nullable_to_non_nullable
as StoredPaymentMethod?,servingTime: freezed == servingTime ? _self.servingTime : servingTime // ignore: cast_nullable_to_non_nullable
as TimeOfDay?,error: null == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
as AppError,
@@ -186,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, 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;
+@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 selectedNationality, String? phoneNumber, bool isPhoneNumberValid, bool isFirstNameValid, bool isLastNameValid, bool isAddressValid, bool isPostalCodeValid, bool isCityValid, bool isBirthDateValid, IdType 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.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 $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.selectedNationality,_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();
}
@@ -207,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, 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;
+@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 selectedNationality, String? phoneNumber, bool isPhoneNumberValid, bool isFirstNameValid, bool isLastNameValid, bool isAddressValid, bool isPostalCodeValid, bool isCityValid, bool isBirthDateValid, IdType 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.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 $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.selectedNationality,_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');
}
@@ -227,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, 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;
+@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 selectedNationality, String? phoneNumber, bool isPhoneNumberValid, bool isFirstNameValid, bool isLastNameValid, bool isAddressValid, bool isPostalCodeValid, bool isCityValid, bool isBirthDateValid, IdType 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.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 $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.selectedNationality,_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;
}
@@ -242,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.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;
+ 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.selectedNationality = '', 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 = IdType.driverLicense, this.selectedPaymentMethod = null, this.servingTime = null, this.error = AppError.none}): _addOnUpgrades = addOnUpgrades,_availableRoomUpgrades = availableRoomUpgrades;
@override@JsonKey() final bool isLoading;
@@ -269,7 +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 selectedNationality;
@override@JsonKey() final String? phoneNumber;
@override@JsonKey() final bool isPhoneNumberValid;
@override@JsonKey() final bool isFirstNameValid;
@@ -278,7 +278,7 @@ class _PreregistrationState implements PreregistrationState {
@override@JsonKey() final bool isPostalCodeValid;
@override@JsonKey() final bool isCityValid;
@override@JsonKey() final bool isBirthDateValid;
-@override@JsonKey() final String selectedDocumentType;
+@override@JsonKey() final IdType selectedDocumentType;
@override@JsonKey() final StoredPaymentMethod? selectedPaymentMethod;
@override@JsonKey() final TimeOfDay? servingTime;
@override@JsonKey() final AppError error;
@@ -293,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.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));
+ 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.selectedNationality, selectedNationality) || other.selectedNationality == selectedNationality)&&(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,nationalityCode,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,selectedNationality,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, 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)';
+ 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, selectedNationality: $selectedNationality, phoneNumber: $phoneNumber, isPhoneNumberValid: $isPhoneNumberValid, isFirstNameValid: $isFirstNameValid, isLastNameValid: $isLastNameValid, isAddressValid: $isAddressValid, isPostalCodeValid: $isPostalCodeValid, isCityValid: $isCityValid, isBirthDateValid: $isBirthDateValid, selectedDocumentType: $selectedDocumentType, selectedPaymentMethod: $selectedPaymentMethod, servingTime: $servingTime, error: $error)';
}
@@ -313,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, 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
+ 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 selectedNationality, String? phoneNumber, bool isPhoneNumberValid, bool isFirstNameValid, bool isLastNameValid, bool isAddressValid, bool isPostalCodeValid, bool isCityValid, bool isBirthDateValid, IdType selectedDocumentType, StoredPaymentMethod? selectedPaymentMethod, TimeOfDay? servingTime, AppError error
});
@@ -330,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? 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,}) {
+@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? selectedNationality = 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,}) {
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
@@ -344,8 +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,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,selectedNationality: null == selectedNationality ? _self.selectedNationality : selectedNationality // ignore: cast_nullable_to_non_nullable
+as String,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
@@ -354,7 +354,7 @@ as bool,isPostalCodeValid: null == isPostalCodeValid ? _self.isPostalCodeValid :
as bool,isCityValid: null == isCityValid ? _self.isCityValid : isCityValid // ignore: cast_nullable_to_non_nullable
as bool,isBirthDateValid: null == isBirthDateValid ? _self.isBirthDateValid : isBirthDateValid // ignore: cast_nullable_to_non_nullable
as bool,selectedDocumentType: null == selectedDocumentType ? _self.selectedDocumentType : selectedDocumentType // ignore: cast_nullable_to_non_nullable
-as String,selectedPaymentMethod: freezed == selectedPaymentMethod ? _self.selectedPaymentMethod : selectedPaymentMethod // ignore: cast_nullable_to_non_nullable
+as IdType,selectedPaymentMethod: freezed == selectedPaymentMethod ? _self.selectedPaymentMethod : selectedPaymentMethod // ignore: cast_nullable_to_non_nullable
as StoredPaymentMethod?,servingTime: freezed == servingTime ? _self.servingTime : servingTime // ignore: cast_nullable_to_non_nullable
as TimeOfDay?,error: null == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
as AppError,
diff --git a/comwell_key_app/lib/data/remote/msal_service.dart b/comwell_key_app/lib/data/remote/msal_service.dart
index b35d3468..0942332d 100644
--- a/comwell_key_app/lib/data/remote/msal_service.dart
+++ b/comwell_key_app/lib/data/remote/msal_service.dart
@@ -64,7 +64,7 @@ class MSALService {
);
await _comwellPreferences.setIsLoggedIn(true);
return response.accessToken;
- } catch (e, st) {
+ } catch (e) {
await logout();
rethrow;
}
@@ -72,6 +72,10 @@ class MSALService {
Future<void> logout() async {
await _comwellPreferences.setIsLoggedIn(false);
- await msAuth.signOut();
+ try {
+ await msAuth.signOut();
+ } catch (e) {
+ // Ignore sign-out errors when there is no active account or sign-out fails
+ }
}
}
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 9a796e29..7fd06b5d 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,18 +46,14 @@ 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) => [
- context.strings.document_type_passport,
- context.strings.document_type_id_card,
- context.strings.document_type_driver_license,
- context.strings.document_type_other,
- ];
- String selectedDocumentType = '';
+ IdType selectedDocumentType = IdType.passport;
+ String selectedCountry = '';
+ String selectedNationality = '';
PreregistrationPage get currentPage =>
PreregistrationPage.fromIndex(pageController.page?.toInt() ?? 0);
bool _isAnimating = false;
@@ -75,7 +71,8 @@ class PreregistrationCubit extends BaseCubit<PreregistrationState> {
postalCodeTextController.text = user.address.zipCode;
cityTextController.text = user.address.city;
- nationalityCode = getCountryCodeFromPhoneNumber(user.nationality).$1;
+ selectedNationality = user.nationality;
+ selectedCountry = user.nationality;
countryCode = getCountryCodeFromPhoneNumber(user.phoneNumber).$1;
phoneNumber = getCountryCodeFromPhoneNumber(user.phoneNumber).$2;
@@ -133,7 +130,7 @@ class PreregistrationCubit extends BaseCubit<PreregistrationState> {
});
}
- void onDocumentTypeSelected(String documentType) {
+ void onDocumentTypeSelected(IdType documentType) {
selectedDocumentType = documentType;
emit(state.copyWith(selectedDocumentType: documentType));
}
@@ -206,40 +203,16 @@ class PreregistrationCubit extends BaseCubit<PreregistrationState> {
);
}
- void addToCart() {
- final analyticsEventItem = AnalyticsEventItem(
- hotelName: "Comwell",
- currency: "DKK",
- value: 500,
- placement: "placement",
- items: ["items"],
- itemId: "itemId",
- itemName: "itemName",
- price: 200,
- quantity: 200,
- );
- _tracking.trackAddToCart(analyticsEventItem);
- }
-
- void removeToCard() {
- final analyticsEventItem = AnalyticsEventItem(
- hotelName: "Comwell",
- currency: "DKK",
- value: 500,
- placement: "placement",
- items: ["items"],
- itemId: "itemId",
- itemName: "itemName",
- price: 200,
- quantity: 200,
- );
- _tracking.trackRemoveFromCart(analyticsEventItem);
- }
-
void _onConfirmPressed(BuildContext context) async {
emit(state.copyWith(isLoading: true));
try {
// Build the PreregRequestModel with all required fields
+ final String? sendIdType = isFavoriteCountry ? null : selectedDocumentType.code;
+ final String? sendRoomType = state.selectedRoomUpgrade.isNotEmpty ? state.selectedRoomUpgrade : null;
+ final List<AddOnListDto>? sendAddOnList = numOfExtras > 0 ? selectedAddOnUpgrades
+ .map((e) => AddOnListDto(itemCode: e.id, quantity: e.quantity))
+ .toList() : null;
+
final preregRequest = PreregRequestDto(
firstName: state.user!.firstName,
lastName: state.user!.lastName,
@@ -252,20 +225,17 @@ class PreregistrationCubit extends BaseCubit<PreregistrationState> {
country: state.user!.address.country,
nationality: state.user!.nationality,
confirmationNumber: booking.confirmationNumber,
- idType: selectedDocumentType,
+ idType: sendIdType,
idNumber: documentNumberTextController.text,
- idCountry: nationalityCode?.code ?? '',
- arrivalTime: state.servingTime?.toString() ?? '',
+ idCountry: selectedNationality,
+ servingTime: 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(),
+ roomType: sendRoomType,
+ addOnList: sendAddOnList,
);
+ await _profileSettingsRepository.updateUser(state.user!);
final preRegResponse = await _preregistrationRepository.createPreregistration(preregRequest);
if (preRegResponse != null) {
@@ -307,8 +277,13 @@ class PreregistrationCubit extends BaseCubit<PreregistrationState> {
}
void onNationalitySelected(CountryCode nationality) {
- nationalityCode = nationality;
- emit(state.copyWith(nationalityCode: nationality));
+ selectedNationality = nationality.name ?? '';
+ emit(state.copyWith(selectedNationality: selectedNationality));
+ }
+
+ void onSelectedCountrySelected(String country) {
+ selectedCountry = country;
+ emit(state.copyWith(selectedCountry: country));
}
Future<void> onBirthDateSelected(DateTime date) async {
@@ -418,6 +393,8 @@ class PreregistrationCubit extends BaseCubit<PreregistrationState> {
DateTime get validBirthDate => DateTime.now().subtract(const Duration(days: 365 * 18));
+ bool get isFavoriteCountry => favoriteCountries.contains(selectedCountry);
+
bool get canContinue {
int page = pageController.page?.ceil() ?? 0;
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 f2078ee9..5d0ec6a1 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
@@ -1,4 +1,5 @@
import 'package:comwell_key_app/domain/models/app_error.dart';
+import 'package:comwell_key_app/presentation/screens/pregistration/prereg_request_model.dart' show IdType;
import 'package:comwell_key_app/up_sales/models/addon_upgrade.dart';
import 'package:comwell_key_app/up_sales/models/room_upgrade.dart';
import 'package:country_code_picker/country_code_picker.dart';
@@ -25,7 +26,7 @@ abstract class PreregistrationState with _$PreregistrationState {
@Default(null) User? user,
@Default(null) CountryCode? countryCode,
@Default('') String selectedCountry,
- @Default(null) CountryCode? nationalityCode,
+ @Default('') String selectedNationality,
@Default(null) String? phoneNumber,
@Default(false) bool isPhoneNumberValid,
@Default(false) bool isFirstNameValid,
@@ -34,7 +35,7 @@ abstract class PreregistrationState with _$PreregistrationState {
@Default(false) bool isPostalCodeValid,
@Default(false) bool isCityValid,
@Default(false) bool isBirthDateValid,
- @Default('') String selectedDocumentType,
+ @Default(IdType.driverLicense) IdType selectedDocumentType,
@Default(null) StoredPaymentMethod? selectedPaymentMethod,
@Default(null) TimeOfDay? servingTime,
@Default(AppError.none) AppError error,
diff --git a/comwell_key_app/lib/presentation/screens/pregistration/pages/prereg_address_page.dart b/comwell_key_app/lib/presentation/screens/pregistration/pages/prereg_address_page.dart
index 7320306e..9a2be410 100644
--- a/comwell_key_app/lib/presentation/screens/pregistration/pages/prereg_address_page.dart
+++ b/comwell_key_app/lib/presentation/screens/pregistration/pages/prereg_address_page.dart
@@ -83,7 +83,7 @@ class PreregAddressPage extends StatelessWidget {
child: CountryCodePicker(
alignLeft: true,
textOverflow: TextOverflow.visible,
- initialSelection: cubit.countryCode?.name,
+ initialSelection: cubit.selectedNationality,
showFlag: false,
favorite: cubit.favoriteCountries,
showDropDownButton: true,
@@ -91,7 +91,7 @@ class PreregAddressPage 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/pages/prereg_profile_page.dart b/comwell_key_app/lib/presentation/screens/pregistration/pages/prereg_profile_page.dart
index d0589e4b..17e61d9f 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
@@ -1,4 +1,5 @@
import 'package:comwell_key_app/common/components/comwell_error_widget.dart';
+import 'package:comwell_key_app/presentation/screens/pregistration/prereg_request_model.dart' show IdType;
import 'package:comwell_key_app/common/components/comwell_text_field.dart';
import 'package:comwell_key_app/presentation/screens/pregistration/cubit/preregistration_cubit.dart';
import 'package:comwell_key_app/presentation/screens/pregistration/cubit/preregistration_state.dart';
@@ -41,7 +42,7 @@ class PreregProfilePage extends StatelessWidget {
Widget _buildProfilePage(ThemeData theme, PreregistrationState state, BuildContext context) {
final cubit = context.read<PreregistrationCubit>();
- final isFavoriteCountry = cubit.favoriteCountries.contains(state.selectedCountry);
+
final firstNameErrorMessage = !cubit.isFirstNameValid && state.missingInformation
? context.strings.generic_information_required
@@ -151,7 +152,7 @@ class PreregProfilePage extends StatelessWidget {
child: CountryCodePicker(
alignLeft: true,
textOverflow: TextOverflow.visible,
- initialSelection: cubit.nationalityCode?.name,
+ initialSelection: cubit.selectedCountry,
showFlag: false,
favorite: cubit.favoriteCountries,
showDropDownButton: true,
@@ -159,11 +160,11 @@ class PreregProfilePage extends StatelessWidget {
showCountryOnly: true,
showOnlyCountryWhenClosed: true,
onChanged: (CountryCode countryCode) {
- cubit.onNationalitySelected(countryCode);
+ cubit.onSelectedCountrySelected(countryCode.code ?? '');
},
),
),
- if (!isFavoriteCountry) ...[
+ if (!cubit.isFavoriteCountry) ...[
const SizedBox(height: 12),
Container(
height: 62,
@@ -174,17 +175,17 @@ class PreregProfilePage extends StatelessWidget {
),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 12),
- child: DropdownButtonFormField<String>(
+ child: DropdownButtonFormField<IdType>(
hint: Text(context.strings.document_type),
decoration: const InputDecoration(border: InputBorder.none),
- initialValue: state.selectedDocumentType.isNotEmpty
- ? state.selectedDocumentType
- : null,
+ initialValue: state.selectedDocumentType,
style: theme.textTheme.headlineSmall?.copyWith(color: Colors.black),
- items: cubit.documentTypes(context)
+ items: IdType.values
.map(
- (documentType) =>
- DropdownMenuItem(value: documentType, child: Text(documentType)),
+ (idType) => DropdownMenuItem<IdType>(
+ value: idType,
+ child: Text(idType.displayLabel(context.strings)),
+ ),
)
.toList(),
onChanged: (value) {
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 caefa188..60bf9a16 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
@@ -1,3 +1,32 @@
+/// ID document type as expected by the backend API.
+/// P = Passport, D = Driver's licence, I = ID card
+enum IdType {
+ passport('P'),
+ driverLicense('D'),
+ idCard('I');
+
+ const IdType(this.code);
+ final String code;
+
+ static IdType? fromCode(String code) {
+ for (final e in IdType.values) {
+ if (e.code == code) return e;
+ }
+ return null;
+ }
+
+ String displayLabel(dynamic strings) {
+ switch (this) {
+ case IdType.passport:
+ return strings.document_type_passport;
+ case IdType.driverLicense:
+ return strings.document_type_driver_license;
+ case IdType.idCard:
+ return strings.document_type_id_card;
+ }
+ }
+}
+
class PreregRequestDto {
final String firstName;
final String lastName;
@@ -10,16 +39,14 @@ class PreregRequestDto {
final String country;
final String nationality;
final String confirmationNumber;
- final String arrivalTime;
- final String idType;
- final String idNumber;
- final String idCountry;
+ final String servingTime;
+ 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;
+ final String? roomType;
+ final List<AddOnListDto>? addOnList;
PreregRequestDto({
required this.firstName,
required this.lastName,
@@ -32,16 +59,14 @@ class PreregRequestDto {
required this.country,
required this.nationality,
required this.confirmationNumber,
- required this.idType,
- required this.idNumber,
- required this.idCountry,
- required this.arrivalTime,
+ this.idType,
+ this.idNumber,
+ this.idCountry,
+ required this.servingTime,
required this.comment,
required this.hotelCode,
- required this.roomType,
- required this.comwellClubTermsOfUseConsentChoice,
- required this.comwellClubMarketingConsentChoice,
- required this.addOnList,
+ this.roomType,
+ this.addOnList,
});
Map<String, dynamic> toJson() {
@@ -57,16 +82,14 @@ class PreregRequestDto {
'country': country,
'nationality': nationality,
'confirmationNumber': confirmationNumber,
- 'idType': idType,
- 'idNumber': idNumber,
+ if (idType != null) 'idType': idType,
+ if (idNumber != null) 'idNumber': idNumber,
'idCountry': idCountry,
- 'arrivalTime': arrivalTime,
+ 'arrivalTime': servingTime,
'comment': comment,
'hotelCode': hotelCode,
- 'roomType': roomType,
- 'comwellClubTermsOfUseConsentChoice': comwellClubTermsOfUseConsentChoice,
- 'comwellClubMarketingConsentChoice': comwellClubMarketingConsentChoice,
- 'addOnList': addOnList.map((e) => e.toJson()).toList(),
+ if (roomType != null) 'roomType': roomType,
+ if (addOnList != null) 'addOnList': addOnList!.map((e) => e.toJson()).toList(),
};
}
}
diff --git a/comwell_key_app/lib/services/utils/api_endpoints.dart b/comwell_key_app/lib/services/utils/api_endpoints.dart
index 0be4f893..e87ec83c 100644
--- a/comwell_key_app/lib/services/utils/api_endpoints.dart
+++ b/comwell_key_app/lib/services/utils/api_endpoints.dart
@@ -17,7 +17,7 @@ class ApiEndpoints {
static const String upSales = '/booking/v1/GetAvailableUpsells';
static const String addUpSalesToBooking = '/booking/v1/AddUpsellOptions';
//Default endpoints
- static const String orderHousekeeping = '/Content/v1/api/v1/house-keeping';
+ static const String orderHousekeeping = '/booking/v1/OrderHouseKeeping';
// Member endpoints
static const String getGuestProfile = '/Members/v1/GetGuestProfile';
diff --git a/comwell_key_app/lib/up_sales/pages/processing/up_sales_processing_page.dart b/comwell_key_app/lib/up_sales/pages/processing/up_sales_processing_page.dart
index e92e09e0..39a166d5 100644
--- a/comwell_key_app/lib/up_sales/pages/processing/up_sales_processing_page.dart
+++ b/comwell_key_app/lib/up_sales/pages/processing/up_sales_processing_page.dart
@@ -6,6 +6,7 @@ import 'package:comwell_key_app/up_sales/pages/processing/up_sales_error_page.da
import 'package:comwell_key_app/utils/lottie_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:go_router/go_router.dart';
import 'package:lottie/lottie.dart';
class UpSalesProcessingPage extends StatefulWidget {
@@ -50,7 +51,7 @@ class _UpSalesProcessingPageState extends State<UpSalesProcessingPage>
await Future<void>.delayed(const Duration(seconds: 2));
}
- void playSuccess() async {
+ void playSuccess(UpSalesCubit cubit) async {
await loadingComposition?.playBetween(
animationController,
"success",
@@ -58,7 +59,8 @@ class _UpSalesProcessingPageState extends State<UpSalesProcessingPage>
);
await Future<void>.delayed(const Duration(seconds: 2));
if (mounted) {
- Navigator.of(context).popUntil((route) => route.settings.name == AppRoutes.bookingDetails);
+ context.go(AppRoutes.overview);
+ context.push(AppRoutes.bookingDetails, extra: cubit.booking);
}
}
@@ -85,7 +87,7 @@ class _UpSalesProcessingPageState extends State<UpSalesProcessingPage>
animationController.duration = composition.duration;
switch (cubit.state.processingState) {
case UpSalesProcessingStateSuccess _:
- playSuccess();
+ playSuccess(cubit);
case UpSalesProcessingStateError _:
playError();
default: