Skip to content

ANDR-35: Profile. Логика + тесты#127

Open
Nuriua wants to merge 14 commits intoepic/ANDR-31from
feature/ANDR-35
Open

ANDR-35: Profile. Логика + тесты#127
Nuriua wants to merge 14 commits intoepic/ANDR-31from
feature/ANDR-35

Conversation

@Nuriua
Copy link
Collaborator

@Nuriua Nuriua commented Mar 19, 2026

🧩 Что сделано:

  • Добавлен UseCase c 1 suspend operator fun invoke()
  • Собран Flow State
  • Сделан маппинг через ScreenMapper.getScreenState()
  • Добавлены Command'ы + функция HandleCommands ()
  • Юнит-тест на ProfileScreenMapper

🗂 Затронутые модули:
feature -> profile -> impl


sealed interface ProfileEvent {

data class SocialNetworkOpened(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тоже название через OnSocialNetworkClicked или что-то такое

)
userData: DomainUserProfile,
): ProfileScreenState =
ProfileScreenState.Success(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А у нас разве тут не можешь быть ошибочного состояния, состояния загрузки? Кажется, этим всем должен заправлять именно маппер

throw ce
} catch (e: IOException) {
Timber.e(e, "Network error in mapper")
ProfileScreenState.Error(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тоже надо прокидывать в маппер. Как вариант, просто кидать эксепшион как ошибку в маппер, остальное - как null. Важно, чтобы вся обработка была в маппере

)
)

fun mapToLoading(): ProfileScreenState.Loading = ProfileScreenState.Loading
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private fun, у нас одна точка входа - функция map

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

исправила

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants