Skip to content

feat(profile): implement profile flow - #61

Merged
CowboyGH merged 13 commits into
developfrom
feature/profile
Apr 4, 2026
Merged

CowboyGH merged 13 commits into
developfrom
feature/profile

Conversation

@CowboyGH

@CowboyGH CowboyGH commented Apr 4, 2026

Copy link
Copy Markdown
Owner

🚀 Summary

Implemented the authenticated profile flow end-to-end.

🧪 Verification

  • flutter analyze
  • flutter test test/features/subscriptions
  • flutter test test/features/cards
  • flutter test test/features/profile

CowboyGH and others added 11 commits March 29, 2026 17:44
* build(deps): add image_picker for profile avatar flow

* feat(profile): add profile api contract

* feat(profile): add profile repository layer

* test(profile): add repository coverage

* feat(profile): add profile presentation cubits

* test(profile): add cubit coverage

* feat(profile): add profile user section ui

* docs(changelog): document profile user section

* chore(deps): update file_picker to the latest version

* fix(profile): map auth failures as request failures

* fix(profile): harden user section interactions
* feat(profile): add statistics api contract

* feat(profile): extend profile snapshot for statistics history

* feat(profile): add statistics domain models and contracts

* feat(profile): implement statistics repositories

* test(profile): add statistics repository and mapper coverage

* feat(profile): add statistics cubit and state

* test(profile): add statistics cubit coverage

* feat(profile): wire statistics bootstrap state

* feat(profile): add profile statistics ui

* test(profile): add profile page widget coverage

* docs(changelog): document profile statistics section

* refactor(profile): regroup statistics dto contracts

* fix(profile): improve statistics frequency mapping and bootstrap flow

* feat(profile): polish statistics widgets and layout

* fix(ui): add compact option buttons and flexible profile overlays

* test(profile): align statistics fixtures and coverage

* test(profile): remove obsolete profile page widget coverage

* docs: update CHANGELOG.md

* fix(profile-stats): show stats error state on failed refresh

* fix(profile): reuse cached trend stats on mode switc

* test(profile): cover statistics cubit failure states
* feat(profile): extend profile bootstrap with phase snapshot

* test(profile): add phase bootstrap repository coverage

* feat(profile): add current phase summary to profile statistics flow

* test(profile): add current phase summary coverage

* feat(profile-ui): add current phase section UI

* docs: update CHANGELOG.md

* fix(profile-ui): polish ui and decline current phase rounded training count in russian

