From 8c5fc8d82795ce64dd616af6c083aee49d80261f Mon Sep 17 00:00:00 2001 From: misha Date: Wed, 29 Jul 2026 14:08:13 +0300 Subject: [PATCH] feat(consultant_scoring): fixed registration update flow --- .../register_consultant_cubit.dart | 6 ++-- .../presentation/pages/last_step_screen.dart | 29 +++++++++++++++++++ .../pages/passport_data_screen.dart | 2 +- .../stepper_become_consultant_screen.dart | 27 +++++++++-------- 4 files changed, 48 insertions(+), 16 deletions(-) diff --git a/lib/features/consultant/become_consultant/presentation/bloc/register_consultant_cubit/register_consultant_cubit.dart b/lib/features/consultant/become_consultant/presentation/bloc/register_consultant_cubit/register_consultant_cubit.dart index 9cae8fa5..d82ff2bb 100644 --- a/lib/features/consultant/become_consultant/presentation/bloc/register_consultant_cubit/register_consultant_cubit.dart +++ b/lib/features/consultant/become_consultant/presentation/bloc/register_consultant_cubit/register_consultant_cubit.dart @@ -107,7 +107,7 @@ class RegisterConsultantCubit extends Cubit { birthPlace: _emptyToNull(legal?.birthPlace), registrationAddress: _emptyToNull(legal?.registrationAddress), residenceAddress: _emptyToNull(legal?.residenceAddress), - citizenship: _emptyToNull(legal?.citizenship) ?? 'RU', + citizenship: _emptyToNull(legal?.citizenship), taxResidentUs: legal?.taxResidentUs ?? false, foreignTaxResident: legal?.foreignTaxResident ?? false, sbpPhone: _emptyToNull(legal?.sbpPhone), @@ -149,7 +149,7 @@ class RegisterConsultantCubit extends Cubit { error: null, consultant: state.consultant.copyWith( legalType: individualPersonLegalType, - citizenship: state.consultant.citizenship ?? 'RU', + citizenship: state.consultant.citizenship, taxResidentUs: state.consultant.taxResidentUs ?? false, foreignTaxResident: state.consultant.foreignTaxResident ?? false, ), @@ -198,7 +198,7 @@ class RegisterConsultantCubit extends Cubit { ConsultantProfileModel buildSubmitPayload() { final withLegalType = state.consultant.copyWith( legalType: individualPersonLegalType, - citizenship: state.consultant.citizenship ?? 'RU', + citizenship: state.consultant.citizenship, taxResidentUs: state.consultant.taxResidentUs ?? false, foreignTaxResident: state.consultant.foreignTaxResident ?? false, certificates: state.consultant.certificates diff --git a/lib/features/consultant/become_consultant/presentation/pages/last_step_screen.dart b/lib/features/consultant/become_consultant/presentation/pages/last_step_screen.dart index 7fd501a6..afdcbf83 100644 --- a/lib/features/consultant/become_consultant/presentation/pages/last_step_screen.dart +++ b/lib/features/consultant/become_consultant/presentation/pages/last_step_screen.dart @@ -48,6 +48,35 @@ class _LastStepScreenState extends State { padding: EdgeInsets.symmetric(horizontal: 16), child: Text('Последний шаг', style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, height: 1.1)), ), + if (state.requestModel?.canceledModeration != null) ...[ + const SizedBox(height: 16), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Container( + width: double.infinity, + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + color: const Color(0x33FFCC00), + borderRadius: BorderRadius.circular(16), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + state.requestModel!.canceledModeration!.title, + style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600, height: 1.2), + ), + if (state.requestModel!.canceledModeration!.additional != null) ...[ + const SizedBox(height: 8), + for (final item in state.requestModel!.canceledModeration!.additional!) ...[ + Text('• $item', style: const TextStyle(fontSize: 14, height: 1.3)), + ], + ], + ], + ), + ), + ), + ], const SizedBox(height: 16), CheckboxListTile( value: state.acceptOffer, diff --git a/lib/features/consultant/become_consultant/presentation/pages/passport_data_screen.dart b/lib/features/consultant/become_consultant/presentation/pages/passport_data_screen.dart index f3eb774b..814f2139 100644 --- a/lib/features/consultant/become_consultant/presentation/pages/passport_data_screen.dart +++ b/lib/features/consultant/become_consultant/presentation/pages/passport_data_screen.dart @@ -101,7 +101,7 @@ class _PassportDataScreenState extends State { text: consultant.birthPlace ?? '', ); citizenshipController = TextEditingController( - text: consultant.citizenship ?? 'RU', + text: consultant.citizenship, ); registrationAddressController = TextEditingController( text: consultant.registrationAddress ?? '', diff --git a/lib/features/consultant/become_consultant/presentation/pages/stepper_become_consultant_screen.dart b/lib/features/consultant/become_consultant/presentation/pages/stepper_become_consultant_screen.dart index 69f88361..73359e25 100644 --- a/lib/features/consultant/become_consultant/presentation/pages/stepper_become_consultant_screen.dart +++ b/lib/features/consultant/become_consultant/presentation/pages/stepper_become_consultant_screen.dart @@ -123,20 +123,23 @@ class _StepperBecomeConsultantScreenState extends State AlertDialog( - title: Text(state.requestModel!.canceledModeration!.title), + title: Text(canceledModeration.title), content: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - for (int i = 0; i < state.requestModel!.canceledModeration!.additional!.length; i++) ...[ - Text('• ${state.requestModel!.canceledModeration!.additional![i]}'), - ], + if (canceledModeration.additional != null) + for (final item in canceledModeration.additional!) ...[ + Text('• $item'), + ], ], ), actions: [TextButton(onPressed: () => Navigator.pop(context), child: const Text('OK'))], @@ -158,7 +161,7 @@ class _StepperBecomeConsultantScreenState extends State