* chore(profile): align phase dto nullability and cache cleanup
… reload sync (#55)

* feat(profile): extend profile bootstrap with phase snapshot

* test(profile): add phase bootstrap repository coverage

* feat(profile): add current phase summary to profile statistics flow

* test(profile): add current phase summary coverage

* feat(profile-ui): add current phase section UI

* docs: update CHANGELOG.md

* fix(profile-ui): polish ui and decline current phase rounded training count in russian

* feat(params): add profile params api contract

* feat(params-domain): add profile parameters repository contract

* feat(params-data): implement profile parameters repository

* test(params-repo): add unit tests for repository (+ fixtures)

* feat(params): add ProfileParametersCubit and state

* test(params): add unit tests for ProfileParametersCubit

* feat(params-ui): add profile parameters section UI

* docs: update CHANGELOG.md

* chore(profile): align phase dto nullability and cache cleanup

* refactor(params-ui): polish ProfileParametersSectionWidget layout

* test(params): add dio exception test for saving one param

* refactor(profile): reload workouts only for plan-affecting parameter changes

* refactor(profile): add typed request dto for parameters api

* fix(profile): guard parameters flow against load-submit races

* fix(profile): cache nullable parameters snapshot from profile bootstrap

* fix(profile): handle equipment options safely in parameters form

* docs: refine profile changelog wording
… and legal links (#56)

* feat(auth): add authenticated sign-out session cleanup

* test(auth): cover signOut cleanup flow

* feat(profile): add delete profile api contract

* feat(profile-data): implement delete profile repository action

* refactor(auth): reuse token cleanup helper in signOut

* test(profile-repo): add delete profile repository coverage

* feat(profile): add DeleteProfileCubit

* test(profile): add delete profile cubit coverage

* feat(profile-ui): add profile bottom section actions and legal links

* refactor(debug): simplify debug screen placeholder

* docs: update CHANGELOG.md

* fix(profile-ui): make profile bottom dialogs safer

* refactor(router): reuse legal document redirect guard

* fix(profile): keep bottom actions available in profile fallback state

* fix(profile): make fallback state scrollable with bottom actions

* fix(profile): uncomment code lines
commit f58581b
Author: Ryan Delaney <145113692+CowboyGH@users.noreply.github.com>
Date:   Fri Apr 3 15:14:23 2026 +0700

    feat(subscriptions): add authenticated subscriptions catalog, details, and payment flow (#58)

    * feat(subs-domain): add details and payment contracts

    * feat(subs-data): implement details lookup and payment command

    * test(subs-repo): add details and payment repository coverage

    * feat(subs): add details and payment cubits

    * test(subs): add details and payment cubit coverage

    * feat(subs-ui): add subscription details screen

    * feat(subs-ui): add payment dialog

    * feat(subs-ui): open details from catalog cards

    * fix(subs-ui): wire catalog details navigation context

    * docs: update CHANGELOG.md

    * feat(subs-data): fetch details by id and map subscriptions failures

    * feat(subs-ui): align subscription details screen with mockups

    * feat(subs-payment): polish payment dialog and validators

    * fix(subs-ui): update card preview number on input

    * fix(subs-ui): update card preview number on input

    * fix(subs-payment): reject non-digit cvv values

    * fix(subs-ui): guard catalog navigation and card accessibility

    * fix(subs-data): localize subscription not found mapping

    * fix(subs-payment): sanitize payment failure mapping

    * fix(subs-ui): obscure CVV field input for security

commit 749b4a9
Author: Ryan Delaney <145113692+CowboyGH@users.noreply.github.com>
Date:   Thu Apr 2 13:42:02 2026 +0700

    feat(subscriptions): add authenticated subscriptions catalog and profile entrypoint (#57)

    * feat(subscriptions): add subscriptions api contract

    * feat(subscriptions-domain): add subscriptions repository contract

    * feat(subscriptions-data): implement subscriptions repository

    * test(subscriptions-repo): add subscriptions repository coverage

    * feat(subscriptions): add subscriptions cubit and state

    * test(subscriptions): add subscriptions cubit coverage

    * refactor(subscriptions-domain): extend catalog item model

    * feat(subscriptions-ui): add subscriptions catalog screen

    * feat(profile-ui): add subscriptions entry button to profile

    * docs: update CHANGELOG.md

    * refactor(images): reuse shared backend image url normalizer

    * fix(subscriptions): keep only active plans in catalog
* feat(subs-domain): add cancel subscription contracts

* feat(subs-data): implement cancel subscription command

* test(subs-repo): add cancel subscription repository coverage

* feat(profile-sub): add cancel subscription cubit and state

* test(profile-sub): add cancel subscription cubit coverage

* feat(profile-sub): add profile subscription cubit and state

* test(profile-sub): add profile subscription cubit coverage

* feat(uikit): add sectionTitle text token

* feat(profile-ui): add cancel subscription dialog flow

* feat(profile): add refresh cubit for updating profile page after sub cancel

* docs: update CHANGELOG.md

* fix(profile): delegate profile refresh callback to ProfileRefreshCubit

* fix(subs-ui): delete unused bloc provider

* chore(sub-tests): change verify check in ProfileSubscriptionCubit test
* feat(cards-domain): add saved cards contracts

* feat(cards-data): implement cards repository and api client

* test(cards-repo): add saved cards repository coverage

* feat(profile): add cards cubits for profile section

* test(profile): add cards cubit coverage

* feat(profile-ui): add saved cards section

* test(cards): add save-card validator coverage

* docs: update CHANGELOG.md

* feat(profile-cards): polish ui to match the layout

* fix(profile-cards): preserve the caret position when reformatting the card number

* fix(profile-cards): allow normal mixed-case cardholder input

* fix(cards-domain): change CardsFailureMapper checks

* fix(profile-cards-ui): disable delete while a set-default request is running

* fix(profile-cards-ui): add an accessible label to this icon-only delete control
@CowboyGH CowboyGH self-assigned this Apr 4, 2026
@CowboyGH CowboyGH added area: network API, requests, and data parsing area: ui/ux Widgets, layout, animations, or design area: logic State management and business logic type: feature New feature or request labels Apr 4, 2026
@coderabbitai

coderabbitai Bot commented Apr 4, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 184 files, which is 34 over the limit of 150.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 1bcf854d-da7f-4d50-ad38-4d45126bbccc

📥 Commits

Reviewing files that changed from the base of the PR and between 58d1236 and 5236c7c.

⛔ Files ignored due to path filters (10)
  • assets/icons/arrow_down.svg is excluded by !**/*.svg
  • assets/icons/card_big.svg is excluded by !**/*.svg
  • assets/icons/card_small.svg is excluded by !**/*.svg
  • assets/icons/close_variant.svg is excluded by !**/*.svg
  • assets/icons/notification.svg is excluded by !**/*.svg
  • assets/icons/plus.svg is excluded by !**/*.svg
  • assets/icons/stats.svg is excluded by !**/*.svg
  • assets/images/line_variant.svg is excluded by !**/*.svg
  • ios/Podfile.lock is excluded by !**/*.lock
  • pubspec.lock is excluded by !**/*.lock
📒 Files selected for processing (184)
  • CHANGELOG.md
  • lib/core/constants/app_assets.dart
  • lib/core/constants/app_strings.dart
  • lib/core/di/di.dart
  • lib/core/failures/feature/cards/cards_failure.dart
  • lib/core/failures/feature/profile/profile_failure.dart
  • lib/core/failures/feature/subscriptions/subscriptions_failure.dart
  • lib/core/network/api_paths.dart
  • lib/core/network/mappers/image_url_mapper.dart
  • lib/core/router/router.dart
  • lib/core/router/router_paths.dart
  • lib/features/auth/presentation/cubits/auth_session_cubit.dart
  • lib/features/cards/data/dto/save_card_request_dto.dart
  • lib/features/cards/data/dto/saved_card_dto.dart
  • lib/features/cards/data/dto/saved_cards_response_dto.dart
  • lib/features/cards/data/mappers/cards_failure_mapper.dart
  • lib/features/cards/data/mappers/saved_card_mapper.dart
  • lib/features/cards/data/remote/cards_api_client.dart
  • lib/features/cards/data/repositories/cards_repository_impl.dart
  • lib/features/cards/domain/entities/save_card_payload.dart
  • lib/features/cards/domain/entities/saved_card.dart
  • lib/features/cards/domain/repositories/cards_repository.dart
  • lib/features/cards/presentation/cubits/cards_cubit.dart
  • lib/features/cards/presentation/cubits/cards_state.dart
  • lib/features/cards/presentation/cubits/delete_card_cubit.dart
  • lib/features/cards/presentation/cubits/delete_card_state.dart
  • lib/features/cards/presentation/cubits/save_card_cubit.dart
  • lib/features/cards/presentation/cubits/save_card_state.dart
  • lib/features/cards/presentation/cubits/set_default_card_cubit.dart
  • lib/features/cards/presentation/cubits/set_default_card_state.dart
  • lib/features/cards/presentation/validators/card_form_validators.dart
  • lib/features/cards/presentation/widgets/card_form_text_field.dart
  • lib/features/cards/presentation/widgets/save_card_dialog.dart
  • lib/features/debug/presentation/debug_screen.dart
  • lib/features/profile/data/dto/active_profile_subscription_dto.dart
  • lib/features/profile/data/dto/change_password_request_dto.dart
  • lib/features/profile/data/dto/params/profile_current_parameters_response_dto.dart
  • lib/features/profile/data/dto/params/profile_parameters_references_response_dto.dart
  • lib/features/profile/data/dto/params/profile_parameters_request_dto.dart
  • lib/features/profile/data/dto/profile_test_history_item_dto.dart
  • lib/features/profile/data/dto/profile_user_data_dto.dart
  • lib/features/profile/data/dto/profile_user_dto.dart
  • lib/features/profile/data/dto/profile_user_response_dto.dart
  • lib/features/profile/data/dto/profile_workout_history_item_dto.dart
  • lib/features/profile/data/dto/stats/frequency_response_dto.dart
  • lib/features/profile/data/dto/stats/profile_exercises_response_dto.dart
  • lib/features/profile/data/dto/stats/profile_statistics_overview_response_dto.dart
  • lib/features/profile/data/dto/stats/profile_workouts_response_dto.dart
  • lib/features/profile/data/dto/stats/trend_response_dto.dart
  • lib/features/profile/data/dto/stats/volume_response_dto.dart
  • lib/features/profile/data/dto/update_profile_request_dto.dart
  • lib/features/profile/data/mappers/profile_failure_mapper.dart
  • lib/features/profile/data/mappers/profile_history_snapshot_mapper.dart
  • lib/features/profile/data/mappers/profile_parameters_mapper.dart
  • lib/features/profile/data/mappers/profile_phase_snapshot_mapper.dart
  • lib/features/profile/data/mappers/profile_statistics_mapper.dart
  • lib/features/profile/data/mappers/profile_user_entity_mapper.dart
  • lib/features/profile/data/remote/profile_api_client.dart
  • lib/features/profile/data/remote/profile_parameters_api_client.dart
  • lib/features/profile/data/remote/profile_statistics_api_client.dart
  • lib/features/profile/data/repositories/profile_parameters_repository_impl.dart
  • lib/features/profile/data/repositories/profile_repository_impl.dart
  • lib/features/profile/data/repositories/profile_statistics_repository_impl.dart
  • lib/features/profile/domain/entities/profile_parameters/profile_parameters_data.dart
  • lib/features/profile/domain/entities/profile_parameters/profile_parameters_gender.dart
  • lib/features/profile/domain/entities/profile_parameters/profile_parameters_option.dart
  • lib/features/profile/domain/entities/profile_parameters/profile_parameters_references.dart
  • lib/features/profile/domain/entities/profile_parameters/profile_parameters_snapshot.dart
  • lib/features/profile/domain/entities/profile_parameters/profile_parameters_submit_payload.dart
  • lib/features/profile/domain/entities/profile_phase_snapshot.dart
  • lib/features/profile/domain/entities/profile_statistics/frequency_period.dart
  • lib/features/profile/domain/entities/profile_statistics/frequency_statistics_data.dart
  • lib/features/profile/domain/entities/profile_statistics/profile_current_phase_summary.dart
  • lib/features/profile/domain/entities/profile_statistics/profile_exercise_option.dart
  • lib/features/profile/domain/entities/profile_statistics/profile_history_tab.dart
  • lib/features/profile/domain/entities/profile_statistics/profile_statistics_mode.dart
  • lib/features/profile/domain/entities/profile_statistics/profile_workout_option.dart
  • lib/features/profile/domain/entities/profile_statistics/trend_statistics_data.dart
  • lib/features/profile/domain/entities/profile_statistics/volume_statistics_data.dart
  • lib/features/profile/domain/entities/profile_stats_history_snapshot.dart
  • lib/features/profile/domain/repositories/profile_parameters_repository.dart
  • lib/features/profile/domain/repositories/profile_repository.dart
  • lib/features/profile/domain/repositories/profile_statistics_repository.dart
  • lib/features/profile/presentation/cubits/change_password_cubit.dart
  • lib/features/profile/presentation/cubits/change_password_state.dart
  • lib/features/profile/presentation/cubits/delete_profile_cubit.dart
  • lib/features/profile/presentation/cubits/delete_profile_state.dart
  • lib/features/profile/presentation/cubits/profile_parameters_cubit.dart
  • lib/features/profile/presentation/cubits/profile_parameters_state.dart
  • lib/features/profile/presentation/cubits/profile_refresh_cubit.dart
  • lib/features/profile/presentation/cubits/profile_refresh_state.dart
  • lib/features/profile/presentation/cubits/profile_statistics_cubit.dart
  • lib/features/profile/presentation/cubits/profile_statistics_state.dart
  • lib/features/profile/presentation/cubits/profile_subscription_cubit.dart
  • lib/features/profile/presentation/cubits/profile_subscription_state.dart
  • lib/features/profile/presentation/cubits/profile_user_cubit.dart
  • lib/features/profile/presentation/cubits/profile_user_state.dart
  • lib/features/profile/presentation/cubits/update_profile_cubit.dart
  • lib/features/profile/presentation/cubits/update_profile_state.dart
  • lib/features/profile/presentation/pages/profile_page.dart
  • lib/features/profile/presentation/pages/profile_page_builder.dart
  • lib/features/profile/presentation/widgets/change_password_dialog.dart
  • lib/features/profile/presentation/widgets/current_phase_section_widget.dart
  • lib/features/profile/presentation/widgets/edit_profile_dialog.dart
  • lib/features/profile/presentation/widgets/profile_bottom_section_widget.dart
  • lib/features/profile/presentation/widgets/profile_cards_section_widget.dart
  • lib/features/profile/presentation/widgets/profile_dialog_shell.dart
  • lib/features/profile/presentation/widgets/profile_parameters_section_widget.dart
  • lib/features/profile/presentation/widgets/profile_statistics_trend_chart.dart
  • lib/features/profile/presentation/widgets/profile_subscription_section_widget.dart
  • lib/features/profile/presentation/widgets/stats/profile_history_dialog.dart
  • lib/features/profile/presentation/widgets/stats/profile_statistics_bar_chart.dart
  • lib/features/profile/presentation/widgets/stats/stats_section_widget.dart
  • lib/features/profile/presentation/widgets/user_section_widget.dart
  • lib/features/subscriptions/data/dto/subscription_catalog_item_dto.dart
  • lib/features/subscriptions/data/dto/subscription_payment_request_dto.dart
  • lib/features/subscriptions/data/dto/subscription_response_dto.dart
  • lib/features/subscriptions/data/dto/subscriptions_response_dto.dart
  • lib/features/subscriptions/data/mappers/subscription_catalog_mapper.dart
  • lib/features/subscriptions/data/mappers/subscription_image_url_mapper.dart
  • lib/features/subscriptions/data/mappers/subscriptions_failure_mapper.dart
  • lib/features/subscriptions/data/remote/subscription_payment_api_client.dart
  • lib/features/subscriptions/data/remote/subscriptions_api_client.dart
  • lib/features/subscriptions/data/repositories/subscriptions_repository_impl.dart
  • lib/features/subscriptions/domain/entities/subscription_catalog_item.dart
  • lib/features/subscriptions/domain/entities/subscription_payment_payload.dart
  • lib/features/subscriptions/domain/repositories/subscriptions_repository.dart
  • lib/features/subscriptions/presentation/cubits/cancel_subscription_cubit.dart
  • lib/features/subscriptions/presentation/cubits/cancel_subscription_state.dart
  • lib/features/subscriptions/presentation/cubits/subscription_details_cubit.dart
  • lib/features/subscriptions/presentation/cubits/subscription_details_state.dart
  • lib/features/subscriptions/presentation/cubits/subscription_payment_cubit.dart
  • lib/features/subscriptions/presentation/cubits/subscription_payment_state.dart
  • lib/features/subscriptions/presentation/cubits/subscriptions_cubit.dart
  • lib/features/subscriptions/presentation/cubits/subscriptions_state.dart
  • lib/features/subscriptions/presentation/pages/subscriptions_catalog_page.dart
  • lib/features/subscriptions/presentation/pages/subscriptions_catalog_page_builder.dart
  • lib/features/subscriptions/presentation/pages/subscriptions_details_page.dart
  • lib/features/subscriptions/presentation/pages/subscriptions_details_page_builder.dart
  • lib/features/subscriptions/presentation/validators/subscription_payment_validators.dart
  • lib/features/subscriptions/presentation/widgets/subscription_card.dart
  • lib/features/subscriptions/presentation/widgets/subscription_payment_dialog.dart
  • lib/features/subscriptions/presentation/widgets/subscription_payment_text_field.dart
  • lib/features/workouts/data/mappers/workout_image_url_mapper.dart
  • lib/features/workouts/overview/presentation/pages/workouts_overview_page_builder.dart
  • lib/uikit/buttons/button_size.dart
  • lib/uikit/buttons/option_button.dart
  • lib/uikit/cards/app_card.dart
  • lib/uikit/inputs/app_input_field.dart
  • lib/uikit/menus/app_selection_dropdown.dart
  • lib/uikit/themes/text/app_text_style.dart
  • lib/uikit/themes/text/app_text_theme.dart
  • pubspec.yaml
  • test/features/auth/presentation/cubits/auth_session_cubit_test.dart
  • test/features/cards/data/repositories/cards_repository_impl_test.dart
  • test/features/cards/presentation/cubits/cards_cubit_test.dart
  • test/features/cards/presentation/cubits/delete_card_cubit_test.dart
  • test/features/cards/presentation/cubits/save_card_cubit_test.dart
  • test/features/cards/presentation/cubits/set_default_card_cubit_test.dart
  • test/features/cards/presentation/validators/card_form_validators_test.dart
  • test/features/cards/support/cards_dto_fixtures.dart
  • test/features/profile/data/mappers/profile_failure_mapper_test.dart
  • test/features/profile/data/mappers/profile_statistics_mapper_test.dart
  • test/features/profile/data/repositories/profile_parameters_repository_impl_test.dart
  • test/features/profile/data/repositories/profile_repository_impl_test.dart
  • test/features/profile/data/repositories/profile_statistics_repository_impl_test.dart
  • test/features/profile/presentation/cubits/change_password_cubit_test.dart
  • test/features/profile/presentation/cubits/delete_profile_cubit_test.dart
  • test/features/profile/presentation/cubits/profile_parameters_cubit_test.dart
  • test/features/profile/presentation/cubits/profile_statistics_cubit_test.dart
  • test/features/profile/presentation/cubits/profile_subscription_cubit_test.dart
  • test/features/profile/presentation/cubits/profile_user_cubit_test.dart
  • test/features/profile/presentation/cubits/update_profile_cubit_test.dart
  • test/features/profile/support/profile_dto_fixtures.dart
  • test/features/profile/support/profile_parameters_dto_fixtures.dart
  • test/features/profile/support/profile_statistics_dto_fixtures.dart
  • test/features/subscriptions/data/mappers/subscriptions_failure_mapper_test.dart
  • test/features/subscriptions/data/repositories/subscriptions_repository_impl_test.dart
  • test/features/subscriptions/presentation/cubits/cancel_subscription_cubit_test.dart
  • test/features/subscriptions/presentation/cubits/subscription_details_cubit_test.dart
  • test/features/subscriptions/presentation/cubits/subscription_payment_cubit_test.dart
  • test/features/subscriptions/presentation/cubits/subscriptions_cubit_test.dart
  • test/features/subscriptions/presentation/validators/subscription_payment_validators_test.dart
  • test/features/subscriptions/support/subscriptions_dto_fixtures.dart

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/profile

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@CowboyGH
CowboyGH merged commit 7cc8be4 into develop Apr 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: logic State management and business logic area: network API, requests, and data parsing area: ui/ux Widgets, layout, animations, or design type: feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant